1 #ifndef ERF_NULLWINDFARM_H
2 #define ERF_NULLWINDFARM_H
5 #include <AMReX_Geometry.H>
6 #include <AMReX_MultiFab.H>
17 virtual void advance (
const amrex::Geometry& a_geom,
18 const amrex::Real& dt_advance,
19 amrex::MultiFab& cons_in,
20 amrex::MultiFab& mf_vars_windfarm,
21 amrex::MultiFab& U_old,
22 amrex::MultiFab& V_old,
23 amrex::MultiFab& W_old,
24 const amrex::MultiFab& mf_Nturb,
25 const amrex::MultiFab& mf_SMark,
26 const amrex::Real& time) = 0;
28 virtual void set_turb_spec(
const amrex::Real& rotor_rad,
const amrex::Real& hub_height,
29 const amrex::Real& thrust_coeff_standing,
const amrex::Vector<amrex::Real>& wind_speed,
30 const amrex::Vector<amrex::Real>& thrust_coeff,
31 const amrex::Vector<amrex::Real>& power)
42 const amrex::Vector<amrex::Real>& yloc)
54 const amrex::Vector<amrex::Real>& bld_twist,
55 const amrex::Vector<amrex::Real>& bld_chord)
63 const amrex::Vector<amrex::Vector<amrex::Real>>& bld_airfoil_Cl,
64 const amrex::Vector<amrex::Vector<amrex::Real>>& bld_airfoil_Cd)
72 const amrex::Vector<amrex::Real>& C_P,
73 const amrex::Vector<amrex::Real>& C_T,
74 const amrex::Vector<amrex::Real>& rotor_RPM,
75 const amrex::Vector<amrex::Real>& blade_pitch)
85 amrex::Real& thrust_coeff_standing, amrex::Vector<amrex::Real>& wind_speed,
86 amrex::Vector<amrex::Real>& thrust_coeff, amrex::Vector<amrex::Real>& power)
97 amrex::Vector<amrex::Real>& yloc)
109 amrex::Vector<amrex::Real>& bld_twist,
110 amrex::Vector<amrex::Real>& bld_chord)
118 amrex::Vector<amrex::Vector<amrex::Real>>& bld_airfoil_Cl,
119 amrex::Vector<amrex::Vector<amrex::Real>>& bld_airfoil_Cd)
127 amrex::Vector<amrex::Real>& C_P,
128 amrex::Vector<amrex::Real>& C_T,
129 amrex::Vector<amrex::Real>& rotor_RPM,
130 amrex::Vector<amrex::Real>& blade_pitch)
139 static AMREX_GPU_DEVICE
140 bool find_if_marked(amrex::Real x1, amrex::Real x2, amrex::Real y1, amrex::Real y2,
141 amrex::Real x0, amrex::Real y0, amrex::Real nx, amrex::Real ny,
142 amrex::Real d_hub_height, amrex::Real d_rotor_rad,
150 amrex::Real xval1 = x0 - (y1-y0)*ny/(nx+1e-10);
151 amrex::Real xval2 = x0 - (y2-y0)*ny/(nx+1e-10);
153 amrex::Real yval1 = y0 - (x1-x0)*nx/(ny+1e-10);
154 amrex::Real yval2 = y0 - (x2-x0)*nx/(ny+1e-10);
156 if( xval1 >=x1 and xval1 <=x2 ) {
157 if(std::pow((xval1-x0)*(xval1-x0) + (y1-y0)*(y1-y0) + (
z-d_hub_height)*(
z-d_hub_height),0.5) < d_rotor_rad ) {
161 if( xval2 >=x1 and xval2 <=x2 ) {
162 if(std::pow((xval2-x0)*(xval2-x0) + (y2-y0)*(y2-y0) + (
z-d_hub_height)*(
z-d_hub_height),0.5) < d_rotor_rad ) {
166 if (yval1 >=y1 and yval1 <=y2) {
167 if(std::pow((x1-x0)*(x1-x0) + (yval1-y0)*(yval1-y0) + (
z-d_hub_height)*(
z-d_hub_height),0.5) < d_rotor_rad ) {
171 if (yval2 >=y1 and yval2 <=y2) {
172 if(std::pow((x2-x0)*(x2-x0) + (yval2-y0)*(yval2-y0) + (
z-d_hub_height)*(
z-d_hub_height),0.5) < d_rotor_rad ) {
Definition: ERF_NullWindFarm.H:9
amrex::Real m_rotor_rad
Definition: ERF_NullWindFarm.H:184
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)
Definition: ERF_NullWindFarm.H:84
amrex::Vector< amrex::Real > m_bld_rad_loc
Definition: ERF_NullWindFarm.H:186
amrex::Vector< amrex::Real > m_C_P
Definition: ERF_NullWindFarm.H:188
amrex::Real m_turb_disk_angle
Definition: ERF_NullWindFarm.H:183
amrex::Vector< amrex::Real > m_bld_twist
Definition: ERF_NullWindFarm.H:186
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)
Definition: ERF_NullWindFarm.H:140
amrex::Real m_thrust_coeff_standing
Definition: ERF_NullWindFarm.H:184
amrex::Vector< amrex::Real > m_C_T
Definition: ERF_NullWindFarm.H:188
amrex::Vector< amrex::Real > m_power
Definition: ERF_NullWindFarm.H:185
virtual 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)=0
amrex::Vector< amrex::Vector< amrex::Real > > m_bld_airfoil_aoa
Definition: ERF_NullWindFarm.H:187
virtual void set_turb_spec(const amrex::Real &rotor_rad, const amrex::Real &hub_height, const amrex::Real &thrust_coeff_standing, const amrex::Vector< amrex::Real > &wind_speed, const amrex::Vector< amrex::Real > &thrust_coeff, const amrex::Vector< amrex::Real > &power)
Definition: ERF_NullWindFarm.H:28
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)
Definition: ERF_NullWindFarm.H:126
amrex::Vector< amrex::Real > m_thrust_coeff
Definition: ERF_NullWindFarm.H:185
amrex::Vector< amrex::Vector< amrex::Real > > m_bld_airfoil_Cd
Definition: ERF_NullWindFarm.H:187
void get_turb_loc(amrex::Vector< amrex::Real > &xloc, amrex::Vector< amrex::Real > &yloc)
Definition: ERF_NullWindFarm.H:96
amrex::Vector< amrex::Real > m_yloc
Definition: ERF_NullWindFarm.H:182
amrex::Vector< amrex::Real > m_wind_speed
Definition: ERF_NullWindFarm.H:185
amrex::Vector< amrex::Real > m_blade_pitch
Definition: ERF_NullWindFarm.H:188
amrex::Real m_nominal_power
Definition: ERF_NullWindFarm.H:184
virtual void set_turb_loc(const amrex::Vector< amrex::Real > &xloc, const amrex::Vector< amrex::Real > &yloc)
Definition: ERF_NullWindFarm.H:41
virtual void set_blade_spec(const amrex::Vector< amrex::Real > &bld_rad_loc, const amrex::Vector< amrex::Real > &bld_twist, const amrex::Vector< amrex::Real > &bld_chord)
Definition: ERF_NullWindFarm.H:53
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)
Definition: ERF_NullWindFarm.H:117
void get_turb_disk_angle(amrex::Real &turb_disk_angle)
Definition: ERF_NullWindFarm.H:103
void get_blade_spec(amrex::Vector< amrex::Real > &bld_rad_loc, amrex::Vector< amrex::Real > &bld_twist, amrex::Vector< amrex::Real > &bld_chord)
Definition: ERF_NullWindFarm.H:108
amrex::Vector< amrex::Real > m_xloc
Definition: ERF_NullWindFarm.H:182
amrex::Vector< amrex::Real > m_bld_chord
Definition: ERF_NullWindFarm.H:186
amrex::Vector< amrex::Real > m_rotor_RPM
Definition: ERF_NullWindFarm.H:188
amrex::Vector< amrex::Vector< amrex::Real > > m_bld_airfoil_Cl
Definition: ERF_NullWindFarm.H:187
virtual void set_turb_disk_angle(const amrex::Real &turb_disk_angle)
Definition: ERF_NullWindFarm.H:48
amrex::Real m_hub_height
Definition: ERF_NullWindFarm.H:184
virtual void set_turb_spec_extra(const amrex::Vector< amrex::Real > &velocity, const amrex::Vector< amrex::Real > &C_P, const amrex::Vector< amrex::Real > &C_T, const amrex::Vector< amrex::Real > &rotor_RPM, const amrex::Vector< amrex::Real > &blade_pitch)
Definition: ERF_NullWindFarm.H:71
NullWindFarm()
Definition: ERF_NullWindFarm.H:13
virtual void set_blade_airfoil_spec(const amrex::Vector< amrex::Vector< amrex::Real >> &bld_airfoil_aoa, const amrex::Vector< amrex::Vector< amrex::Real >> &bld_airfoil_Cl, const amrex::Vector< amrex::Vector< amrex::Real >> &bld_airfoil_Cd)
Definition: ERF_NullWindFarm.H:62
amrex::Vector< amrex::Real > m_velocity
Definition: ERF_NullWindFarm.H:188