5 #include <AMReX_Geometry.H>
6 #include <AMReX_MultiFab.H>
23 const WindFarmType& a_windfarm_type)
26 if (a_windfarm_type == WindFarmType::Fitch) {
28 amrex::Print() <<
"Fitch windfarm model!\n";
30 else if (a_windfarm_type == WindFarmType::EWP) {
32 amrex::Print() <<
"EWP windfarm model!\n";
34 else if (a_windfarm_type == WindFarmType::SimpleAD) {
36 amrex::Print() <<
"Simplified actuator disk windfarm model!\n";
38 else if (a_windfarm_type == WindFarmType::GeneralAD) {
39 SetModel<GeneralAD>();
40 amrex::Print() <<
"Generalized actuator disk windfarm model!\n";
43 amrex::Abort(
"WindFarm: Dont know this windfarm_type!") ;
48 std::string windfarm_spec_table,
49 bool x_y,
bool lat_lon,
50 const amrex::Real windfarm_x_shift = 0.0,
51 const amrex::Real windfarm_y_shift = 0.0);
54 const amrex::Real windfarm_x_shift,
55 const amrex::Real windfarm_y_shift);
60 bool x_y,
bool lat_lon,
61 const amrex::Real windfarm_x_shift = 0.0,
62 const amrex::Real windfarm_y_shift = 0.0);
69 const std::string windfarm_blade_table);
74 amrex::MultiFab& mf_Nturb);
77 amrex::MultiFab& mf_SMark,
78 const amrex::Real& sampling_distance_by_D,
79 const amrex::Real& turb_disk_angle);
85 void advance (
const amrex::Geometry& a_geom,
86 const amrex::Real& dt_advance,
87 amrex::MultiFab& cons_in,
88 amrex::MultiFab& mf_vars_windfarm,
89 amrex::MultiFab& U_old,
90 amrex::MultiFab& V_old,
91 amrex::MultiFab& W_old,
92 const amrex::MultiFab& mf_Nturb,
93 const amrex::MultiFab& mf_SMark,
94 const amrex::Real& time)
override
97 U_old, V_old, W_old, mf_Nturb, mf_SMark, time);
100 void set_turb_spec(
const amrex::Real& a_rotor_rad,
const amrex::Real& a_hub_height,
101 const amrex::Real& a_thrust_coeff_standing,
const amrex::Vector<amrex::Real>& a_wind_speed,
102 const amrex::Vector<amrex::Real>& a_thrust_coeff,
103 const amrex::Vector<amrex::Real>& a_power)
override
105 m_windfarm_model[0]->set_turb_spec(a_rotor_rad, a_hub_height, a_thrust_coeff_standing,
106 a_wind_speed, a_thrust_coeff, a_power);
110 const amrex::Vector<amrex::Real>& a_yloc)
override
121 const amrex::Vector<amrex::Real>& a_bld_twist,
122 const amrex::Vector<amrex::Real>& a_bld_chord)
override
124 m_windfarm_model[0]->set_blade_spec(a_bld_rad_loc, a_bld_twist, a_bld_chord);
128 const amrex::Vector<amrex::Vector<amrex::Real>>& a_bld_airfoil_Cl,
129 const amrex::Vector<amrex::Vector<amrex::Real>>& a_bld_airfoil_Cd)
override
131 m_windfarm_model[0]->set_blade_airfoil_spec(a_bld_airfoil_aoa, a_bld_airfoil_Cl, a_bld_airfoil_Cd);
135 const amrex::Vector<amrex::Real>& a_C_P,
136 const amrex::Vector<amrex::Real>& a_C_T,
137 const amrex::Vector<amrex::Real>& a_rotor_RPM,
138 const amrex::Vector<amrex::Real>& a_blade_pitch)
override
140 m_windfarm_model[0]->set_turb_spec_extra(a_velocity, a_C_P, a_C_T, a_rotor_RPM, a_blade_pitch);
155 template<
class NewWindFarmModel>
Definition: ERF_NullWindFarm.H:9
Definition: ERF_WindFarm.H:14
amrex::Real my_turb_disk_angle
Definition: ERF_WindFarm.H:146
amrex::Vector< amrex::Real > yloc
Definition: ERF_WindFarm.H:145
virtual ~WindFarm()=default
amrex::Vector< amrex::Vector< amrex::Real > > bld_airfoil_Cl
Definition: ERF_WindFarm.H:150
void advance(const amrex::Geometry &a_geom, const amrex::Real &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 amrex::Real &time) override
Definition: ERF_WindFarm.H:85
amrex::Vector< amrex::Real > blade_pitch
Definition: ERF_WindFarm.H:152
WindFarm()
Definition: ERF_WindFarm.H:18
void read_windfarm_locations_table(const std::string windfarm_loc_table, bool x_y, bool lat_lon, const amrex::Real windfarm_x_shift=0.0, const amrex::Real windfarm_y_shift=0.0)
Definition: ERF_InitWindFarm.cpp:34
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
Definition: ERF_WindFarm.H:134
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=0.0, const amrex::Real windfarm_y_shift=0.0)
Definition: ERF_InitWindFarm.cpp:18
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)
Definition: ERF_InitWindFarm.cpp:401
void read_windfarm_spec_table_extra(const std::string windfarm_spec_table_extra)
Definition: ERF_InitWindFarm.cpp:234
amrex::Vector< amrex::Vector< amrex::Real > > bld_airfoil_aoa
Definition: ERF_WindFarm.H:150
amrex::Vector< amrex::Real > velocity
Definition: ERF_WindFarm.H:152
void read_windfarm_blade_table(const std::string windfarm_blade_table)
Definition: ERF_InitWindFarm.cpp:201
amrex::Vector< amrex::Real > wind_speed
Definition: ERF_WindFarm.H:148
void set_turb_loc(const amrex::Vector< amrex::Real > &a_xloc, const amrex::Vector< amrex::Real > &a_yloc) override
Definition: ERF_WindFarm.H:109
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
Definition: ERF_WindFarm.H:120
void SetModel()
Create and set the specified windfarm model.
Definition: ERF_WindFarm.H:156
amrex::Vector< amrex::Real > C_P
Definition: ERF_WindFarm.H:152
amrex::Real hub_height
Definition: ERF_WindFarm.H:147
amrex::Vector< amrex::Real > bld_twist
Definition: ERF_WindFarm.H:149
amrex::Vector< amrex::Vector< amrex::Real > > bld_airfoil_Cd
Definition: ERF_WindFarm.H:150
amrex::Vector< amrex::Real > C_T
Definition: ERF_WindFarm.H:152
amrex::Vector< amrex::Real > thrust_coeff
Definition: ERF_WindFarm.H:148
void read_windfarm_spec_table(const std::string windfarm_spec_table)
Definition: ERF_InitWindFarm.cpp:153
int n_bld_sections
Definition: ERF_WindFarm.H:151
WindFarm(int nlev, const WindFarmType &a_windfarm_type)
Definition: ERF_WindFarm.H:22
amrex::Real nominal_power
Definition: ERF_WindFarm.H:147
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
Definition: ERF_WindFarm.H:127
void init_windfarm_x_y(const std::string windfarm_loc_table)
Definition: ERF_InitWindFarm.cpp:131
amrex::Vector< amrex::Real > bld_chord
Definition: ERF_WindFarm.H:149
void init_windfarm_lat_lon(const std::string windfarm_loc_table, const amrex::Real windfarm_x_shift, const amrex::Real windfarm_y_shift)
Definition: ERF_InitWindFarm.cpp:54
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
Definition: ERF_WindFarm.H:100
amrex::Real thrust_coeff_standing
Definition: ERF_WindFarm.H:147
amrex::Vector< amrex::Real > xloc
Definition: ERF_WindFarm.H:145
void read_windfarm_airfoil_tables(const std::string windfarm_airfoil_tables, const std::string windfarm_blade_table)
Definition: ERF_InitWindFarm.cpp:273
amrex::Real rotor_rad
Definition: ERF_WindFarm.H:147
void fill_Nturb_multifab(const amrex::Geometry &geom, amrex::MultiFab &mf_Nturb)
Definition: ERF_InitWindFarm.cpp:353
void write_turbine_locations_vtk()
Definition: ERF_InitWindFarm.cpp:485
amrex::Vector< amrex::Real > rotor_RPM
Definition: ERF_WindFarm.H:152
amrex::Vector< amrex::Real > power
Definition: ERF_WindFarm.H:148
void write_actuator_disks_vtk(const amrex::Geometry &geom)
Definition: ERF_InitWindFarm.cpp:504
amrex::Vector< amrex::Real > bld_rad_loc
Definition: ERF_WindFarm.H:149
void set_turb_disk_angle(const amrex::Real &a_turb_disk_angle) override
Definition: ERF_WindFarm.H:115
amrex::Vector< std::unique_ptr< NullWindFarm > > m_windfarm_model
Definition: ERF_WindFarm.H:164