87 const std::optional<HubConfig>& hubConfig = std::nullopt,
88 const std::optional<TowerConfig>&
towerConfig = std::nullopt,
89 const std::optional<VAWTConfig>&
vawtConfig = std::nullopt,
104 hubLength(hubConfig ? hubConfig->length : 0.0),
105 hubRadius(hubConfig ? hubConfig->radius : 0.0),
126 const real deltaX = this->para->getScaledLengthRatio(
level);
129 throw std::runtime_error(
"ActuatorFarm::ActuatorFarm: smearing width needs to be larger than dx!");
131 throw std::runtime_error(
"ActuatorFarm::ActuatorFarm: turbine positions need to have the same length!");
133 throw std::runtime_error(
"ActuatorFarm::ActuatorFarm: number of blades must be larger than zero!");
135 throw std::runtime_error(
"ActuatorFarm::ActuatorFarm: tower heights vector size (" + std::to_string(
towerHeights.size())
136 +
") must match number of turbines (" + std::to_string(
numberOfTurbines) +
")!");
138 throw std::runtime_error(
"ActuatorFarm::ActuatorFarm: VAWT vawtRotorHeight must be non-negative!");
147 VF_LOG_INFO(
"rotor diameter [m] = {}", this->diameter);
148 VF_LOG_INFO(
"nodes per diameter = {}", this->diameter / deltaX);
151 VF_LOG_INFO(
"smearing width [m] = {} ", this->smearingWidth);
152 VF_LOG_INFO(
"smearing width / dx = {} ",this->smearingWidth/deltaX);
171 void write(
const std::string& filename)
const;
286 std::vector<std::vector<double>>&)
const {};
289 void initTurbineGeometries();
290 void initBoundingVolumes();
292 void initVelocities();
295 std::string getFilename(
uint t)
const;
296 void swapDeviceArrays();
std::vector< real > initialTurbinePositionsZ
real * getAllVelocitiesXDevice() const
real * getAllHubForcesZ() const
real * forcesYDCurrentTimestep
real * getAllTowerForcesXDevice() const
const uint numberOfBladePoints
real * velocitiesZDCurrentTimestep
real * coordsZDPreviousTimestep
real * coordsXDCurrentTimestep
real * getAllTowerCoordsYDevice() const
real * getAllBladeVelocitiesY() const
real * getAllBladeVelocitiesZ() const
uint getNumberOfBladesPerTurbine() const
const real hubPositionOffset
real * getAllBladeLocalSmearingWidth() const
real * getAllForcesYDevice() const
real * getAllHubCoordsYDevice() const
real * getAllTowerCoordsZDevice() const
void setTurbineAzimuth(size_t turbine, real azimuth)
real * getAllTowerCoordsX() const
bool getFlagLocalSmearingWidth() const
real * forcesZDPreviousTimestep
void setTurbineBladeForces(size_t turbine, const real *bladeForcesX, const real *bladeForcesY, const real *bladeForcesZ) const
uint * boundingVolumeIndicesH
real * forcesXDPreviousTimestep
real * getAllForcesZDevice() const
const bool flagLocalSmearingWidth
uint getNumberOfBladePoints() const
const uint numberOfTowerPointsPerTurbine
const uint numberOfTowerPoints
real * getAllHubVelocitiesXDevice() const
const uint numberOfHubPoints
const real floatingMaximumAmplitudeX
real * getAllBladeCoordsXDevice() const
uint getNumberOfHubPoints() const
real * getAllBladeForcesY() const
real * localSmearingWidthDPreviousTimestep
void setAllBladeCoords(const real *bladeCoordsX, const real *bladeCoordsY, const real *bladeCoordsZ) const
real * getAllCoordsZDevice() const
real * getAllHubCoordsX() const
real * coordsYDCurrentTimestep
real * getAllBladeCoordsX() const
real * getAllBladeVelocitiesXDevice() const
real * getAllTowerForcesZDevice() const
void setAllBladeForces(const real *bladeForcesX, const real *bladeForcesY, const real *bladeForcesZ) const
real * getAllForcesXDevice() const
real * getAllHubForcesXDevice() const
real * getAllTurbinePosZ() const
uint getNumberOfBladePointsPerTurbine() const
const uint numberOfHubPointsPerTurbine
const uint numberOfBlades
real * velocitiesXDPreviousTimestep
real * forcesZDCurrentTimestep
uint getNumberOfPointsPerBlade() const
const uint numberOfBladePointsPerTurbine
uint getNumberOfHubPointsPerTurbine() const
real * getAllBladeForcesYDevice() const
real * coordsXDPreviousTimestep
ActuatorFarm(SPtr< Parameter > para, SPtr< CudaMemoryManager > cudaMemoryManager, const real diameter, const std::vector< real > &bladeRadii, const std::vector< real > &turbinePositionsX, const std::vector< real > &turbinePositionsY, const std::vector< real > &turbinePositionsZ, const real smearingWidth, const int level, const bool useHostArrays, const uint numberOfBlades=3, const std::optional< HubConfig > &hubConfig=std::nullopt, const std::optional< TowerConfig > &towerConfig=std::nullopt, const std::optional< VAWTConfig > &vawtConfig=std::nullopt, const std::optional< FloatingConfig > &floatingConfig=std::nullopt)
real * velocitiesXDCurrentTimestep
real * getAllTowerCoordsY() const
real * coordsYDPreviousTimestep
real getTurbinePosZ(size_t turbine) const
real * getAllTowerCoordsZ() const
uint getNumberOfTurbines() const
real * velocitiesYDPreviousTimestep
real * localSmearingWidthDCurrentTimestep
real * getAllHubVelocitiesX() const
real * getAllHubCoordsY() const
bool useLocalSmearingWidth() const
std::vector< real > initialTurbinePositionsX
real * localSmearingWidthH
bool requiresLocalSmearingWidth() const
real * getAllBladeForcesZDevice() const
real * getAllTowerVelocitiesXDevice() const
real * velocitiesYDCurrentTimestep
std::vector< real > azimuths
real * getAllTowerVelocitiesX() const
const real vawtRotorHeight
real * getAllTowerVelocitiesZ() const
virtual void appendOutputData(std::vector< std::string > &, std::vector< std::vector< double > > &) const
real * getAllBladeVelocitiesX() const
real * getAllBladeVelocitiesYDevice() const
real * getAllTurbinePosY() const
real * getAllBladeForcesX() const
void setAllBladeVelocities(const real *bladeVelocitiesX, const real *bladeVelocitiesY, const real *bladeVelocitiesZ) const
const real floatingMaximumAmplitudeY
real * getAllTowerVelocitiesYDevice() const
real * getAllHubCoordsZDevice() const
real * getAllTurbinePosX() const
real * forcesYDPreviousTimestep
real * forcesXDCurrentTimestep
void getTaggedFluidNodes(GridProvider *gridProvider) override
real * getAllCoordsXDevice() const
real * getAllTowerVelocitiesZDevice() const
real getTurbinePosY(size_t turbine) const
real * getAllBladeVelocitiesZDevice() const
real * getAllHubForcesYDevice() const
real * getAllBladeForcesZ() const
real * getAllBladeCoordsYDevice() const
real vawtBoundingSmearingWidth
real getRotorBoundingSmearingWidth() const
real * getAllBladeCoordsY() const
uint getNumberOfTowerPoints() const
uint getNumberOfTowerPointsPerTurbine() const
real getTurbinePosX(size_t turbine) const
real * getAllHubVelocitiesZ() const
real * getAllHubVelocitiesY() const
const real maxFloatingAmplitude
real * getAllHubCoordsZ() const
real getVAWTRotorHeight() const
void setTurbineBladeCoords(size_t turbine, const real *bladeCoordsX, const real *bladeCoordsY, const real *bladeCoordsZ) const
real * getAllTowerCoordsXDevice() const
void enableOutput(const std::string &outputName, uint tStart, uint tOut)
real * getAllVelocitiesZDevice() const
real * getAllTowerVelocitiesY() const
real getVAWTRotorBoundingMargin() const
real * getAllBladeLocalSmearingWidthDevice() const
virtual void updateForcesAndCoordinates(real time, real deltaT)=0
const uint numberOfPointsPerBlade
void setTurbineBladeVelocities(size_t turbine, const real *bladeVelocitiesX, const real *bladeVelocitiesY, const real *bladeVelocitiesZ) const
real * velocitiesZDPreviousTimestep
real * getAllHubVelocitiesYDevice() const
uint getTotalNumberOfPoints() const
real * getAllHubCoordsXDevice() const
real * getAllTowerForcesY() const
std::vector< real > bladeRadii
real * getAllHubForcesY() const
real * getAllHubForcesX() const
real * coordsZDCurrentTimestep
real * getAllTowerForcesZ() const
real * getAllCoordsYDevice() const
std::vector< real > initialTurbinePositionsY
uint getNumberOfIndices() const
const std::vector< real > towerHeights
void interact(int level, uint t) override
void write(const std::string &filename) const
real * getAllHubForcesZDevice() const
real * getAllTowerForcesX() const
real * getAllBladeCoordsZDevice() const
const uint numberOfTurbines
const real floatingMaximumAmplitudeZ
real * getAllHubVelocitiesZDevice() const
real * getAllBladeForcesXDevice() const
uint * boundingVolumeIndicesD
real * getAllTowerForcesYDevice() const
bool hasVAWTRotorVolume() const
real * getAllBladeCoordsZ() const
real * getAllVelocitiesYDevice() const
SPtr< CudaMemoryManager > cudaMemoryManager
std::shared_ptr< T > SPtr
uint numberOfPointsPerTurbine
std::vector< real > towerHeights
uint numberOfPointsPerTurbine
bool flagLocalSmearingWidth