Function for computing the slow RHS for the evolution equations for the density, potential temperature and momentum.
70 BL_PROFILE_REGION(
"erf_make_mom_sources()");
72 Box domain(geom.Domain());
73 const GpuArray<Real, AMREX_SPACEDIM>
dxInv = geom.InvCellSizeArray();
107 if (solverChoice.
terrain_type == TerrainType::ImmersedForcing) {
109 amrex::Error(
" Currently forest canopy cannot be used with immersed forcing");
119 auto cosphi = solverChoice.
cosphi;
120 auto sinphi = solverChoice.
sinphi;
151 Real rhoUA_target{0};
152 Real rhoVA_target{0};
159 Table1D<Real> dptr_r_plane, dptr_u_plane, dptr_v_plane;
160 TableData<Real, 1> r_plane_tab, u_plane_tab, v_plane_tab;
163 enforce_massflux_x || enforce_massflux_y))
166 const int u_offset = 1;
167 const int v_offset = 1;
176 r_ave.compute_averages(
ZDir(), r_ave.field());
178 int ncell = r_ave.ncell_line();
179 Gpu::HostVector< Real> r_plane_h(ncell);
180 Gpu::DeviceVector< Real> r_plane_d(ncell);
182 r_ave.line_average(
Rho_comp, r_plane_h);
184 Gpu::copyAsync(Gpu::hostToDevice, r_plane_h.begin(), r_plane_h.end(), r_plane_d.begin());
186 Real* dptr_r = r_plane_d.data();
188 Box tdomain = domain; tdomain.grow(2,ng_c[2]);
189 r_plane_tab.resize({tdomain.smallEnd(2)}, {tdomain.bigEnd(2)});
191 dptr_r_plane = r_plane_tab.table();
192 ParallelFor(ncell, [=] AMREX_GPU_DEVICE (
int k) noexcept
194 dptr_r_plane(k-
offset) = dptr_r[k];
198 IntVect ng_u = S_data[
IntVars::xmom].nGrowVect(); ng_u[2] = u_offset;
201 IntVect ng_v = S_data[
IntVars::ymom].nGrowVect(); ng_v[2] = v_offset;
204 u_ave.compute_averages(
ZDir(), u_ave.field());
205 v_ave.compute_averages(
ZDir(), v_ave.field());
207 int u_ncell = u_ave.ncell_line();
208 int v_ncell = v_ave.ncell_line();
209 Gpu::HostVector< Real> u_plane_h(u_ncell), v_plane_h(v_ncell);
210 Gpu::DeviceVector< Real> u_plane_d(u_ncell), v_plane_d(v_ncell);
212 u_ave.line_average(0, u_plane_h);
213 v_ave.line_average(0, v_plane_h);
215 Gpu::copyAsync(Gpu::hostToDevice, u_plane_h.begin(), u_plane_h.end(), u_plane_d.begin());
216 Gpu::copyAsync(Gpu::hostToDevice, v_plane_h.begin(), v_plane_h.end(), v_plane_d.begin());
218 Real* dptr_u = u_plane_d.data();
219 Real* dptr_v = v_plane_d.data();
221 Box udomain = domain; udomain.grow(2,ng_u[2]);
222 Box vdomain = domain; vdomain.grow(2,ng_v[2]);
223 u_plane_tab.resize({udomain.smallEnd(2)}, {udomain.bigEnd(2)});
224 v_plane_tab.resize({vdomain.smallEnd(2)}, {vdomain.bigEnd(2)});
226 dptr_u_plane = u_plane_tab.table();
227 ParallelFor(u_ncell, [=] AMREX_GPU_DEVICE (
int k) noexcept
229 dptr_u_plane(k-u_offset) = dptr_u[k];
232 dptr_v_plane = v_plane_tab.table();
233 ParallelFor(v_ncell, [=] AMREX_GPU_DEVICE (
int k) noexcept
235 dptr_v_plane(k-v_offset) = dptr_v[k];
239 if (enforce_massflux_x || enforce_massflux_y) {
240 Real Lx = geom.ProbHi(0) - geom.ProbLo(0);
241 Real Ly = geom.ProbHi(1) - geom.ProbLo(1);
243 if (solverChoice.
mesh_type == MeshType::ConstantDz) {
245 rhoUA = std::accumulate(u_plane_h.begin() + u_offset + massflux_klo,
246 u_plane_h.begin() + u_offset + massflux_khi+1,
zero);
247 rhoVA = std::accumulate(v_plane_h.begin() + v_offset + massflux_klo,
248 v_plane_h.begin() + v_offset + massflux_khi+1,
zero);
249 rhoUA_target = std::accumulate(r_plane_h.begin() +
offset + massflux_klo,
250 r_plane_h.begin() +
offset + massflux_khi+1,
zero);
251 rhoVA_target = rhoUA_target;
253 rhoUA *= geom.CellSize(2) * Ly;
254 rhoVA *= geom.CellSize(2) * Lx;
255 rhoUA_target *= geom.CellSize(2) * Ly;
256 rhoVA_target *= geom.CellSize(2) * Lx;
258 }
else if (solverChoice.
mesh_type == MeshType::StretchedDz) {
260 for (
int k=massflux_klo; k < massflux_khi; ++k) {
261 rhoUA += u_plane_h[k + u_offset] * stretched_dz_h[k];
262 rhoVA += v_plane_h[k + v_offset] * stretched_dz_h[k];
263 rhoUA_target += r_plane_h[k +
offset] * stretched_dz_h[k];
265 rhoVA_target = rhoUA_target;
274 rhoUA_target *= U_target;
275 rhoVA_target *= V_target;
277 Print() <<
"Integrated mass flux : " << rhoUA <<
" " << rhoVA
278 <<
" (target: " << rhoUA_target <<
" " << rhoVA_target <<
")"
286 for ( MFIter mfi(S_data[
IntVars::cons]); mfi.isValid(); ++mfi)
288 Box tbx = mfi.nodaltilebox(0);
289 Box tby = mfi.nodaltilebox(1);
290 Box tbz = mfi.nodaltilebox(2);
291 if (tbz.bigEnd(2) == domain.bigEnd(2)+1) tbz.growHi(2,-1);
293 const Array4<const Real>& cell_data = S_data[
IntVars::cons].array(mfi);
294 const Array4<const Real>& rho_u = S_data[
IntVars::xmom].array(mfi);
295 const Array4<const Real>& rho_v = S_data[
IntVars::ymom].array(mfi);
296 const Array4<const Real>& rho_w = S_data[
IntVars::zmom].array(mfi);
298 const Array4<const Real>& u =
xvel.array(mfi);
299 const Array4<const Real>& v =
yvel.array(mfi);
300 const Array4<const Real>& w = wvel.array(mfi);
302 const Array4< Real>& xmom_src_arr = xmom_src.array(mfi);
303 const Array4< Real>& ymom_src_arr = ymom_src.array(mfi);
304 const Array4< Real>& zmom_src_arr = zmom_src.array(mfi);
306 const Array4<const Real>&
r0 = r_hse.const_array(mfi);
308 const Array4<const Real>& f_drag_arr = (forest_drag) ? forest_drag->const_array(mfi) :
309 Array4<const Real>{};
310 const Array4<const Real>& t_blank_arr = (terrain_blank) ? terrain_blank->const_array(mfi) :
311 Array4<const Real>{};
313 const Array4<const Real>& cphi_arr = (cosPhi_mf) ? cosPhi_mf->const_array(mfi) :
314 Array4<const Real>{};
315 const Array4<const Real>& sphi_arr = (sinPhi_mf) ? sinPhi_mf->const_array(mfi) :
316 Array4<const Real>{};
318 const Array4<const Real>& z_nd_arr = z_phys_nd->const_array(mfi);
319 const Array4<const Real>& z_cc_arr = z_phys_cc->const_array(mfi);
325 if (use_coriolis && is_slow_step) {
326 if(solverChoice.
init_type == InitType::HindCast) {
327 const Array4<const Real>& latlon_arr = (*forecast_state_at_lev)[4].array(mfi);
329 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
331 Real rho_v_loc =
fourth * (rho_v(i,j+1,k) + rho_v(i,j,k) + rho_v(i-1,j+1,k) + rho_v(i-1,j,k));
332 Real rho_w_loc =
fourth * (rho_w(i,j,k+1) + rho_w(i,j,k) + rho_w(i,j-1,k+1) + rho_w(i,j-1,k));
333 Real latitude = latlon_arr(i,j,k,0);
334 Real sphi_loc = std::sin(latitude*
PI/
Real(180.0));
335 Real cphi_loc = std::cos(latitude*
PI/
Real(180.0));
336 xmom_src_arr(i, j, k) += coriolis_factor * (rho_v_loc * sphi_loc - rho_w_loc * cphi_loc);
338 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) {
339 Real rho_u_loc =
fourth * (rho_u(i+1,j,k) + rho_u(i,j,k) + rho_u(i+1,j-1,k) + rho_u(i,j-1,k));
340 Real latitude = latlon_arr(i,j,k,0);
341 Real sphi_loc = std::sin(latitude*
PI/
Real(180.0));
342 ymom_src_arr(i, j, k) += -coriolis_factor * rho_u_loc * sphi_loc;
344 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) {
345 Real rho_u_loc =
fourth * (rho_u(i+1,j,k) + rho_u(i,j,k) + rho_u(i+1,j,k-1) + rho_u(i,j,k-1));
346 Real latitude = latlon_arr(i,j,k,0);
347 Real cphi_loc = std::cos(latitude*
PI/
Real(180.0));
348 zmom_src_arr(i, j, k) += coriolis_factor * rho_u_loc * cphi_loc;
351 else if (var_coriolis && (sinPhi_mf) && (cosPhi_mf)) {
353 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
355 Real rho_v_loc =
fourth * (rho_v(i,j+1,k) + rho_v(i,j,k) + rho_v(i-1,j+1,k) + rho_v(i-1,j,k));
356 Real rho_w_loc =
fourth * (rho_w(i,j,k+1) + rho_w(i,j,k) + rho_w(i-1,j,k+1) + rho_w(i-1,j,k));
357 Real sphi_loc =
myhalf * (sphi_arr(i,j,0) + sphi_arr(i-1,j,0));
358 Real cphi_loc =
myhalf * (cphi_arr(i,j,0) + cphi_arr(i-1,j,0));
359 xmom_src_arr(i, j, k) += coriolis_factor * (rho_v_loc * sphi_loc - rho_w_loc * cphi_loc);
361 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) {
362 Real rho_u_loc =
fourth * (rho_u(i+1,j,k) + rho_u(i,j,k) + rho_u(i+1,j-1,k) + rho_u(i,j-1,k));
363 Real sphi_loc =
myhalf * (sphi_arr(i,j,0) + sphi_arr(i,j-1,0));
364 ymom_src_arr(i, j, k) += -coriolis_factor * rho_u_loc * sphi_loc;
366 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) {
367 Real rho_u_loc =
fourth * (rho_u(i+1,j,k) + rho_u(i,j,k) + rho_u(i+1,j,k-1) + rho_u(i,j,k-1));
368 zmom_src_arr(i, j, k) += coriolis_factor * rho_u_loc * cphi_arr(i,j,0);
372 Array4<const Real> u_volfrac = (ebfact.
get_u_const_factory())->getVolFrac().const_array(mfi);
373 Array4<const Real> v_volfrac = (ebfact.
get_v_const_factory())->getVolFrac().const_array(mfi);
374 Array4<const Real> w_volfrac = (ebfact.
get_w_const_factory())->getVolFrac().const_array(mfi);
375 ParallelFor(tbx, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) {
376 Real rho_v_loc = 0.0;
377 Real rho_w_loc = 0.0;
378 Real v_vol = v_volfrac(i,j+1,k) + v_volfrac(i,j,k) + v_volfrac(i-1,j+1,k) + v_volfrac(i-1,j,k);
379 Real w_vol = w_volfrac(i,j,k+1) + w_volfrac(i,j,k) + w_volfrac(i-1,j,k+1) + w_volfrac(i-1,j,k);
381 rho_v_loc = ( v_volfrac(i,j+1,k) * rho_v(i,j+1,k) + v_volfrac(i,j,k) * rho_v(i,j,k)
382 + v_volfrac(i-1,j+1,k) * rho_v(i-1,j+1,k) + v_volfrac(i-1,j,k) * rho_v(i-1,j,k)) / v_vol;
385 rho_w_loc = ( w_volfrac(i,j,k+1) * rho_w(i,j,k+1) + w_volfrac(i,j,k) * rho_w(i,j,k)
386 + w_volfrac(i-1,j,k+1) * rho_w(i-1,j,k+1) + w_volfrac(i-1,j,k) * rho_w(i-1,j,k)) / w_vol;
388 xmom_src_arr(i, j, k) += coriolis_factor * (rho_v_loc * sinphi - rho_w_loc * cosphi);
390 ParallelFor(tby, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) {
391 Real rho_u_loc = 0.0;
392 Real u_vol = u_volfrac(i+1,j,k) + u_volfrac(i,j,k) + u_volfrac(i+1,j-1,k) + u_volfrac(i,j-1,k);
394 rho_u_loc = ( u_volfrac(i+1,j,k) * rho_u(i+1,j,k) + u_volfrac(i,j,k) * rho_u(i,j,k)
395 + u_volfrac(i+1,j-1,k) * rho_u(i+1,j-1,k) + u_volfrac(i,j-1,k) * rho_u(i,j-1,k)) / u_vol;
397 ymom_src_arr(i, j, k) += -coriolis_factor * rho_u_loc * sinphi;
399 ParallelFor(tbz, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) {
400 Real rho_u_loc = 0.0;
401 Real u_vol = u_volfrac(i+1,j,k) + u_volfrac(i,j,k) + u_volfrac(i+1,j,k-1) + u_volfrac(i,j,k-1);
403 rho_u_loc = ( u_volfrac(i+1,j,k) * rho_u(i+1,j,k) + u_volfrac(i,j,k) * rho_u(i,j,k)
404 + u_volfrac(i+1,j,k-1) * rho_u(i+1,j,k-1) + u_volfrac(i,j,k-1) * rho_u(i,j,k-1)) / u_vol;
406 zmom_src_arr(i, j, k) += coriolis_factor * rho_u_loc * cosphi;
410 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
412 Real rho_v_loc = 0.25 * (rho_v(i,j+1,k) + rho_v(i,j,k) + rho_v(i-1,j+1,k) + rho_v(i-1,j,k));
413 Real rho_w_loc = 0.25 * (rho_w(i,j,k+1) + rho_w(i,j,k) + rho_w(i-1,j,k+1) + rho_w(i-1,j,k));
414 xmom_src_arr(i, j, k) += coriolis_factor * (rho_v_loc * sinphi - rho_w_loc * cosphi);
416 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) {
417 Real rho_u_loc = 0.25 * (rho_u(i+1,j,k) + rho_u(i,j,k) + rho_u(i+1,j-1,k) + rho_u(i,j-1,k));
418 ymom_src_arr(i, j, k) += -coriolis_factor * rho_u_loc * sinphi;
420 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) {
421 Real rho_u_loc = 0.25 * (rho_u(i+1,j,k) + rho_u(i,j,k) + rho_u(i+1,j,k-1) + rho_u(i,j,k-1));
422 zmom_src_arr(i, j, k) += coriolis_factor * rho_u_loc * cosphi;
433 if ( (is_slow_step && !use_Rayleigh_fast_uv) || (!is_slow_step && use_Rayleigh_fast_uv)) {
434 if (rayleigh_damp_U) {
435 ParallelFor(tbx, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
438 Real uu = rho_u(i,j,k) / rho_on_u_face;
439 Real sinesq = d_sinesq_at_lev[k];
440 xmom_src_arr(i, j, k) -= dampcoef*sinesq * (uu -
ubar[k]) * rho_on_u_face;
444 if (rayleigh_damp_V) {
445 ParallelFor(tby, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
448 Real vv = rho_v(i,j,k) / rho_on_v_face;
449 Real sinesq = d_sinesq_at_lev[k];
450 ymom_src_arr(i, j, k) -= dampcoef*sinesq * (vv -
vbar[k]) * rho_on_v_face;
455 if ( (is_slow_step && !use_Rayleigh_fast_w) || (!is_slow_step && use_Rayleigh_fast_w)) {
456 if (rayleigh_damp_W) {
457 ParallelFor(tbz, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
460 Real ww = rho_w(i,j,k) / rho_on_w_face;
461 Real sinesq = d_sinesq_stag_at_lev[k];
462 zmom_src_arr(i, j, k) -= dampcoef*sinesq * (ww -
wbar[k]) * rho_on_w_face;
472 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
475 xmom_src_arr(i, j, k) += rho_on_u_face * abl_geo_forcing[0];
477 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
480 ymom_src_arr(i, j, k) += rho_on_v_face * abl_geo_forcing[1];
482 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
485 zmom_src_arr(i, j, k) += rho_on_w_face * abl_geo_forcing[2];
492 if (geo_wind_profile && is_slow_step) {
494 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
497 xmom_src_arr(i, j, k) -= coriolis_factor * rho_on_u_face * dptr_v_geos[k] * sinphi;
499 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
502 ymom_src_arr(i, j, k) += coriolis_factor * rho_on_v_face * dptr_u_geos[k] * sinphi;
513 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
517 Real z_xf_lo =
fourth * ( z_nd_arr(i,j,k ) + z_nd_arr(i,j+1,k )
518 + z_nd_arr(i,j,k-1) + z_nd_arr(i,j+1,k-1) );
519 Real z_xf_hi =
fourth * ( z_nd_arr(i,j,k+1) + z_nd_arr(i,j+1,k+1)
520 + z_nd_arr(i,j,k+2) + z_nd_arr(i,j+1,k+2) );
521 dzInv =
one / (z_xf_hi - z_xf_lo);
523 Real rho_on_u_face =
myhalf * ( cell_data(i,j,k,
nr) + cell_data(i-1,j,k,
nr) );
524 Real U_hi = dptr_u_plane(k+1) / dptr_r_plane(k+1);
525 Real U_lo = dptr_u_plane(k-1) / dptr_r_plane(k-1);
526 Real wbar_xf =
myhalf * (dptr_wbar_sub[k] + dptr_wbar_sub[k+1]);
527 xmom_src_arr(i, j, k) -= rho_on_u_face * wbar_xf * (U_hi - U_lo) * dzInv;
529 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
533 Real z_yf_lo =
fourth * ( z_nd_arr(i,j,k ) + z_nd_arr(i+1,j,k )
534 + z_nd_arr(i,j,k-1) + z_nd_arr(i+1,j,k-1) );
535 Real z_yf_hi =
fourth * ( z_nd_arr(i,j,k+1) + z_nd_arr(i+1,j,k+1)
536 + z_nd_arr(i,j,k+2) + z_nd_arr(i+1,j,k+2) );
537 dzInv =
one / (z_yf_hi - z_yf_lo);
539 Real rho_on_v_face =
myhalf * ( cell_data(i,j,k,
nr) + cell_data(i,j-1,k,
nr) );
540 Real V_hi = dptr_v_plane(k+1) / dptr_r_plane(k+1);
541 Real V_lo = dptr_v_plane(k-1) / dptr_r_plane(k-1);
542 Real wbar_yf =
myhalf * (dptr_wbar_sub[k] + dptr_wbar_sub[k+1]);
543 ymom_src_arr(i, j, k) -= rho_on_v_face * wbar_yf * (V_hi - V_lo) * dzInv;
547 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
551 Real z_xf_lo =
fourth * ( z_nd_arr(i,j,k ) + z_nd_arr(i,j+1,k )
552 + z_nd_arr(i,j,k-1) + z_nd_arr(i,j+1,k-1) );
553 Real z_xf_hi =
fourth * ( z_nd_arr(i,j,k+1) + z_nd_arr(i,j+1,k+1)
554 + z_nd_arr(i,j,k+2) + z_nd_arr(i,j+1,k+2) );
555 dzInv =
one / (z_xf_hi - z_xf_lo);
557 Real U_hi = dptr_u_plane(k+1) / dptr_r_plane(k+1);
558 Real U_lo = dptr_u_plane(k-1) / dptr_r_plane(k-1);
559 Real wbar_xf =
myhalf * (dptr_wbar_sub[k] + dptr_wbar_sub[k+1]);
560 xmom_src_arr(i, j, k) -= wbar_xf * (U_hi - U_lo) * dzInv;
562 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
566 Real z_yf_lo =
fourth * ( z_nd_arr(i,j,k ) + z_nd_arr(i+1,j,k )
567 + z_nd_arr(i,j,k-1) + z_nd_arr(i+1,j,k-1) );
568 Real z_yf_hi =
fourth * ( z_nd_arr(i,j,k+1) + z_nd_arr(i+1,j,k+1)
569 + z_nd_arr(i,j,k+2) + z_nd_arr(i+1,j,k+2) );
570 dzInv =
one / (z_yf_hi - z_yf_lo);
572 Real V_hi = dptr_v_plane(k+1) / dptr_r_plane(k+1);
573 Real V_lo = dptr_v_plane(k-1) / dptr_r_plane(k-1);
574 Real wbar_yf =
myhalf * (dptr_wbar_sub[k] + dptr_wbar_sub[k+1]);
575 ymom_src_arr(i, j, k) -= wbar_yf * (V_hi - V_lo) * dzInv;
594 for (
int nt = 1; nt < n_sounding_times; nt++) {
597 if (itime_n == n_sounding_times-1) {
600 itime_np1 = itime_n+1;
603 coeff_n =
one - coeff_np1;
608 const Real* u_inp_sound_n = input_sounding_data.
U_inp_sound_d[itime_n].dataPtr();
609 const Real* u_inp_sound_np1 = input_sounding_data.
U_inp_sound_d[itime_np1].dataPtr();
610 const Real* v_inp_sound_n = input_sounding_data.
V_inp_sound_d[itime_n].dataPtr();
611 const Real* v_inp_sound_np1 = input_sounding_data.
V_inp_sound_d[itime_np1].dataPtr();
613 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
615 Real nudge_u = (coeff_n*u_inp_sound_n[k] + coeff_np1*u_inp_sound_np1[k]) - (dptr_u_plane(k)/dptr_r_plane(k));
617 xmom_src_arr(i, j, k) += cell_data(i, j, k,
nr) * nudge_u;
619 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
621 Real nudge_v = (coeff_n*v_inp_sound_n[k] + coeff_np1*v_inp_sound_np1[k]) - (dptr_v_plane(k)/dptr_r_plane(k));
623 ymom_src_arr(i, j, k) += cell_data(i, j, k,
nr) * nudge_v;
632 const Array4<const Real>& mf_ux = mapfac[MapFac::ux]->const_array(mfi);
633 const Array4<const Real>& mf_uy = mapfac[MapFac::uy]->const_array(mfi);
634 const Array4<const Real>& mf_vx = mapfac[MapFac::vx]->const_array(mfi);
635 const Array4<const Real>& mf_vy = mapfac[MapFac::vy]->const_array(mfi);
637 u, cell_data, xmom_src_arr, mf_ux, mf_uy);
639 v, cell_data, ymom_src_arr, mf_vx, mf_vy);
650 z_cc_arr, xmom_src_arr, ymom_src_arr,
651 rho_u, rho_v, d_sponge_ptrs_at_lev);
656 xmom_src_arr, ymom_src_arr, zmom_src_arr, rho_u, rho_v, rho_w,
657 r0, z_nd_arr, z_cc_arr);
662 const Array4<const Real>& rho_u_forecast_state = (*forecast_state_at_lev)[
IntVars::xmom].array(mfi);
663 const Array4<const Real>& rho_v_forecast_state = (*forecast_state_at_lev)[
IntVars::ymom].array(mfi);
664 const Array4<const Real>& rho_w_forecast_state = (*forecast_state_at_lev)[
IntVars::zmom].array(mfi);
665 const Array4<const Real>& cons_forecast_state = (*forecast_state_at_lev)[
IntVars::cons].array(mfi);
667 xmom_src_arr, ymom_src_arr, zmom_src_arr,
669 rho_u_forecast_state, rho_v_forecast_state, rho_w_forecast_state,
670 cons_forecast_state);
673 const Array4<const Real>& surface_state_arr = (*surface_state_at_lev).array(mfi);
675 xmom_src_arr, ymom_src_arr,
686 ((is_slow_step && !use_canopy_fast) || (!is_slow_step && use_canopy_fast))) {
688 [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept
690 const Real ux = u(i, j, k);
691 const Real uy =
fourth * ( v(i, j , k ) + v(i-1, j , k )
692 + v(i, j+1, k ) + v(i-1, j+1, k ) );
693 const Real uz =
fourth * ( w(i, j , k ) + w(i-1, j , k )
694 + w(i, j , k+1) + w(i-1, j , k+1) );
695 const Real windspeed = std::sqrt(ux * ux + uy * uy + uz * uz);
696 const Real f_drag =
myhalf * (f_drag_arr(i, j, k) + f_drag_arr(i-1, j, k));
697 xmom_src_arr(i, j, k) -= f_drag * ux * windspeed;
699 [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept
701 const Real ux =
fourth * ( u(i , j , k ) + u(i , j-1, k )
702 + u(i+1, j , k ) + u(i+1, j-1, k ) );
703 const Real uy = v(i, j, k);
704 const Real uz =
fourth * ( w(i , j , k ) + w(i , j-1, k )
705 + w(i , j , k+1) + w(i , j-1, k+1) );
706 const amrex::Real windspeed = std::sqrt(ux * ux + uy * uy + uz * uz);
707 const Real f_drag =
myhalf * (f_drag_arr(i, j, k) + f_drag_arr(i, j-1, k));
708 ymom_src_arr(i, j, k) -= f_drag * uy * windspeed;
710 [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept
713 + u(i , j , k-1) + u(i+1, j , k-1) );
715 + v(i , j , k-1) + v(i , j+1, k-1) );
717 const amrex::Real windspeed = std::sqrt(ux * ux + uy * uy + uz * uz);
718 const Real f_drag =
myhalf * (f_drag_arr(i, j, k) + f_drag_arr(i, j, k-1));
719 zmom_src_arr(i, j, k) -= f_drag * uz * windspeed;
725 if (solverChoice.
terrain_type == TerrainType::ImmersedForcing &&
726 ((is_slow_step && !use_ImmersedForcing_fast) || (!is_slow_step && use_ImmersedForcing_fast))) {
728 const Real* dx_arr = geom.CellSize();
729 const Real dx_x = dx_arr[0];
730 const Real dx_y = dx_arr[1];
731 const Real dx_z = dx_arr[2];
734 const Real drag_coefficient = alpha_m / std::pow(dx_x*dx_y*dx_z,
one/
three);
747 ParallelFor(tbx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept
749 const Real ux = u(i, j, k);
750 const Real uy =
fourth * ( v(i, j , k ) + v(i-1, j , k )
751 + v(i, j+1, k ) + v(i-1, j+1, k ) );
752 const Real uz =
fourth * ( w(i, j , k ) + w(i-1, j , k )
753 + w(i, j , k+1) + w(i-1, j , k+1) );
754 const Real windspeed = std::sqrt(ux * ux + uy * uy + uz * uz);
755 const Real t_blank =
myhalf * (t_blank_arr(i, j, k) + t_blank_arr(i-1, j, k));
756 const Real t_blank_above =
myhalf * (t_blank_arr(i, j, k+1) + t_blank_arr(i-1, j, k+1));
757 const Real CdM = std::min(drag_coefficient / (windspeed + tiny),
Real(1000.0));
760 if ((t_blank > 0 && (t_blank_above ==
zero)) && l_use_most) {
762 const Real ux2r = u(i, j, k+1) ;
763 const Real uy2r =
fourth * ( v(i, j , k+1) + v(i-1, j , k+1)
764 + v(i, j+1, k+1) + v(i-1, j+1, k+1) ) ;
765 const Real h_windspeed2r = std::sqrt(ux2r * ux2r + uy2r * uy2r);
771 const Real theta_surf = theta_xface_below;
775 Real ustar = h_windspeed2r * kappa / (std::log(
Real(1.5) * dx_z /
z0) - psi_m);
776 Real tflux = (tflux_in != 1e-8) ? tflux_in : -(theta_xface - theta_surf) * ustar * kappa / (std::log(
Real(1.5) * dx_z /
z0) - psi_h);
777 Real Olen = (Olen_in != 1e-8) ? Olen_in : -ustar * ustar * ustar * theta_xface / (kappa * ggg * tflux + tiny);
778 Real zeta =
Real(1.5) * dx_z / Olen;
783 ustar = h_windspeed2r * kappa / (std::log(
Real(1.5) * dx_z /
z0) - psi_m);
786 if (!(ustar >
zero && !std::isnan(ustar))) { ustar =
zero; }
787 if (!(ustar <
two && !std::isnan(ustar))) { ustar =
two; }
788 if (psi_m > std::log(
myhalf * dx_z /
z0)) { psi_m = std::log(
myhalf * dx_z /
z0); }
791 const Real uTarget = ustar / kappa * (std::log(
myhalf * dx_z /
z0) - psi_m);
792 Real uxTarget = uTarget * ux2r / (tiny + h_windspeed2r);
793 const Real bc_forcing_x = -(uxTarget - ux);
794 xmom_src_arr(i, j, k) -= (1-t_blank) * rho_xface * CdM * U_s * bc_forcing_x;
796 xmom_src_arr(i, j, k) -= t_blank * rho_xface * CdM * ux * windspeed;
799 ParallelFor(tby, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept
801 const Real ux =
fourth * ( u(i , j , k ) + u(i , j-1, k )
802 + u(i+1, j , k ) + u(i+1, j-1, k ) );
803 const Real uy = v(i, j, k);
804 const Real uz =
fourth * ( w(i , j , k ) + w(i , j-1, k )
805 + w(i , j , k+1) + w(i , j-1, k+1) );
806 const Real windspeed = std::sqrt(ux * ux + uy * uy + uz * uz);
807 const Real t_blank =
myhalf * (t_blank_arr(i, j, k) + t_blank_arr(i, j-1, k));
808 const Real t_blank_above =
myhalf * (t_blank_arr(i, j, k+1) + t_blank_arr(i, j-1, k+1));
809 const Real CdM = std::min(drag_coefficient / (windspeed + tiny),
Real(1000.0));
812 if ((t_blank > 0 && (t_blank_above ==
zero)) && l_use_most) {
814 const Real ux2r =
fourth * ( u(i , j , k+1) + u(i , j-1, k+1)
815 + u(i+1, j , k+1) + u(i+1, j-1, k+1) );
816 const Real uy2r = v(i, j, k+1) ;
817 const Real h_windspeed2r = std::sqrt(ux2r * ux2r + uy2r * uy2r);
823 const Real theta_surf = theta_yface_below;
827 Real ustar = h_windspeed2r * kappa / (std::log(
Real(1.5) * dx_z /
z0) - psi_m);
828 Real tflux = (tflux_in != 1e-8) ? tflux_in : -(theta_yface - theta_surf) * ustar * kappa / (std::log(
Real(1.5) * dx_z /
z0) - psi_h);
829 Real Olen = (Olen_in != 1e-8) ? Olen_in : -ustar * ustar * ustar * theta_yface / (kappa * ggg * tflux + tiny);
830 Real zeta =
Real(1.5) * dx_z / Olen;
835 ustar = h_windspeed2r * kappa / (std::log(
Real(1.5) * dx_z /
z0) - psi_m);
838 if (!(ustar >
zero && !std::isnan(ustar))) { ustar =
zero; }
839 if (!(ustar <
two && !std::isnan(ustar))) { ustar =
two; }
840 if (psi_m > std::log(
myhalf * dx_z /
z0)) { psi_m = std::log(
myhalf * dx_z /
z0); }
843 const Real uTarget = ustar / kappa * (std::log(
myhalf * dx_z /
z0) - psi_m);
844 Real uyTarget = uTarget * uy2r / (tiny + h_windspeed2r);
845 const Real bc_forcing_y = -(uyTarget - uy);
846 ymom_src_arr(i, j, k) -= (1 - t_blank) * rho_yface * CdM * U_s * bc_forcing_y;
848 ymom_src_arr(i, j, k) -= t_blank * rho_yface * CdM * uy * windspeed;
851 ParallelFor(tbz, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept
853 const Real ux =
fourth * ( u(i , j , k ) + u(i+1, j , k )
854 + u(i , j , k-1) + u(i+1, j , k-1) );
855 const Real uy =
fourth * ( v(i , j , k ) + v(i , j+1, k )
856 + v(i , j , k-1) + v(i , j+1, k-1) );
857 const Real uz = w(i, j, k);
858 const Real windspeed = std::sqrt(ux * ux + uy * uy + uz * uz);
859 const Real t_blank =
myhalf * (t_blank_arr(i, j, k) + t_blank_arr(i, j, k-1));
860 const Real CdM = std::min(drag_coefficient / (windspeed + tiny),
Real(1000.0));
862 zmom_src_arr(i, j, k) -= t_blank * rho_zface * CdM * uz * windspeed;
869 if ((solverChoice.
buildings_type == BuildingsType::ImmersedForcing ) &&
870 ((is_slow_step && !use_ImmersedForcing_fast) || (!is_slow_step && use_ImmersedForcing_fast)))
873 const Real* dx_arr = geom.CellSize();
874 const Real dx_x = dx_arr[0];
875 const Real dx_y = dx_arr[1];
879 const Real min_t_blank =
Real(0.005);
881 ParallelFor(tbx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept
883 const Real ux = u(i, j, k);
884 const Real uy =
fourth * ( v(i, j , k ) + v(i-1, j , k )
885 + v(i, j+1, k ) + v(i-1, j+1, k ) );
886 const Real uz =
fourth * ( w(i, j , k ) + w(i-1, j , k )
887 + w(i, j , k+1) + w(i-1, j , k+1) );
888 const Real windspeed = std::sqrt(ux * ux + uy * uy + uz * uz);
890 Real t_blank =
myhalf * (t_blank_arr(i, j, k) + t_blank_arr(i-1, j, k));
891 if (t_blank < min_t_blank) { t_blank =
zero; }
892 const Real dx_z = (z_cc_arr) ? (z_cc_arr(i,j,k) - z_cc_arr(i,j,k-1)) : dx_arr[2];
893 const Real drag_coefficient = alpha_m / std::pow(dx_x*dx_y*dx_z,
one/
three);
894 const Real CdM = std::min(drag_coefficient / (windspeed + tiny),
Real(1000.0));
896 xmom_src_arr(i, j, k) -= t_blank * rho_xface * CdM * ux * windspeed;
898 ParallelFor(tby, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept
900 const Real ux =
fourth * ( u(i , j , k ) + u(i , j-1, k )
901 + u(i+1, j , k ) + u(i+1, j-1, k ) );
902 const Real uy = v(i, j, k);
903 const Real uz =
fourth * ( w(i , j , k ) + w(i , j-1, k )
904 + w(i , j , k+1) + w(i , j-1, k+1) );
905 const Real windspeed = std::sqrt(ux * ux + uy * uy + uz * uz);
907 Real t_blank =
myhalf * (t_blank_arr(i, j, k) + t_blank_arr(i, j-1, k));
908 if (t_blank < min_t_blank) { t_blank =
zero; }
909 const Real dx_z = (z_cc_arr) ? (z_cc_arr(i,j,k) - z_cc_arr(i,j,k-1)) : dx_arr[2];
910 const Real drag_coefficient = alpha_m / std::pow(dx_x*dx_y*dx_z,
one/
three);
911 const Real CdM = std::min(drag_coefficient / (windspeed + tiny),
Real(1000.0));
913 ymom_src_arr(i, j, k) -= t_blank * rho_yface * CdM * uy * windspeed;
915 ParallelFor(tbz, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept
917 const Real ux =
fourth * ( u(i , j , k ) + u(i+1, j , k )
918 + u(i , j , k-1) + u(i+1, j , k-1) );
919 const Real uy =
fourth * ( v(i , j , k ) + v(i , j+1, k )
920 + v(i , j , k-1) + v(i , j+1, k-1) );
921 const Real uz = w(i, j, k);
922 const Real windspeed = std::sqrt(ux * ux + uy * uy + uz * uz);
924 Real t_blank =
myhalf * (t_blank_arr(i, j, k) + t_blank_arr(i, j, k-1));
925 if (t_blank < min_t_blank) { t_blank =
zero; }
926 const Real dx_z = (z_nd_arr) ? (z_nd_arr(i,j,k) - z_nd_arr(i,j,k-1)) : dx_arr[2];
927 const Real drag_coefficient = alpha_m / std::pow(dx_x*dx_y*dx_z,
one/
three);
928 const Real CdM = std::min(drag_coefficient / (windspeed + tiny),
Real(1000.0));
930 zmom_src_arr(i, j, k) -= t_blank * rho_zface * CdM * uz * windspeed;
937 if (is_slow_step && (enforce_massflux_x || enforce_massflux_y)) {
941 [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept {
942 xmom_src_arr(i, j, k) += tau_inv * (rhoUA_target - rhoUA);
944 [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept {
945 ymom_src_arr(i, j, k) += tau_inv * (rhoVA_target - rhoVA);
void ApplyBndryForcing_Forecast(const SolverChoice &solverChoice, const Geometry geom, const Box &tbx, const Box &tby, const Box &tbz, const Array4< const Real > &z_phys_nd, const Array4< Real > &rho_u_rhs, const Array4< Real > &rho_v_rhs, const Array4< Real > &rho_w_rhs, const Array4< const Real > &rho_u, const Array4< const Real > &rho_v, const Array4< const Real > &rho_w, const Array4< const Real > &rho_u_initial_state, const Array4< const Real > &rho_v_initial_state, const Array4< const Real > &rho_w_initial_state, const Array4< const Real > &cons_initial_state)
Definition: ERF_ApplyBndryForcing_Forecast.cpp:8
void ApplySpongeZoneBCsForMom(const SpongeChoice &spongeChoice, const Geometry geom, const Box &tbx, const Box &tby, const Box &tbz, const Array4< Real > &rho_u_rhs, const Array4< Real > &rho_v_rhs, const Array4< Real > &rho_w_rhs, const Array4< const Real > &rho_u, const Array4< const Real > &rho_v, const Array4< const Real > &rho_w, const Array4< const Real > &r0, const Array4< const Real > &z_phys_nd, const Array4< const Real > &z_phys_cc)
Definition: ERF_ApplySpongeZoneBCs.cpp:169
void ApplySpongeZoneBCsForMom_ReadFromFile(const SpongeChoice &spongeChoice, const Geometry geom, const Box &tbx, const Box &tby, const Array4< const Real > &cell_data, const Array4< const Real > &z_phys_cc, const Array4< Real > &rho_u_rhs, const Array4< Real > &rho_v_rhs, const Array4< const Real > &rho_u, const Array4< const Real > &rho_v, const Vector< Real * > d_sponge_ptrs_at_lev)
Definition: ERF_ApplySpongeZoneBCs_ReadFromFile.cpp:8
void ApplySurfaceTreatment_BulkCoeff_Mom(const Box &tbx, const Box &tby, const Array4< Real > &rho_u_rhs, const Array4< Real > &rho_v_rhs, const Array4< const Real > &rho_u, const Array4< const Real > &rho_v, const Array4< const Real > &cons_state, const Array4< const Real > &z_phys_nd, const Array4< const Real > &surface_state_arr)
Definition: ERF_ApplySurfaceTreatment_BulkCoeff.cpp:8
constexpr amrex::Real three
Definition: ERF_Constants.H:9
constexpr amrex::Real KAPPA
Definition: ERF_Constants.H:30
constexpr amrex::Real two
Definition: ERF_Constants.H:8
constexpr amrex::Real one
Definition: ERF_Constants.H:7
constexpr amrex::Real fourth
Definition: ERF_Constants.H:12
constexpr amrex::Real zero
Definition: ERF_Constants.H:6
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:11
constexpr amrex::Real PI
Definition: ERF_Constants.H:16
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:31
@ ubar
Definition: ERF_DataStruct.H:98
@ wbar
Definition: ERF_DataStruct.H:98
@ vbar
Definition: ERF_DataStruct.H:98
DirectionSelector< 2 > ZDir
Definition: ERF_DirectionSelector.H:38
#define Rho_comp
Definition: ERF_IndexDefines.H:36
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:37
amrex::GpuArray< Real, AMREX_SPACEDIM > dxInv
Definition: ERF_InitCustomPertVels_ParticleTests.H:17
Real z0
Definition: ERF_InitCustomPertVels_ScalarAdvDiff.H:8
ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const auto prob_lo=geomdata.ProbLo();const auto dx=geomdata.CellSize();const Real x=(prob_lo[0]+(i+myhalf) *dx[0])/mf_m(i, j, 0);const Real z=z_cc(i, j, k);Real L=std::sqrt(std::pow((x - x_c)/x_r, 2)+std::pow((z - z_c)/z_r, 2));if(L<=one) { Real dT=T_pert *(std::cos(PI *L)+one)/two;Real Tbar_hse=p_hse(i, j, k)/(R_d *r_hse(i, j, k));Real theta_perturbed=(Tbar_hse+dT) *std::pow(p_0/p_hse(i, j, k), rdOcp);Real theta_0=(Tbar_hse) *std::pow(p_0/p_hse(i, j, k), rdOcp);if(const_rho) { state_pert(i, j, k, RhoTheta_comp)=r_hse(i, j, k) *(theta_perturbed - theta_0);} else { state_pert(i, j, k, Rho_comp)=getRhoThetagivenP(p_hse(i, j, k))/theta_perturbed - r_hse(i, j, k);} } })
void NumericalDiffusion_Ymom(const Box &bx, const Real dt, const Real num_diff_coeff, const Array4< const Real > &prim_data, const Array4< const Real > &cell_data, const Array4< Real > &rhs, const Array4< const Real > &mfx_arr, const Array4< const Real > &mfy_arr)
Definition: ERF_NumericalDiffusion.cpp:151
void NumericalDiffusion_Xmom(const Box &bx, const Real dt, const Real num_diff_coeff, const Array4< const Real > &prim_data, const Array4< const Real > &cell_data, const Array4< Real > &rhs, const Array4< const Real > &mfx_arr, const Array4< const Real > &mfy_arr)
Definition: ERF_NumericalDiffusion.cpp:85
AMREX_FORCE_INLINE IntVect offset(const int face_dir, const int normal)
Definition: ERF_ReadBndryPlanes.cpp:28
amrex::Real Real
Definition: ERF_ShocInterface.H:19
Definition: ERF_PlaneAverage.H:14
eb_aux_ const * get_w_const_factory() const noexcept
Definition: ERF_EB.H:52
eb_aux_ const * get_v_const_factory() const noexcept
Definition: ERF_EB.H:51
eb_aux_ const * get_u_const_factory() const noexcept
Definition: ERF_EB.H:50
@ r0_comp
Definition: ERF_IndexDefines.H:63
@ ymom
Definition: ERF_IndexDefines.H:178
@ cons
Definition: ERF_IndexDefines.H:176
@ zmom
Definition: ERF_IndexDefines.H:179
@ xmom
Definition: ERF_IndexDefines.H:177
@ nr
Definition: ERF_Morrison.H:45
@ xvel
Definition: ERF_IndexDefines.H:159
@ cons
Definition: ERF_IndexDefines.H:158
@ yvel
Definition: ERF_IndexDefines.H:160
real(c_double), parameter epsilon
Definition: ERF_module_model_constants.F90:12
real(kind=kind_phys), parameter, private r0
Definition: ERF_module_mp_wsm6.F90:21
bool rayleigh_damp_V
Definition: ERF_DampingStruct.H:85
amrex::Real rayleigh_dampcoef
Definition: ERF_DampingStruct.H:88
bool rayleigh_damp_W
Definition: ERF_DampingStruct.H:86
RayleighDampingType rayleigh_damping_type
Definition: ERF_DampingStruct.H:101
bool rayleigh_damp_U
Definition: ERF_DampingStruct.H:84
bool do_mom_advection
Definition: ERF_DataStruct.H:1173
amrex::Real coriolis_factor
Definition: ERF_DataStruct.H:1164
static MeshType mesh_type
Definition: ERF_DataStruct.H:1079
amrex::Real if_surf_temp_flux
Definition: ERF_DataStruct.H:1144
bool if_use_most
Definition: ERF_DataStruct.H:1148
DampingChoice dampingChoice
Definition: ERF_DataStruct.H:1089
amrex::Real const_massflux_v
Definition: ERF_DataStruct.H:1242
amrex::Real if_z0
Definition: ERF_DataStruct.H:1143
amrex::Real cosphi
Definition: ERF_DataStruct.H:1165
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > abl_geo_forcing
Definition: ERF_DataStruct.H:1214
bool hindcast_lateral_forcing
Definition: ERF_DataStruct.H:1251
int massflux_klo
Definition: ERF_DataStruct.H:1246
bool custom_w_subsidence
Definition: ERF_DataStruct.H:1171
bool nudging_from_input_sounding
Definition: ERF_DataStruct.H:1181
bool immersed_forcing_substep
Definition: ERF_DataStruct.H:1136
amrex::Real sinphi
Definition: ERF_DataStruct.H:1166
bool have_geo_wind_profile
Definition: ERF_DataStruct.H:1216
amrex::Real const_massflux_u
Definition: ERF_DataStruct.H:1241
amrex::Real if_Olen_in
Definition: ERF_DataStruct.H:1147
bool use_coriolis
Definition: ERF_DataStruct.H:1130
amrex::Real num_diff_coeff
Definition: ERF_DataStruct.H:1200
bool variable_coriolis
Definition: ERF_DataStruct.H:1218
amrex::Real if_Cd_momentum
Definition: ERF_DataStruct.H:1141
bool custom_forcing_prim_vars
Definition: ERF_DataStruct.H:1175
static BuildingsType buildings_type
Definition: ERF_DataStruct.H:1070
static TerrainType terrain_type
Definition: ERF_DataStruct.H:1067
SpongeChoice spongeChoice
Definition: ERF_DataStruct.H:1090
static InitType init_type
Definition: ERF_DataStruct.H:1061
bool hindcast_surface_bcs
Definition: ERF_DataStruct.H:1252
bool do_forest_drag
Definition: ERF_DataStruct.H:1238
amrex::Real const_massflux_tau
Definition: ERF_DataStruct.H:1243
int massflux_khi
Definition: ERF_DataStruct.H:1247
bool forest_substep
Definition: ERF_DataStruct.H:1137
int ave_plane
Definition: ERF_DataStruct.H:1220
std::string sponge_type
Definition: ERF_SpongeStruct.H:60
Definition: ERF_MOSTStress.H:40
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_psi_m(amrex::Real zeta) const
Definition: ERF_MOSTStress.H:90
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_psi_h(amrex::Real zeta) const
Definition: ERF_MOSTStress.H:104