ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
SimpleAD Class Reference

#include <ERF_SimpleAD.H>

Inheritance diagram for SimpleAD:
Collaboration diagram for SimpleAD:

Public Member Functions

 SimpleAD ()
 
virtual ~SimpleAD ()=default
 
void advance (const amrex::Geometry &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 amrex::MultiFab *z_phys_nd, const amrex::MultiFab *z_phys_cc, const double &time) override
 
void compute_freestream_velocity (const amrex::MultiFab &cons_in, const amrex::MultiFab &U_old, const amrex::MultiFab &V_old, const amrex::MultiFab &mf_SMark)
 
void source_terms_cellcentered (const amrex::Geometry &geom, const amrex::MultiFab &cons_in, const amrex::MultiFab &mf_Smark, amrex::MultiFab &mf_vars_simpleAD)
 
void update (const double &dt_advance, amrex::MultiFab &cons_in, amrex::MultiFab &U_old, amrex::MultiFab &V_old, const amrex::MultiFab &mf_vars)
 
void compute_power_output (const double &time)
 
- Public Member Functions inherited from NullWindFarm
 NullWindFarm ()
 
virtual ~NullWindFarm ()=default
 
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)
 
virtual void set_turb_loc (const amrex::Vector< amrex::Real > &xloc, const amrex::Vector< amrex::Real > &yloc)
 
virtual void set_turb_zloc (const amrex::Vector< amrex::Real > &zloc)
 Ground elevation under each turbine (the hub is hub_height above it) More...
 
virtual void set_turb_disk_angle (const amrex::Real &turb_disk_angle)
 
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)
 
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)
 
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)
 
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 Attributes

amrex::Vector< amrex::Real > xloc
 
amrex::Vector< amrex::Real > yloc
 
amrex::Real turb_disk_angle
 
amrex::Real hub_height
 
amrex::Real rotor_rad
 
amrex::Real thrust_coeff_standing
 
amrex::Real nominal_power
 
amrex::Vector< amrex::Real > wind_speed
 
amrex::Vector< amrex::Real > thrust_coeff
 
amrex::Vector< amrex::Real > power
 
amrex::Vector< amrex::Real > freestream_velocity
 
amrex::Vector< amrex::Real > freestream_phi
 
amrex::Vector< amrex::Real > disk_cell_count
 
- Protected Attributes inherited from NullWindFarm
amrex::Vector< amrex::Real > m_xloc
 
amrex::Vector< amrex::Real > m_yloc
 
amrex::Vector< amrex::Real > m_zloc
 
amrex::Real m_turb_disk_angle
 
amrex::Real m_hub_height
 
amrex::Real m_rotor_rad
 
amrex::Real m_thrust_coeff_standing
 
amrex::Real m_nominal_power
 
amrex::Vector< amrex::Real > m_wind_speed
 
amrex::Vector< amrex::Real > m_thrust_coeff
 
amrex::Vector< amrex::Real > m_power
 
amrex::Vector< amrex::Real > m_bld_rad_loc
 
amrex::Vector< amrex::Real > m_bld_twist
 
amrex::Vector< amrex::Real > m_bld_chord
 
amrex::Vector< amrex::Vector< amrex::Real > > m_bld_airfoil_aoa
 
amrex::Vector< amrex::Vector< amrex::Real > > m_bld_airfoil_Cl
 
amrex::Vector< amrex::Vector< amrex::Real > > m_bld_airfoil_Cd
 
amrex::Vector< amrex::Real > m_velocity
 
amrex::Vector< amrex::Real > m_C_P
 
amrex::Vector< amrex::Real > m_C_T
 
amrex::Vector< amrex::Real > m_rotor_RPM
 
amrex::Vector< amrex::Real > m_blade_pitch
 

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)
 

Constructor & Destructor Documentation

◆ SimpleAD()

SimpleAD::SimpleAD ( )
inline
12 {}

◆ ~SimpleAD()

virtual SimpleAD::~SimpleAD ( )
virtualdefault

Member Function Documentation

◆ advance()

void SimpleAD::advance ( const amrex::Geometry &  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 amrex::MultiFab *  z_phys_nd,
const amrex::MultiFab *  z_phys_cc,
const double &  time 
)
overridevirtual

Implements NullWindFarm.

21 {
22  AMREX_ALWAYS_ASSERT(W_old.nComp() > 0);
23  AMREX_ALWAYS_ASSERT(mf_Nturb.nComp() > 0);
24  // The simple actuator disk source does not depend on height
25  amrex::ignore_unused(z_phys_nd, z_phys_cc);
26  compute_freestream_velocity(cons_in, U_old, V_old, mf_SMark);
27  source_terms_cellcentered(geom, cons_in, mf_SMark, mf_vars_simpleAD);
28  update(dt_advance, cons_in, U_old, V_old, mf_vars_simpleAD);
30 }
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
void update(const double &dt_advance, amrex::MultiFab &cons_in, amrex::MultiFab &U_old, amrex::MultiFab &V_old, const amrex::MultiFab &mf_vars)
Definition: ERF_AdvanceSimpleAD.cpp:62
void compute_freestream_velocity(const amrex::MultiFab &cons_in, const amrex::MultiFab &U_old, const amrex::MultiFab &V_old, const amrex::MultiFab &mf_SMark)
Definition: ERF_AdvanceSimpleAD.cpp:89
void compute_power_output(const double &time)
Definition: ERF_AdvanceSimpleAD.cpp:33
void source_terms_cellcentered(const amrex::Geometry &geom, const amrex::MultiFab &cons_in, const amrex::MultiFab &mf_Smark, amrex::MultiFab &mf_vars_simpleAD)
Definition: ERF_AdvanceSimpleAD.cpp:170
Here is the call graph for this function:

◆ compute_freestream_velocity()

void SimpleAD::compute_freestream_velocity ( const amrex::MultiFab &  cons_in,
const amrex::MultiFab &  U_old,
const amrex::MultiFab &  V_old,
const amrex::MultiFab &  mf_SMark 
)
93 {
95  freestream_velocity.clear();
96  freestream_phi.clear();
97  disk_cell_count.clear();
98  freestream_velocity.resize(xloc.size(),zero);
99  freestream_phi.resize(xloc.size(),zero);
100  disk_cell_count.resize(xloc.size(),zero);
101 
102  Gpu::DeviceVector<Real> d_freestream_velocity(xloc.size());
103  Gpu::DeviceVector<Real> d_freestream_phi(yloc.size());
104  Gpu::DeviceVector<Real> d_disk_cell_count(yloc.size());
105  Gpu::copy(Gpu::hostToDevice, freestream_velocity.begin(), freestream_velocity.end(), d_freestream_velocity.begin());
106  Gpu::copy(Gpu::hostToDevice, freestream_phi.begin(), freestream_phi.end(), d_freestream_phi.begin());
107  Gpu::copy(Gpu::hostToDevice, disk_cell_count.begin(), disk_cell_count.end(), d_disk_cell_count.begin());
108 
109  Real* d_freestream_velocity_ptr = d_freestream_velocity.data();
110  Real* d_freestream_phi_ptr = d_freestream_phi.data();
111  Real* d_disk_cell_count_ptr = d_disk_cell_count.data();
112 
113 
114  for ( MFIter mfi(cons_in,TilingIfNotGPU()); mfi.isValid(); ++mfi) {
115 
116  auto SMark_array = mf_SMark.array(mfi);
117  auto u_vel = U_old.array(mfi);
118  auto v_vel = V_old.array(mfi);
119  // NOTE: this reduction is driven by the cell-centered SMark, so it must
120  // run over the cell-centered tilebox. Using nodaltilebox(0) here
121  // would include the plane at bigEnd(0)+1, which is a ghost cell of
122  // this box and a valid cell of its x-neighbor, and so would count
123  // that plane twice in the sums below.
124  Box tbx = mfi.tilebox();
125 
126  ParallelFor(tbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
127 
128  if(SMark_array(i,j,k,0) != -one) {
129  int turb_index = static_cast<int>(SMark_array(i,j,k,0));
130  Real phi = std::atan2(v_vel(i,j,k),u_vel(i,j,k)); // Wind direction w.r.t the x-direction
131  Gpu::Atomic::Add(&d_freestream_velocity_ptr[turb_index],std::pow(u_vel(i,j,k)*u_vel(i,j,k) + v_vel(i,j,k)*v_vel(i,j,k),myhalf));
132  Gpu::Atomic::Add(&d_disk_cell_count_ptr[turb_index],one);
133  Gpu::Atomic::Add(&d_freestream_phi_ptr[turb_index],phi);
134  }
135  });
136  }
137 
138  // Copy back to host
139  Gpu::copy(Gpu::deviceToHost, d_freestream_velocity.begin(), d_freestream_velocity.end(), freestream_velocity.begin());
140  Gpu::copy(Gpu::deviceToHost, d_freestream_phi.begin(), d_freestream_phi.end(), freestream_phi.begin());
141  Gpu::copy(Gpu::deviceToHost, d_disk_cell_count.begin(), d_disk_cell_count.end(), disk_cell_count.begin());
142 
143  // Reduce the data on every processor
144  amrex::ParallelAllReduce::Sum(freestream_velocity.data(),
145  static_cast<int>(freestream_velocity.size()),
146  amrex::ParallelContext::CommunicatorAll());
147 
148  amrex::ParallelAllReduce::Sum(freestream_phi.data(),
149  static_cast<int>(freestream_phi.size()),
150  amrex::ParallelContext::CommunicatorAll());
151 
152 
153  amrex::ParallelAllReduce::Sum(disk_cell_count.data(),
154  static_cast<int>(disk_cell_count.size()),
155  amrex::ParallelContext::CommunicatorAll());
156 
158  /*if (ParallelDescriptor::IOProcessor()){
159  for(int it=0; it<xloc.size(); it++){
160 
161  std::cout << "turbine index, freestream velocity is " << it << " " << freestream_velocity[it] << " " <<
162  disk_cell_count[it] << " " <<
163  freestream_velocity[it]/(disk_cell_count[it] + 1e-10) << " " <<
164  freestream_phi[it]/(disk_cell_count[it] + 1e-10) << "\n";
165  }
166  }*/
167 }
ParallelFor(fab_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) { qrcuten_arr(i, j, k)=Real(0);qscuten_arr(i, j, k)=Real(0);qicuten_arr(i, j, k)=Real(0);})
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:37
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
constexpr amrex::Real myhalf
Definition: ERF_NumericalConstants.H:41
void get_turb_loc(amrex::Vector< amrex::Real > &xloc, amrex::Vector< amrex::Real > &yloc)
Definition: ERF_NullWindFarm.H:123
amrex::Vector< amrex::Real > disk_cell_count
Definition: ERF_SimpleAD.H:52
amrex::Vector< amrex::Real > freestream_velocity
Definition: ERF_SimpleAD.H:52
amrex::Vector< amrex::Real > xloc
Definition: ERF_SimpleAD.H:48
amrex::Vector< amrex::Real > yloc
Definition: ERF_SimpleAD.H:48
amrex::Vector< amrex::Real > freestream_phi
Definition: ERF_SimpleAD.H:52
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real phi(amrex::Real d, amrex::Real z0, amrex::Real psi) noexcept
Definition: ERF_ImmersedWallCell.H:176
Here is the call graph for this function:

◆ compute_power_output()

void SimpleAD::compute_power_output ( const double &  time)
34 {
38 
39  const int n_spec_table = static_cast<int>(wind_speed.size());
40  // Compute power based on the look-up table
41 
42  if (ParallelDescriptor::IOProcessor()){
43  static std::ofstream file("power_output_SimpleAD.txt", std::ios::app);
44  // Check if the file opened successfully
45  if (!file.is_open()) {
46  std::cerr << "Error opening file!" << std::endl;
47  Abort("Could not open file to write power output in ERF_AdvanceSimpleAD.cpp");
48  }
49  Real total_power = zero;
50  for(int it=0; it<static_cast<int>(xloc.size()); it++){
51  Real avg_vel = freestream_velocity[it]/(disk_cell_count[it] + Real(1e-10));
52  Real turb_power = interpolate_1d(wind_speed.data(), power.data(), avg_vel, n_spec_table);
53  total_power = total_power + turb_power;
54  //printf("avg vel and power is %d %0.15g, %0.15g\n", it, avg_vel, turb_power);
55  }
56  file << time << " " << total_power << "\n";
57  file.flush();
58  }
59 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real interpolate_1d(const amrex::Real *alpha, const amrex::Real *beta, const amrex::Real alpha_interp, const int alpha_size)
Definition: ERF_Interpolation_1D.H:15
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:111
amrex::Real rotor_rad
Definition: ERF_SimpleAD.H:50
amrex::Vector< amrex::Real > thrust_coeff
Definition: ERF_SimpleAD.H:51
amrex::Real thrust_coeff_standing
Definition: ERF_SimpleAD.H:50
amrex::Vector< amrex::Real > wind_speed
Definition: ERF_SimpleAD.H:51
amrex::Vector< amrex::Real > power
Definition: ERF_SimpleAD.H:51
amrex::Real hub_height
Definition: ERF_SimpleAD.H:50
Here is the call graph for this function:

◆ source_terms_cellcentered()

void SimpleAD::source_terms_cellcentered ( const amrex::Geometry &  geom,
const amrex::MultiFab &  cons_in,
const amrex::MultiFab &  mf_Smark,
amrex::MultiFab &  mf_vars_simpleAD 
)
174 {
175 
179 
180  Gpu::DeviceVector<Real> d_xloc(xloc.size());
181  Gpu::DeviceVector<Real> d_yloc(yloc.size());
182  Gpu::copy(Gpu::hostToDevice, xloc.begin(), xloc.end(), d_xloc.begin());
183  Gpu::copy(Gpu::hostToDevice, yloc.begin(), yloc.end(), d_yloc.begin());
184 
185  // dx in place of a dy over one cell, and the reverse (only dz is used as a spacing)
186  auto dx = LengthScaleCellSize(geom);
187 
188  // Domain valid box
189  const amrex::Box& domain = geom.Domain();
190  int domlo_x = domain.smallEnd(0);
191  int domhi_x = domain.bigEnd(0) + 1;
192  int domlo_y = domain.smallEnd(1);
193  int domhi_y = domain.bigEnd(1) + 1;
194  int domlo_z = domain.smallEnd(2);
195  int domhi_z = domain.bigEnd(2) + 1;
196 
197  // The order of variables are - Vabs dVabsdt, dudt, dvdt, dTKEdt
198  mf_vars_simpleAD.setVal(0.0);
199 
200  long unsigned int nturbs = static_cast<long unsigned int>(xloc.size());
201 
202  Gpu::DeviceVector<Real> d_freestream_velocity(nturbs);
203  Gpu::DeviceVector<Real> d_freestream_phi(nturbs);
204  Gpu::DeviceVector<Real> d_disk_cell_count(nturbs);
205  Gpu::copy(Gpu::hostToDevice, freestream_velocity.begin(), freestream_velocity.end(), d_freestream_velocity.begin());
206  Gpu::copy(Gpu::hostToDevice, freestream_phi.begin(), freestream_phi.end(), d_freestream_phi.begin());
207  Gpu::copy(Gpu::hostToDevice, disk_cell_count.begin(), disk_cell_count.end(), d_disk_cell_count.begin());
208 
209  Real* d_freestream_velocity_ptr = d_freestream_velocity.data();
210  Real* d_freestream_phi_ptr = d_freestream_phi.data();
211  Real* d_disk_cell_count_ptr = d_disk_cell_count.data();
212 
214  Real nx = -std::cos(turb_disk_angle);
215  Real ny = -std::sin(turb_disk_angle);
216 
217  // How much rotor area to attribute to each cell that the disk passes through.
218  // WindFarm::fill_SMark_multifab marks the staircase of cells that the disk plane
219  // cuts -- one cell per crossing -- so the average area of disk inside a marked cell
220  // is dz times the mean chord of a line with normal (nx,ny) across a dx by dy cell,
221  //
222  // A_cell = dx*dy*dz / (|nx|*dx + |ny|*dy)
223  //
224  // This is dy*dz for a disk facing x and dx*dz for a disk facing y, and summing it
225  // over the marked cells recovers the rotor area at any angle in between. It replaces
226  // a signed dy*dz*cos(turb_disk_angle), which vanished for a disk facing y (i.e. for
227  // erf.turb_disk_angle_from_x of 0 or 180) and changed sign past 180 degrees, turning
228  // the momentum sink into a source (issue #3673)
229  Real area_over_vol = one/(std::abs(nx)*dx[0] + std::abs(ny)*dx[1]);
230 
231  Gpu::DeviceVector<Real> d_wind_speed(wind_speed.size());
232  Gpu::DeviceVector<Real> d_thrust_coeff(thrust_coeff.size());
233 
234  // Copy data from host vectors to device vectors
235  Gpu::copy(Gpu::hostToDevice, wind_speed.begin(), wind_speed.end(), d_wind_speed.begin());
236  Gpu::copy(Gpu::hostToDevice, thrust_coeff.begin(), thrust_coeff.end(), d_thrust_coeff.begin());
237 
238  const Real* wind_speed_d = d_wind_speed.dataPtr();
239  const Real* thrust_coeff_d = d_thrust_coeff.dataPtr();
240  const int n_spec_table = static_cast<int>(d_wind_speed.size());
241 
242  for ( MFIter mfi(cons_in,TilingIfNotGPU()); mfi.isValid(); ++mfi) {
243 
244  const Box& gbx = mfi.growntilebox(1);
245  auto SMark_array = mf_SMark.array(mfi);
246  auto simpleAD_array = mf_vars_simpleAD.array(mfi);
247 
248  ParallelFor(gbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
249  int ii = amrex::min(amrex::max(i, domlo_x), domhi_x);
250  int jj = amrex::min(amrex::max(j, domlo_y), domhi_y);
251  int kk = amrex::min(amrex::max(k, domlo_z), domhi_z);
252 
253 
254  Real source_x = zero;
255  Real source_y = zero;
256 
257  int it = static_cast<int>(SMark_array(ii,jj,kk,1));
258 
259  if(it != -1) {
260  Real avg_vel = d_freestream_velocity_ptr[it]/(d_disk_cell_count_ptr[it] + Real(1e-10));
261  Real phi = d_freestream_phi_ptr[it]/(d_disk_cell_count_ptr[it] + Real(1e-10));
262 
263  Real C_T = interpolate_1d(wind_speed_d, thrust_coeff_d, avg_vel, n_spec_table);
264  Real a;
265  if(C_T <= 1) {
266  a = myhalf - myhalf*std::pow(one-C_T,myhalf);
267  }
268  Real Uinfty_dot_nhat = avg_vel*(std::cos(phi)*nx + std::sin(phi)*ny);
269  if(C_T <= 1) {
270  source_x = -two*std::pow(Uinfty_dot_nhat, two)*a*(one-a)*area_over_vol*std::cos(phi);
271  source_y = -two*std::pow(Uinfty_dot_nhat, two)*a*(one-a)*area_over_vol*std::sin(phi);
272  }
273  else {
274  source_x = -myhalf*C_T*std::pow(Uinfty_dot_nhat, two)*area_over_vol*std::cos(phi);
275  source_y = -myhalf*C_T*std::pow(Uinfty_dot_nhat, two)*area_over_vol*std::sin(phi);
276  }
277  }
278 
279  simpleAD_array(i,j,k,0) = source_x;
280  simpleAD_array(i,j,k,1) = source_y;
281  });
282  }
283 }
GpuArray< Real, AMREX_SPACEDIM > dx
Definition: ERF_ActuatorSpreading.cpp:131
const int nx
Definition: ERF_InitCustomPertVels_CloudChamber.H:14
const int ny
Definition: ERF_InitCustomPertVels_CloudChamber.H:15
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > LengthScaleCellSize(const amrex::Geometry &geom)
Definition: ERF_LengthScaleCellSize.H:28
constexpr amrex::Real two
Definition: ERF_NumericalConstants.H:38
void get_turb_disk_angle(amrex::Real &turb_disk_angle)
Definition: ERF_NullWindFarm.H:130
amrex::Real turb_disk_angle
Definition: ERF_SimpleAD.H:49
Here is the call graph for this function:

◆ update()

void SimpleAD::update ( const double &  dt_advance,
amrex::MultiFab &  cons_in,
amrex::MultiFab &  U_old,
amrex::MultiFab &  V_old,
const amrex::MultiFab &  mf_vars 
)
66 {
67 
68  for ( MFIter mfi(cons_in,TilingIfNotGPU()); mfi.isValid(); ++mfi) {
69 
70  Box tbx = mfi.nodaltilebox(0);
71  Box tby = mfi.nodaltilebox(1);
72 
73  auto simpleAD_array = mf_vars_simpleAD.array(mfi);
74  auto u_vel = U_old.array(mfi);
75  auto v_vel = V_old.array(mfi);
76 
77  ParallelFor(tbx, tby,
78  [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
79  {
80  u_vel(i,j,k) = u_vel(i,j,k) + (simpleAD_array(i-1,j,k,0) + simpleAD_array(i,j,k,0))/two*dt_advance;
81  },
82  [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
83  {
84  v_vel(i,j,k) = v_vel(i,j,k) + (simpleAD_array(i,j-1,k,1) + simpleAD_array(i,j,k,1))/two*dt_advance;
85  });
86  }
87 }
Here is the call graph for this function:

Member Data Documentation

◆ disk_cell_count

amrex::Vector<amrex::Real> SimpleAD::disk_cell_count
protected

◆ freestream_phi

amrex::Vector<amrex::Real> SimpleAD::freestream_phi
protected

◆ freestream_velocity

amrex::Vector<amrex::Real> SimpleAD::freestream_velocity
protected

◆ hub_height

amrex::Real SimpleAD::hub_height
protected

◆ nominal_power

amrex::Real SimpleAD::nominal_power
protected

◆ power

amrex::Vector<amrex::Real> SimpleAD::power
protected

◆ rotor_rad

amrex::Real SimpleAD::rotor_rad
protected

◆ thrust_coeff

amrex::Vector<amrex::Real> SimpleAD::thrust_coeff
protected

◆ thrust_coeff_standing

amrex::Real SimpleAD::thrust_coeff_standing
protected

◆ turb_disk_angle

amrex::Real SimpleAD::turb_disk_angle
protected

◆ wind_speed

amrex::Vector<amrex::Real> SimpleAD::wind_speed
protected

◆ xloc

amrex::Vector<amrex::Real> SimpleAD::xloc
protected

◆ yloc

amrex::Vector<amrex::Real> SimpleAD::yloc
protected

The documentation for this class was generated from the following files: