|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
Manage a collection of wind turbine models. More...
#include <ERF_WindFarm.H>


Public Member Functions | |
| WindFarm () | |
| virtual | ~WindFarm ()=default |
| WindFarm (int nlev, const WindFarmType &a_windfarm_type) | |
| void | read_tables (std::string windfarm_loc_table, std::string windfarm_spec_table, bool x_y, bool lat_lon, const amrex::Real windfarm_x_shift=zero, const amrex::Real windfarm_y_shift=zero) |
| Read turbine location and specification tables. More... | |
| void | init_windfarm_lat_lon (const std::string windfarm_loc_table, const amrex::Real windfarm_x_shift, const amrex::Real windfarm_y_shift) |
| Initialize wind farm using latitude and longitude coordinates. More... | |
| void | init_windfarm_x_y (const std::string windfarm_loc_table) |
| Initialize wind farm using Cartesian coordinates. More... | |
| void | read_windfarm_locations_table (const std::string windfarm_loc_table, bool x_y, bool lat_lon, const amrex::Real windfarm_x_shift=zero, const amrex::Real windfarm_y_shift=zero) |
| Read the turbine location table. More... | |
| void | read_windfarm_spec_table (const std::string windfarm_spec_table) |
| Read the turbine specification table. More... | |
| void | read_windfarm_blade_table (const std::string windfarm_blade_table) |
| Read the turbine blade table. More... | |
| void | read_windfarm_airfoil_tables (const std::string windfarm_airfoil_tables, const std::string windfarm_blade_table) |
| Read the airfoil tables. More... | |
| void | read_windfarm_spec_table_extra (const std::string windfarm_spec_table_extra) |
| Read extra turbine specifications. More... | |
| void | fill_Nturb_multifab (const amrex::Geometry &geom, amrex::MultiFab &mf_Nturb, std::unique_ptr< amrex::MultiFab > &z_phys_nd) |
| Fill the turbine count MultiFab. More... | |
| void | fill_SMark_multifab (const amrex::Geometry &geom, amrex::MultiFab &mf_SMark, const amrex::Real &sampling_distance_by_D, const amrex::Real &turb_disk_angle, std::unique_ptr< amrex::MultiFab > &z_phys_cc) |
| Fill the SMark MultiFab. More... | |
| void | fill_SMark_multifab_mesoscale_models (const amrex::Geometry &geom, amrex::MultiFab &mf_SMark, const amrex::MultiFab &mf_Nturb, std::unique_ptr< amrex::MultiFab > &z_phys_cc) |
| Fill the SMark MultiFab for mesoscale models. More... | |
| void | write_turbine_locations_vtk () |
| Write turbine locations to a VTK file. More... | |
| void | write_actuator_disks_vtk (const amrex::Geometry &geom, const amrex::Real &sampling_distance_by_D) |
| Write actuator disks to a VTK file. More... | |
| void | advance (const amrex::Geometry &a_geom, const double &dt_advance, amrex::MultiFab &cons_in, amrex::MultiFab &mf_vars_windfarm, amrex::MultiFab &U_old, amrex::MultiFab &V_old, amrex::MultiFab &W_old, const amrex::MultiFab &mf_Nturb, const amrex::MultiFab &mf_SMark, const double &time) override |
| Advance the wind farm model in time. More... | |
| void | set_turb_spec (const amrex::Real &a_rotor_rad, const amrex::Real &a_hub_height, const amrex::Real &a_thrust_coeff_standing, const amrex::Vector< amrex::Real > &a_wind_speed, const amrex::Vector< amrex::Real > &a_thrust_coeff, const amrex::Vector< amrex::Real > &a_power) override |
| Set general turbine specifications. More... | |
| void | set_turb_loc (const amrex::Vector< amrex::Real > &a_xloc, const amrex::Vector< amrex::Real > &a_yloc) override |
| Set turbine locations. More... | |
| void | set_turb_disk_angle (const amrex::Real &a_turb_disk_angle) override |
| Set the turbine disk angle. More... | |
| void | set_blade_spec (const amrex::Vector< amrex::Real > &a_bld_rad_loc, const amrex::Vector< amrex::Real > &a_bld_twist, const amrex::Vector< amrex::Real > &a_bld_chord) override |
| Set blade specifications. More... | |
| void | set_blade_airfoil_spec (const amrex::Vector< amrex::Vector< amrex::Real >> &a_bld_airfoil_aoa, const amrex::Vector< amrex::Vector< amrex::Real >> &a_bld_airfoil_Cl, const amrex::Vector< amrex::Vector< amrex::Real >> &a_bld_airfoil_Cd) override |
| Set blade airfoil specifications. More... | |
| void | set_turb_spec_extra (const amrex::Vector< amrex::Real > &a_velocity, const amrex::Vector< amrex::Real > &a_C_P, const amrex::Vector< amrex::Real > &a_C_T, const amrex::Vector< amrex::Real > &a_rotor_RPM, const amrex::Vector< amrex::Real > &a_blade_pitch) override |
| Set extra turbine specifications. More... | |
Public Member Functions inherited from NullWindFarm | |
| NullWindFarm () | |
| virtual | ~NullWindFarm ()=default |
| void | get_turb_spec (amrex::Real &rotor_rad, amrex::Real &hub_height, amrex::Real &thrust_coeff_standing, amrex::Vector< amrex::Real > &wind_speed, amrex::Vector< amrex::Real > &thrust_coeff, amrex::Vector< amrex::Real > &power) |
| void | get_turb_loc (amrex::Vector< amrex::Real > &xloc, amrex::Vector< amrex::Real > &yloc) |
| void | get_turb_disk_angle (amrex::Real &turb_disk_angle) |
| void | get_blade_spec (amrex::Vector< amrex::Real > &bld_rad_loc, amrex::Vector< amrex::Real > &bld_twist, amrex::Vector< amrex::Real > &bld_chord) |
| void | get_blade_airfoil_spec (amrex::Vector< amrex::Vector< amrex::Real >> &bld_airfoil_aoa, amrex::Vector< amrex::Vector< amrex::Real >> &bld_airfoil_Cl, amrex::Vector< amrex::Vector< amrex::Real >> &bld_airfoil_Cd) |
| void | get_turb_spec_extra (amrex::Vector< amrex::Real > &velocity, amrex::Vector< amrex::Real > &C_P, amrex::Vector< amrex::Real > &C_T, amrex::Vector< amrex::Real > &rotor_RPM, amrex::Vector< amrex::Real > &blade_pitch) |
Protected Member Functions | |
| template<class NewWindFarmModel > | |
| void | SetModel () |
| Create and set the specified windfarm model. More... | |
Private Attributes | |
| amrex::Vector< std::unique_ptr< NullWindFarm > > | m_windfarm_model |
Additional Inherited Members | |
Static Public Member Functions inherited from NullWindFarm | |
| static AMREX_GPU_DEVICE bool | find_if_marked (amrex::Real x1, amrex::Real x2, amrex::Real y1, amrex::Real y2, amrex::Real x0, amrex::Real y0, amrex::Real nx, amrex::Real ny, amrex::Real d_hub_height, amrex::Real d_rotor_rad, amrex::Real z) |
Manage a collection of wind turbine models.
|
virtualdefault |
|
inline |
|
inlineoverridevirtual |
Advance the wind farm model in time.
| [in] | a_geom | Geometry |
| [in] | dt_advance | Timestep. |
| [in,out] | cons_in | Conservative variables. |
| [in,out] | mf_vars_windfarm | Wind farm variables MultiFab. |
| [in,out] | U_old | Old x-velocity MultiFab. |
| [in,out] | V_old | Old y-velocity MultiFab. |
| [in,out] | W_old | Old z-velocity MultiFab. |
| [in] | mf_Nturb | Turbine count MultiFab. |
| [in] | mf_SMark | SMark MultiFab. |
| [in] | time | Current simulation time. |
Implements NullWindFarm.
| void WindFarm::fill_Nturb_multifab | ( | const amrex::Geometry & | geom, |
| amrex::MultiFab & | mf_Nturb, | ||
| std::unique_ptr< amrex::MultiFab > & | z_phys_nd | ||
| ) |
Fill the turbine count MultiFab.
| [in] | geom | Geometry |
| [out] | mf_Nturb | MultiFab to fill with turbine counts. |
| [in,out] | z_phys_nd | Physical height MultiFab. |
Fill a MultiFab with the number of turbines per cell and determine base heights.
| [in] | geom | Geometry defining the domain. |
| [in,out] | mf_Nturb | MultiFab to be filled with turbine counts per cell. |
| [in] | z_phys_nd | Node-centered physical height FAB. |

| void WindFarm::fill_SMark_multifab | ( | const amrex::Geometry & | geom, |
| amrex::MultiFab & | mf_SMark, | ||
| const amrex::Real & | sampling_distance_by_D, | ||
| const amrex::Real & | turb_disk_angle, | ||
| std::unique_ptr< amrex::MultiFab > & | z_phys_cc | ||
| ) |
Fill the SMark MultiFab.
| [in] | geom | Geometry |
| [out] | mf_SMark | MultiFab to fill with SMark values. |
| [in] | sampling_distance_by_D | Sampling distance normalized by rotor diameter. |
| [in] | turb_disk_angle | Turbine disk angle. |
| [in,out] | z_phys_cc | Physical height MultiFab. |
Fill the SMark MultiFab identifying turbine disks and sampling points.
| [in] | geom | Geometry defining the domain. |
| [in,out] | mf_SMark | MultiFab to be filled with turbine markers. |
| [in] | sampling_distance_by_D | Normalized sampling distance. |
| [in] | turb_disk_angle | Angle of the turbine disk in degrees. |
| [in] | z_phys_cc | Cell-centered physical height FAB. |

| void WindFarm::fill_SMark_multifab_mesoscale_models | ( | const amrex::Geometry & | geom, |
| amrex::MultiFab & | mf_SMark, | ||
| const amrex::MultiFab & | mf_Nturb, | ||
| std::unique_ptr< amrex::MultiFab > & | z_phys_cc | ||
| ) |
Fill the SMark MultiFab for mesoscale models.
| [in] | geom | Geometry |
| [out] | mf_SMark | MultiFab to fill with SMark values. |
| [in] | mf_Nturb | MultiFab containing turbine counts. |
| [in,out] | z_phys_cc | Physical height MultiFab. |
Fill the SMark MultiFab for mesoscale model parametrization.
| [in] | geom | Geometry defining the domain. |
| [in,out] | mf_SMark | MultiFab to be filled with turbine markers. |
| [in] | mf_Nturb | MultiFab containing turbine counts per cell. |
| [in] | z_phys_nd | Node-centered physical height FAB. |

| void WindFarm::init_windfarm_lat_lon | ( | const std::string | windfarm_loc_table, |
| const amrex::Real | windfarm_x_shift, | ||
| const amrex::Real | windfarm_y_shift | ||
| ) |
Initialize wind farm using latitude and longitude coordinates.
| [in] | windfarm_loc_table | Path to the location table. |
| [in] | windfarm_x_shift | X-coordinate shift. |
| [in] | windfarm_y_shift | Y-coordinate shift. |
Initialize turbine locations from latitude and longitude coordinates.
| [in] | windfarm_loc_table | Path to the turbine locations table. |
| [in] | windfarm_x_shift | Shift applied to the resulting x coordinates. |
| [in] | windfarm_y_shift | Shift applied to the resulting y coordinates. |

| void WindFarm::init_windfarm_x_y | ( | const std::string | windfarm_loc_table | ) |
Initialize wind farm using Cartesian coordinates.
| [in] | windfarm_loc_table | Path to the location table. |
Initialize turbine locations from Cartesian x and y coordinates.
| [in] | windfarm_loc_table | Path to the turbine locations table. |
| void WindFarm::read_tables | ( | std::string | windfarm_loc_table, |
| std::string | windfarm_spec_table, | ||
| bool | x_y, | ||
| bool | lat_lon, | ||
| const amrex::Real | windfarm_x_shift = zero, |
||
| const amrex::Real | windfarm_y_shift = zero |
||
| ) |
Read turbine location and specification tables.
| [in] | windfarm_loc_table | Path to the location table. |
| [in] | windfarm_spec_table | Path to the specification table. |
| [in] | x_y | Whether to use Cartesian coordinates. |
| [in] | lat_lon | Whether to use latitude and longitude coordinates. |
| [in] | windfarm_x_shift | X-coordinate shift. |
| [in] | windfarm_y_shift | Y-coordinate shift. |
Read in the turbine locations in latitude-longitude from windturbines.txt and convert it into x and y coordinates in metres
| lev | Integer specifying the current level |
| void WindFarm::read_windfarm_airfoil_tables | ( | const std::string | windfarm_airfoil_tables, |
| const std::string | windfarm_blade_table | ||
| ) |
Read the airfoil tables.
| [in] | windfarm_airfoil_tables | Path to the airfoil tables. |
| [in] | windfarm_blade_table | Path to the blade table. |
Read airfoil data from a directory of tables.
| [in] | windfarm_airfoil_tables | Path to the directory containing airfoil tables. |
| [in] | windfarm_blade_table | Path to the turbine blade properties table. |
| void WindFarm::read_windfarm_blade_table | ( | const std::string | windfarm_blade_table | ) |
Read the turbine blade table.
| [in] | windfarm_blade_table | Path to the blade table. |
Read turbine blade geometry and properties from a table.
| [in] | windfarm_blade_table | Path to the turbine blade properties table. |
| void WindFarm::read_windfarm_locations_table | ( | const std::string | windfarm_loc_table, |
| bool | x_y, | ||
| bool | lat_lon, | ||
| const amrex::Real | windfarm_x_shift = zero, |
||
| const amrex::Real | windfarm_y_shift = zero |
||
| ) |
Read the turbine location table.
| [in] | windfarm_loc_table | Path to the location table. |
| [in] | x_y | Whether to use Cartesian coordinates. |
| [in] | lat_lon | Whether to use latitude and longitude coordinates. |
| [in] | windfarm_x_shift | X-coordinate shift. |
| [in] | windfarm_y_shift | Y-coordinate shift. |
Read turbine locations from a table and convert them to Cartesian coordinates.
| [in] | windfarm_loc_table | Path to the turbine locations table. |
| [in] | x_y | Boolean indicating if locations are provided as x and y coordinates. |
| [in] | lat_lon | Boolean indicating if locations are provided as latitude and longitude. |
| [in] | windfarm_x_shift | Shift applied to the resulting x coordinates. |
| [in] | windfarm_y_shift | Shift applied to the resulting y coordinates. |
| void WindFarm::read_windfarm_spec_table | ( | const std::string | windfarm_spec_table | ) |
Read the turbine specification table.
| [in] | windfarm_spec_table | Path to the specification table. |
Read turbine performance specifications from a table.
| [in] | windfarm_spec_table | Path to the turbine specifications table. |
| void WindFarm::read_windfarm_spec_table_extra | ( | const std::string | windfarm_spec_table_extra | ) |
Read extra turbine specifications.
| [in] | windfarm_spec_table_extra | Path to the extra specification table. |
Read extended turbine performance specifications from a table.
| [in] | windfarm_spec_table_extra | Path to the extended turbine specifications table. |
|
inlineoverridevirtual |
Set blade airfoil specifications.
| [in] | a_bld_airfoil_aoa | Angle of attack. |
| [in] | a_bld_airfoil_Cl | Lift coefficient. |
| [in] | a_bld_airfoil_Cd | Drag coefficient. |
Reimplemented from NullWindFarm.
|
inlineoverridevirtual |
Set blade specifications.
| [in] | a_bld_rad_loc | Blade radial locations. |
| [in] | a_bld_twist | Blade twist. |
| [in] | a_bld_chord | Blade chord. |
Reimplemented from NullWindFarm.
|
inlineoverridevirtual |
Set the turbine disk angle.
| [in] | a_turb_disk_angle | Disk angle. |
Reimplemented from NullWindFarm.
|
inlineoverridevirtual |
Set turbine locations.
| [in] | a_xloc | X locations. |
| [in] | a_yloc | Y locations. |
Reimplemented from NullWindFarm.
|
inlineoverridevirtual |
Set general turbine specifications.
| [in] | a_rotor_rad | Rotor radius. |
| [in] | a_hub_height | Hub height. |
| [in] | a_thrust_coeff_standing | Standing thrust coefficient. |
| [in] | a_wind_speed | Wind speed vector. |
| [in] | a_thrust_coeff | Thrust coefficient vector. |
| [in] | a_power | Power vector. |
Reimplemented from NullWindFarm.
|
inlineoverridevirtual |
Set extra turbine specifications.
| [in] | a_velocity | Velocity. |
| [in] | a_C_P | Power coefficient. |
| [in] | a_C_T | Thrust coefficient. |
| [in] | a_rotor_RPM | Rotor RPM. |
| [in] | a_blade_pitch | Blade pitch. |
Reimplemented from NullWindFarm.
|
inlineprotected |
Create and set the specified windfarm model.
| void WindFarm::write_actuator_disks_vtk | ( | const amrex::Geometry & | geom, |
| const amrex::Real & | sampling_distance_by_D | ||
| ) |
Write actuator disks to a VTK file.
| [in] | geom | Geometry |
| [in] | sampling_distance_by_D | Sampling distance normalized by rotor diameter. |
Write the actuator disks and sampling disks to VTK files.
| [in] | geom | Geometry defining the domain. |
| [in] | sampling_distance_by_D | Normalized sampling distance. |
| void WindFarm::write_turbine_locations_vtk | ( | ) |
Write turbine locations to a VTK file.
Write the turbine hub locations to a VTK file.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
private |
windfarm model
Referenced by advance(), set_blade_airfoil_spec(), set_blade_spec(), set_turb_disk_angle(), set_turb_loc(), set_turb_spec(), set_turb_spec_extra(), SetModel(), and WindFarm().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |