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,
75 std::unique_ptr<amrex::MultiFab>& z_phys_nd);
78 amrex::MultiFab& mf_SMark,
79 const amrex::Real& sampling_distance_by_D,
80 const amrex::Real& turb_disk_angle,
81 std::unique_ptr<amrex::MultiFab>& z_phys_cc);
84 amrex::MultiFab& mf_SMark,
85 const amrex::MultiFab& mf_Nturb,
86 std::unique_ptr<amrex::MultiFab>& z_phys_cc);
91 const amrex::Real& sampling_distance_by_D);
93 void advance (
const amrex::Geometry& a_geom,
94 const amrex::Real& dt_advance,
95 amrex::MultiFab& cons_in,
96 amrex::MultiFab& mf_vars_windfarm,
97 amrex::MultiFab& U_old,
98 amrex::MultiFab& V_old,
99 amrex::MultiFab& W_old,
100 const amrex::MultiFab& mf_Nturb,
101 const amrex::MultiFab& mf_SMark,
102 const amrex::Real& time)
override
105 U_old, V_old, W_old, mf_Nturb, mf_SMark, time);
108 void set_turb_spec (
const amrex::Real& a_rotor_rad,
const amrex::Real& a_hub_height,
109 const amrex::Real& a_thrust_coeff_standing,
const amrex::Vector<amrex::Real>& a_wind_speed,
110 const amrex::Vector<amrex::Real>& a_thrust_coeff,
111 const amrex::Vector<amrex::Real>& a_power)
override
113 m_windfarm_model[0]->set_turb_spec(a_rotor_rad, a_hub_height, a_thrust_coeff_standing,
114 a_wind_speed, a_thrust_coeff, a_power);
118 const amrex::Vector<amrex::Real>& a_yloc)
override
129 const amrex::Vector<amrex::Real>& a_bld_twist,
130 const amrex::Vector<amrex::Real>& a_bld_chord)
override
132 m_windfarm_model[0]->set_blade_spec(a_bld_rad_loc, a_bld_twist, a_bld_chord);
136 const amrex::Vector<amrex::Vector<amrex::Real>>& a_bld_airfoil_Cl,
137 const amrex::Vector<amrex::Vector<amrex::Real>>& a_bld_airfoil_Cd)
override
139 m_windfarm_model[0]->set_blade_airfoil_spec(a_bld_airfoil_aoa, a_bld_airfoil_Cl, a_bld_airfoil_Cd);
143 const amrex::Vector<amrex::Real>& a_C_P,
144 const amrex::Vector<amrex::Real>& a_C_T,
145 const amrex::Vector<amrex::Real>& a_rotor_RPM,
146 const amrex::Vector<amrex::Real>& a_blade_pitch)
override
148 m_windfarm_model[0]->set_turb_spec_extra(a_velocity, a_C_P, a_C_T, a_rotor_RPM, a_blade_pitch);
163 template<
class NewWindFarmModel>
Definition: ERF_NullWindFarm.H:9
Definition: ERF_WindFarm.H:14
amrex::Real my_turb_disk_angle
Definition: ERF_WindFarm.H:154
amrex::Vector< amrex::Real > yloc
Definition: ERF_WindFarm.H:153
virtual ~WindFarm()=default
amrex::Vector< amrex::Vector< amrex::Real > > bld_airfoil_Cl
Definition: ERF_WindFarm.H:158
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:93
amrex::Vector< amrex::Real > blade_pitch
Definition: ERF_WindFarm.H:160
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_WindFarm.cpp:35
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:142
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_WindFarm.cpp:19
void read_windfarm_spec_table_extra(const std::string windfarm_spec_table_extra)
Definition: ERF_WindFarm.cpp:257
amrex::Vector< amrex::Vector< amrex::Real > > bld_airfoil_aoa
Definition: ERF_WindFarm.H:158
amrex::Vector< amrex::Real > velocity
Definition: ERF_WindFarm.H:160
void read_windfarm_blade_table(const std::string windfarm_blade_table)
Definition: ERF_WindFarm.cpp:224
amrex::Vector< amrex::Real > wind_speed
Definition: ERF_WindFarm.H:156
void set_turb_loc(const amrex::Vector< amrex::Real > &a_xloc, const amrex::Vector< amrex::Real > &a_yloc) override
Definition: ERF_WindFarm.H:117
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:128
void SetModel()
Create and set the specified windfarm model.
Definition: ERF_WindFarm.H:164
amrex::Vector< amrex::Real > C_P
Definition: ERF_WindFarm.H:160
amrex::Real hub_height
Definition: ERF_WindFarm.H:155
amrex::Vector< amrex::Real > zloc
Definition: ERF_WindFarm.H:153
amrex::Vector< amrex::Real > bld_twist
Definition: ERF_WindFarm.H:157
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)
Definition: ERF_WindFarm.cpp:481
void write_actuator_disks_vtk(const amrex::Geometry &geom, const amrex::Real &sampling_distance_by_D)
Definition: ERF_WindFarm.cpp:656
amrex::Vector< amrex::Vector< amrex::Real > > bld_airfoil_Cd
Definition: ERF_WindFarm.H:158
amrex::Vector< amrex::Real > C_T
Definition: ERF_WindFarm.H:160
amrex::Vector< amrex::Real > thrust_coeff
Definition: ERF_WindFarm.H:156
void read_windfarm_spec_table(const std::string windfarm_spec_table)
Definition: ERF_WindFarm.cpp:176
int n_bld_sections
Definition: ERF_WindFarm.H:159
WindFarm(int nlev, const WindFarmType &a_windfarm_type)
Definition: ERF_WindFarm.H:22
amrex::Real nominal_power
Definition: ERF_WindFarm.H:155
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:135
void init_windfarm_x_y(const std::string windfarm_loc_table)
Definition: ERF_WindFarm.cpp:154
amrex::Vector< amrex::Real > bld_chord
Definition: ERF_WindFarm.H:157
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_WindFarm.cpp:55
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:108
amrex::Real thrust_coeff_standing
Definition: ERF_WindFarm.H:155
amrex::Vector< amrex::Real > xloc
Definition: ERF_WindFarm.H:153
void fill_Nturb_multifab(const amrex::Geometry &geom, amrex::MultiFab &mf_Nturb, std::unique_ptr< amrex::MultiFab > &z_phys_nd)
Definition: ERF_WindFarm.cpp:376
void read_windfarm_airfoil_tables(const std::string windfarm_airfoil_tables, const std::string windfarm_blade_table)
Definition: ERF_WindFarm.cpp:296
amrex::Real rotor_rad
Definition: ERF_WindFarm.H:155
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)
Definition: ERF_WindFarm.cpp:537
void write_turbine_locations_vtk()
Definition: ERF_WindFarm.cpp:637
amrex::Vector< amrex::Real > rotor_RPM
Definition: ERF_WindFarm.H:160
amrex::Vector< amrex::Real > power
Definition: ERF_WindFarm.H:156
amrex::Vector< amrex::Real > bld_rad_loc
Definition: ERF_WindFarm.H:157
void set_turb_disk_angle(const amrex::Real &a_turb_disk_angle) override
Definition: ERF_WindFarm.H:123
amrex::Vector< std::unique_ptr< NullWindFarm > > m_windfarm_model
Definition: ERF_WindFarm.H:172