ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_MakeTauTerms.cpp File Reference
#include "AMReX_ArrayLim.H"
#include "AMReX_BCRec.H"
#include "AMReX_GpuContainers.H"
#include "ERF_TI_slow_headers.H"
#include "ERF_EOS.H"
#include "ERF_Utils.H"
Include dependency graph for ERF_MakeTauTerms.cpp:

Functions

void erf_make_tau_terms (int level, int nrk, const Vector< BCRec > &domain_bcs_type_h, const MultiFab &z_phys_nd, Vector< MultiFab > &S_data, const MultiFab &xvel, const MultiFab &yvel, const MultiFab &zvel, Vector< std::unique_ptr< MultiFab >> &Tau_lev, Vector< std::unique_ptr< MultiFab >> &Tau_corr_lev, MultiFab *SmnSmn, MultiFab *eddyDiffs, const Geometry geom, const SolverChoice &solverChoice, std::unique_ptr< SurfaceLayer > &, Gpu::DeviceVector< Real > &stretched_dz_d, const MultiFab &detJ, Vector< std::unique_ptr< MultiFab >> &mapfac, const MultiFab &ax, const MultiFab &ay, const MultiFab &az, const eb_ &ebfact)
 
void copy_surface_tau_for_implicit (Vector< std::unique_ptr< MultiFab >> &Tau_lev, Vector< std::unique_ptr< MultiFab >> &Tau_corr_lev)
 

Function Documentation

◆ copy_surface_tau_for_implicit()

void copy_surface_tau_for_implicit ( Vector< std::unique_ptr< MultiFab >> &  Tau_lev,
Vector< std::unique_ptr< MultiFab >> &  Tau_corr_lev 
)
683 {
684  // This is only needed if we're using a surface layer, which overwrites the
685  // shear stresses at klo -- at the moment, this is for testing
686 
687  for ( MFIter mfi(*Tau_lev[TauType::tau11],TileNoZ()); mfi.isValid(); ++mfi)
688  {
689  Array4<Real> tau13 = Tau_lev[TauType::tau13]->array(mfi);
690  Array4<Real> tau23 = Tau_lev[TauType::tau23]->array(mfi);
691 
692  Array4<Real> tau13_corr = Tau_corr_lev[0]->array(mfi);
693  Array4<Real> tau23_corr = Tau_corr_lev[1]->array(mfi);
694 
695  const int klo{0};
696  Box bx = mfi.tilebox();
697  bx.makeSlab(2,klo);
698  Box bxx = surroundingNodes(bx,0);
699  Box bxy = surroundingNodes(bx,1);
700 
701  ParallelFor(bxx, bxy,
702  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
703  tau13_corr(i,j,k) = tau13(i,j,k);
704  },
705  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
706  tau23_corr(i,j,k) = tau23(i,j,k);
707  });
708  }
709 }
@ tau23
Definition: ERF_DataStruct.H:32
@ tau11
Definition: ERF_DataStruct.H:32
@ tau13
Definition: ERF_DataStruct.H:32
ParallelFor(grown_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);})
AMREX_FORCE_INLINE amrex::IntVect TileNoZ()
Definition: ERF_TileNoZ.H:11
Here is the call graph for this function:

◆ erf_make_tau_terms()

void erf_make_tau_terms ( int  level,
int  nrk,
const Vector< BCRec > &  domain_bcs_type_h,
const MultiFab &  z_phys_nd,
Vector< MultiFab > &  S_data,
const MultiFab &  xvel,
const MultiFab &  yvel,
const MultiFab &  zvel,
Vector< std::unique_ptr< MultiFab >> &  Tau_lev,
Vector< std::unique_ptr< MultiFab >> &  Tau_corr_lev,
MultiFab *  SmnSmn,
MultiFab *  eddyDiffs,
const Geometry  geom,
const SolverChoice solverChoice,
std::unique_ptr< SurfaceLayer > &  ,
Gpu::DeviceVector< Real > &  stretched_dz_d,
const MultiFab &  detJ,
Vector< std::unique_ptr< MultiFab >> &  mapfac,
const MultiFab &  ax,
const MultiFab &  ay,
const MultiFab &  az,
const eb_ ebfact 
)
31 {
32  BL_PROFILE_REGION("erf_make_tau_terms()");
33 
34  const BCRec* bc_ptr_h = domain_bcs_type_h.data();
35 
36  DiffChoice dc = solverChoice.diffChoice;
37  TurbChoice tc = solverChoice.turbChoice[level];
38 
39  const bool l_use_terrain_fitted_coords = (solverChoice.mesh_type != MeshType::ConstantDz);
40  const bool l_moving_terrain = (solverChoice.terrain_type == TerrainType::MovingFittedMesh);
41  if (l_moving_terrain) AMREX_ALWAYS_ASSERT (l_use_terrain_fitted_coords);
42 
43 
44  const bool l_use_diff = ( (dc.molec_diff_type != MolecDiffType::None) || tc.use_kturb );
45  const bool l_use_constAlpha = ( dc.molec_diff_type == MolecDiffType::ConstantAlpha );
46  const bool l_use_turb = ( tc.les_type == LESType::Smagorinsky ||
47  tc.les_type == LESType::Deardorff ||
48  tc.rans_type == RANSType::kEqn ||
49  tc.pbl_type == PBLType::MYJ ||
50  tc.pbl_type == PBLType::MYNN25 ||
51  tc.pbl_type == PBLType::MYNNEDMF ||
52  tc.pbl_type == PBLType::YSU ||
53  tc.pbl_type == PBLType::YSUNew ||
54  tc.pbl_type == PBLType::MRF);
55 
56  const bool need_SmnSmn = (tc.les_type == LESType::Deardorff ||
57  tc.rans_type == RANSType::kEqn);
58 
59  const bool do_implicit = (solverChoice.vert_implicit_fac[level][nrk] > 0) && solverChoice.implicit_momentum_diffusion;
60 
61  const Box& domain = geom.Domain();
62  const int domlo_z = domain.smallEnd(2);
63  const int domhi_z = domain.bigEnd(2);
64 
65  const GpuArray<Real, AMREX_SPACEDIM> dxInv = geom.InvCellSizeArray();
66 
67  // *****************************************************************************
68  // Pre-computed quantities
69  // *****************************************************************************
70  const BoxArray& ba = S_data[IntVars::cons].boxArray();
71  const DistributionMapping& dm = S_data[IntVars::cons].DistributionMap();
72 
73  std::unique_ptr<MultiFab> expr;
74 
75  if (l_use_diff) {
76  expr = std::make_unique<MultiFab>(ba, dm, 1, IntVect(1,1,1));
77 
78  // if using constant alpha (mu = rho * alpha), then first divide by the
79  // reference density -- mu_eff will be scaled by the instantaneous
80  // local density later when ComputeStress*Visc_*() is called
81  Real mu_eff = (l_use_constAlpha) ? two * dc.dynamic_viscosity / dc.rho0_trans
82  : two * dc.dynamic_viscosity;
83 
84  auto dz_ptr = stretched_dz_d.data();
85 
86 #ifdef _OPENMP
87 #pragma omp parallel if (Gpu::notInLaunchRegion())
88 #endif
89  for ( MFIter mfi(S_data[IntVars::cons],TileNoZ()); mfi.isValid(); ++mfi)
90  {
91  const Box& valid_bx = mfi.validbox();
92 
93  // Velocities
94  const Array4<const Real> & u = xvel.array(mfi);
95  const Array4<const Real> & v = yvel.array(mfi);
96  const Array4<const Real> & w = zvel.array(mfi);
97 
98  // Map factors
99  const Array4<const Real>& mf_mx = mapfac[MapFacType::m_x]->const_array(mfi);
100  const Array4<const Real>& mf_ux = mapfac[MapFacType::u_x]->const_array(mfi);
101  const Array4<const Real>& mf_vx = mapfac[MapFacType::v_x]->const_array(mfi);
102  const Array4<const Real>& mf_my = mapfac[MapFacType::m_y]->const_array(mfi);
103  const Array4<const Real>& mf_uy = mapfac[MapFacType::u_y]->const_array(mfi);
104  const Array4<const Real>& mf_vy = mapfac[MapFacType::v_y]->const_array(mfi);
105 
106  // Eddy viscosity
107  const Array4<Real const>& mu_turb = l_use_turb ? eddyDiffs->const_array(mfi) :
108  Array4<const Real>{};
109  const Array4<Real const>& cell_data = l_use_constAlpha ? S_data[IntVars::cons].const_array(mfi) :
110  Array4<const Real>{};
111 
112  // Terrain metrics
113  const Array4<const Real>& z_nd = z_phys_nd.const_array(mfi);
114  const Array4<const Real>& detJ_arr = detJ.const_array(mfi);
115 
116  // EB
117  Array4<const EBCellFlag> cflag{};
118  Array4<const Real> vfrac{};
119  Array4<const Real> apx{};
120  Array4<const Real> apy{};
121  Array4<const Real> apz{};
122  if (solverChoice.terrain_type == TerrainType::EB) {
123  EBCellFlagFab const& cflag_fab = (ebfact.get_const_factory())->getMultiEBCellFlagFab()[mfi];
124  cflag = cflag_fab.const_array();
125  if (cflag_fab.getType(valid_bx) == FabType::singlevalued) {
126  vfrac = (ebfact.get_const_factory())->getVolFrac().const_array(mfi);
127  apx = (ebfact.get_const_factory())->getAreaFrac()[0]->const_array(mfi);
128  apy = (ebfact.get_const_factory())->getAreaFrac()[1]->const_array(mfi);
129  apz = (ebfact.get_const_factory())->getAreaFrac()[2]->const_array(mfi);
130  } else {
131  vfrac = detJ.const_array(mfi);
132  apx = ax.const_array(mfi);
133  apy = ay.const_array(mfi);
134  apz = az.const_array(mfi);
135  }
136  }
137 
138  //-------------------------------------------------------------------------------
139  // NOTE: Tile boxes with terrain are not intuitive. The linear combination of
140  // stress terms requires care. Create a tile box that intersects the
141  // valid box, then grow the box in x/y. Compute the strain on the local
142  // FAB over this grown tile box. Compute the stress over the tile box,
143  // except tau_ii which still needs the halo cells. Finally, write from
144  // the local FAB to the Tau MF but only on the tile box.
145  //-------------------------------------------------------------------------------
146 
147  //-------------------------------------------------------------------------------
148  // TODO: Avoid recomputing strain on the first RK stage. One could populate
149  // the FABs with tau_ij, compute stress, and then write to tau_ij. The
150  // problem with this approach is you will over-write the needed halo layer
151  // needed by subsequent tile boxes (particularly S_ii becomes Tau_ii).
152  //-------------------------------------------------------------------------------
153 
154  // Strain/Stress tile boxes
155  Box bx = mfi.tilebox();
156  Box bxcc = mfi.tilebox();
157  Box tbxxy = mfi.tilebox(IntVect(1,1,0));
158  Box tbxxz = mfi.tilebox(IntVect(1,0,1));
159  Box tbxyz = mfi.tilebox(IntVect(0,1,1));
160 
161  // We need a halo cell for terrain
162  bxcc.grow(IntVect(1,1,0));
163  tbxxy.grow(IntVect(1,1,0));
164  tbxxz.grow(IntVect(1,1,0));
165  tbxyz.grow(IntVect(1,1,0));
166 
167  if (bxcc.smallEnd(2) != domain.smallEnd(2)) {
168  bxcc.growLo(2,1);
169  tbxxy.growLo(2,1);
170  tbxxz.growLo(2,1);
171  tbxyz.growLo(2,1);
172  }
173 
174  if (bxcc.bigEnd(2) != domain.bigEnd(2)) {
175  bxcc.growHi(2,1);
176  tbxxy.growHi(2,1);
177  tbxxz.growHi(2,1);
178  tbxyz.growHi(2,1);
179  }
180 
181  // Expansion rate
182  Array4<Real> er_arr = expr->array(mfi);
183 
184  // Temporary storage for tiling/OMP
185  FArrayBox S11,S22,S33;
186  FArrayBox S12,S13,S23;
187 
188  // Symmetric strain/stresses
189  S11.resize( bxcc,1,The_Async_Arena()); S22.resize( bxcc,1,The_Async_Arena()); S33.resize( bxcc,1,The_Async_Arena());
190  S12.resize(tbxxy,1,The_Async_Arena()); S13.resize(tbxxz,1,The_Async_Arena()); S23.resize(tbxyz,1,The_Async_Arena());
191  Array4<Real> s11 = S11.array(); Array4<Real> s22 = S22.array(); Array4<Real> s33 = S33.array();
192  Array4<Real> s12 = S12.array(); Array4<Real> s13 = S13.array(); Array4<Real> s23 = S23.array();
193  Array4<Real> tau11 = Tau_lev[TauType::tau11]->array(mfi); Array4<Real> tau22 = Tau_lev[TauType::tau22]->array(mfi);
194  Array4<Real> tau33 = Tau_lev[TauType::tau33]->array(mfi); Array4<Real> tau12 = Tau_lev[TauType::tau12]->array(mfi);
195  Array4<Real> tau13 = Tau_lev[TauType::tau13]->array(mfi); Array4<Real> tau23 = Tau_lev[TauType::tau23]->array(mfi);
196 
197  // We cannot simply scale the tau3* terms since our implicit
198  // correction to vertical diffusion only applies to the
199  // second-order derivatives in the vertical and we don't want to
200  // touch the cross terms -- we save the terms here and
201  // manipulate them later.
202  FArrayBox S13_for_impl, S23_for_impl;
203  S13_for_impl.resize(tbxxz,1,The_Async_Arena());
204  S23_for_impl.resize(tbxyz,1,The_Async_Arena());
205  Array4<Real> s13_corr = (do_implicit) ? S13_for_impl.array() : Array4<Real>{};
206  Array4<Real> s23_corr = (do_implicit) ? S23_for_impl.array() : Array4<Real>{};
207  Array4<Real> tau13_corr = (do_implicit) ? Tau_corr_lev[0]->array(mfi) : Array4<Real>{};
208  Array4<Real> tau23_corr = (do_implicit) ? Tau_corr_lev[1]->array(mfi) : Array4<Real>{};
209 #ifdef ERF_IMPLICIT_W
210  FArrayBox S33_for_impl;
211  S33_for_impl.resize( bxcc,1,The_Async_Arena());
212  Array4<Real> s33_corr = (do_implicit) ? S33_for_impl.array() : Array4<Real>{};
213  Array4<Real> tau33_corr = (do_implicit) ? Tau_corr_lev[2]->array(mfi) : Array4<Real>{};
214 #else
215  Array4<Real> s33_corr = Array4<Real>{};
216  Array4<Real> tau33_corr = Array4<Real>{};
217 #endif
218 
219  // Calculate the magnitude of the strain-rate tensor squared if
220  // using Deardorff or k-eqn RANS. This contributes to the production
221  // term, included in diffusion source in slow RHS post and in the
222  // first RK stage (TKE tendencies constant for nrk>0, following WRF)
223  Array4<Real> SmnSmn_a = ((nrk==0) && need_SmnSmn) ? SmnSmn->array(mfi) : Array4<Real>{};
224 
225  // ****************************************************************
226  //
227  // These are the steps taken below...
228  //
229  // one Calculate expansion rate
230  // - will be added to the normal strain rates in ComputeStress
231  //
232  // two Call ComputeStrain
233  // - IMPLICIT path: s31_corr and s32_corr are modified in here
234  //
235  // three Call ComputeSmnSmn, if needed for turbulence model
236  //
237  // Real(4.) Call ComputeStress
238  // - add expansion rates to terms on diagonal
239  // - multiply strain rates by diffusivities, with the total
240  // viscosity calculated as the sum of a constant viscosity (or
241  // constant alpha with mu = rho*alpha) and the eddy viscosity
242  // from the turbulence model
243  // - IMPLICIT path: s33_corr is modified in here
244  //
245  // Real(5.) Copy temp Sij fabs into Tau_lev multifabs
246  // - stress tensor is symmetric if no terrain and no implicit diffusion
247  // - otherwise, stress tensor is asymmetric
248  //
249  // ****************************************************************
250 
251  if (solverChoice.mesh_type == MeshType::StretchedDz) {
252  // Terrain non-symmetric terms
253  FArrayBox S21,S31,S32;
254  S21.resize(tbxxy,1,The_Async_Arena()); S31.resize(tbxxz,1,The_Async_Arena()); S32.resize(tbxyz,1,The_Async_Arena());
255  Array4<Real> s21 = S21.array(); Array4<Real> s31 = S31.array(); Array4<Real> s32 = S32.array();
256  Array4<Real> tau21 = Tau_lev[TauType::tau21]->array(mfi);
257  Array4<Real> tau31 = Tau_lev[TauType::tau31]->array(mfi);
258  Array4<Real> tau32 = Tau_lev[TauType::tau32]->array(mfi);
259 
260  // *****************************************************************************
261  // Expansion rate compute terrain
262  // *****************************************************************************
263  {
264  BL_PROFILE("slow_rhs_making_er_S");
265  ParallelFor(bxcc, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
266  {
267  Real mfsq = mf_mx(i,j,0)*mf_my(i,j,0);
268  er_arr(i,j,k) = (u(i+1, j , k )/mf_uy(i+1,j,0) - u(i, j, k)/mf_uy(i,j,0))*dxInv[0] * mfsq + // == du / (dη/dy) * (1/dξ) * (dξ/dx)*(dη/dy) = du/dx
269  (v(i , j+1, k )/mf_vx(i,j+1,0) - v(i, j, k)/mf_vx(i,j,0))*dxInv[1] * mfsq + // == dv / (dξ/dx) * (1/dη) * (dξ/dx)*(dη/dy) = dv/dy
270  (w(i , j , k+1) - w(i, j, k) )/dz_ptr[k];
271  });
272  } // end profile
273 
274  // *****************************************************************************
275  // Strain tensor compute terrain
276  // *****************************************************************************
277  {
278  BL_PROFILE("slow_rhs_making_strain_S");
279  ComputeStrain_S(bxcc, tbxxy, tbxxz, tbxyz, domain,
280  u, v, w,
281  s11, s22, s33,
282  s12, s21,
283  s13, s31,
284  s23, s32,
285  stretched_dz_d, dxInv,
286  mf_mx, mf_ux, mf_vx,
287  mf_my, mf_uy, mf_vy, bc_ptr_h,
288  s13_corr, s23_corr);
289  } // end profile
290 
291  if (SmnSmn_a) {
292  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
293  {
294  SmnSmn_a(i,j,k) = ComputeSmnSmn(i,j,k,
295  s11,s22,s33,
296  s12,s13,s23);
297  });
298  }
299 
300  // *****************************************************************************
301  // Stress tensor compute terrain
302  // *****************************************************************************
303  {
304  BL_PROFILE("slow_rhs_making_stress_T");
305 
306  // Remove Halo cells just for tau_ij comps
307  tbxxy.grow(IntVect(-1,-1,0));
308  tbxxz.grow(IntVect(-1,-1,0));
309  tbxyz.grow(IntVect(-1,-1,0));
310 
311  if (!l_use_turb) {
312  ComputeStressConsVisc_S(bxcc, tbxxy, tbxxz, tbxyz, mu_eff,
313  cell_data,
314  s11, s22, s33,
315  s12, s21,
316  s13, s31,
317  s23, s32,
318  er_arr,
319  mf_mx, mf_ux, mf_vx,
320  mf_my, mf_uy, mf_vy,
321  s13_corr, s23_corr, s33_corr);
322  } else {
323  ComputeStressVarVisc_S(bxcc, tbxxy, tbxxz, tbxyz, mu_eff, mu_turb,
324  cell_data,
325  s11, s22, s33,
326  s12, s21,
327  s13, s31,
328  s23, s32,
329  er_arr,
330  mf_mx, mf_ux, mf_vx,
331  mf_my, mf_uy, mf_vy,
332  s13_corr, s23_corr, s33_corr);
333  }
334 
335  // Remove halo cells from tau_ii but extend across valid_box bdry
336  bxcc.grow(IntVect(-1,-1,0));
337  if (bxcc.smallEnd(0) == valid_bx.smallEnd(0)) bxcc.growLo(0, 1);
338  if (bxcc.bigEnd(0) == valid_bx.bigEnd(0)) bxcc.growHi(0, 1);
339  if (bxcc.smallEnd(1) == valid_bx.smallEnd(1)) bxcc.growLo(1, 1);
340  if (bxcc.bigEnd(1) == valid_bx.bigEnd(1)) bxcc.growHi(1, 1);
341 
342  // Copy from temp FABs back to tau
343  ParallelFor(bxcc,
344  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
345  tau11(i,j,k) = s11(i,j,k);
346  tau22(i,j,k) = s22(i,j,k);
347  tau33(i,j,k) = s33(i,j,k);
348  if (tau33_corr) tau33_corr(i,j,k) = s33_corr(i,j,k);
349  });
350 
351  ParallelFor(tbxxy, tbxxz, tbxyz,
352  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
353  tau12(i,j,k) = s12(i,j,k);
354  tau21(i,j,k) = s21(i,j,k);
355  },
356  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
357  tau13(i,j,k) = s13(i,j,k);
358  tau31(i,j,k) = s31(i,j,k);
359  if (tau13_corr) tau13_corr(i,j,k) = s13_corr(i,j,k);
360  },
361  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
362  tau23(i,j,k) = s23(i,j,k);
363  tau32(i,j,k) = s32(i,j,k);
364  if (tau23_corr) tau23_corr(i,j,k) = s23_corr(i,j,k);
365  });
366  } // end profile
367 
368  } else if (l_use_terrain_fitted_coords) {
369 
370  // Terrain non-symmetric terms
371  FArrayBox S21,S31,S32;
372  S21.resize(tbxxy,1,The_Async_Arena()); S31.resize(tbxxz,1,The_Async_Arena()); S32.resize(tbxyz,1,The_Async_Arena());
373  Array4<Real> s21 = S21.array(); Array4<Real> s31 = S31.array(); Array4<Real> s32 = S32.array();
374  Array4<Real> tau21 = Tau_lev[TauType::tau21]->array(mfi);
375  Array4<Real> tau31 = Tau_lev[TauType::tau31]->array(mfi);
376  Array4<Real> tau32 = Tau_lev[TauType::tau32]->array(mfi);
377 
378 
379  // *****************************************************************************
380  // Expansion rate compute terrain
381  // *****************************************************************************
382  {
383  BL_PROFILE("slow_rhs_making_er_T");
384  Box gbxo = surroundingNodes(bxcc,2);
385 
386  // We make a temporary container for contravariant velocity Omega here
387  // -- it is only used to compute er_arr below
388  FArrayBox Omega;
389  Omega.resize(gbxo,1,The_Async_Arena());
390 
391  // First create Omega using velocity (not momentum)
392  Array4<Real> omega_arr = Omega.array();
393  ParallelFor(gbxo, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
394  {
395  omega_arr(i,j,k) = (k == 0) ? zero : OmegaFromW(i,j,k,w(i,j,k),u,v,
396  mf_ux,mf_vy,z_nd,dxInv);
397  });
398 
399  ParallelFor(bxcc, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
400  {
401 
402  Real met_u_h_zeta_hi = Compute_h_zeta_AtIface(i+1, j , k, dxInv, z_nd);
403  Real met_u_h_zeta_lo = Compute_h_zeta_AtIface(i , j , k, dxInv, z_nd);
404 
405  Real met_v_h_zeta_hi = Compute_h_zeta_AtJface(i , j+1, k, dxInv, z_nd);
406  Real met_v_h_zeta_lo = Compute_h_zeta_AtJface(i , j , k, dxInv, z_nd);
407 
408  Real Omega_hi = omega_arr(i,j,k+1);
409  Real Omega_lo = omega_arr(i,j,k );
410 
411  Real mfsq = mf_mx(i,j,0)*mf_my(i,j,0);
412 
413  Real expansionRate = (u(i+1,j ,k)/mf_uy(i+1,j,0)*met_u_h_zeta_hi - u(i,j,k)/mf_uy(i,j,0)*met_u_h_zeta_lo)*dxInv[0]*mfsq +
414  (v(i ,j+1,k)/mf_vx(i,j+1,0)*met_v_h_zeta_hi - v(i,j,k)/mf_vx(i,j,0)*met_v_h_zeta_lo)*dxInv[1]*mfsq +
415  (Omega_hi - Omega_lo)*dxInv[2];
416 
417  er_arr(i,j,k) = expansionRate / detJ_arr(i,j,k);
418 
419  // Note:
420  // expansionRate ~ du / (dη/dy) * (dz/dζ) * (1/dξ) * (dξ/dx)*(dη/dy)
421  // + dv / (dξ/dx) * (dz/dζ) * (1/dη) * (dξ/dx)*(dη/dy)
422  // + dΩ/dζ
423  // ~ (du/dx)*(dz/dζ) + (dv/dy)*(dz/dζ) + dΩ/dζ
424  // Dividing by detJ==dz/dζ gives du/dx + dv/dy + dΩ/dz
425  });
426  } // end profile
427 
428  // *****************************************************************************
429  // Strain tensor compute terrain
430  // *****************************************************************************
431  {
432  BL_PROFILE("slow_rhs_making_strain_T");
433  ComputeStrain_T(bxcc, tbxxy, tbxxz, tbxyz, domain,
434  u, v, w,
435  s11, s22, s33,
436  s12, s21,
437  s13, s31,
438  s23, s32,
439  z_nd, detJ_arr, dxInv,
440  mf_mx, mf_ux, mf_vx,
441  mf_my, mf_uy, mf_vy, bc_ptr_h,
442  s13_corr, s23_corr);
443  } // end profile
444 
445  if (SmnSmn_a) {
446  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
447  {
448  SmnSmn_a(i,j,k) = ComputeSmnSmn(i,j,k,
449  s11,s22,s33,
450  s12,s13,s23);
451  });
452  }
453 
454  // *****************************************************************************
455  // Stress tensor compute terrain
456  // *****************************************************************************
457  {
458  BL_PROFILE("slow_rhs_making_stress_T");
459 
460  // Remove Halo cells just for tau_ij comps
461  tbxxy.grow(IntVect(-1,-1,0));
462  tbxxz.grow(IntVect(-1,-1,0));
463  tbxyz.grow(IntVect(-1,-1,0));
464 
465  if (!l_use_turb) {
466  ComputeStressConsVisc_T(bxcc, tbxxy, tbxxz, tbxyz, mu_eff,
467  cell_data,
468  s11, s22, s33,
469  s12, s21,
470  s13, s31,
471  s23, s32,
472  er_arr, z_nd, detJ_arr, dxInv,
473  mf_mx, mf_ux, mf_vx,
474  mf_my, mf_uy, mf_vy,
475  s13_corr, s23_corr, s33_corr);
476  } else {
477  ComputeStressVarVisc_T(bxcc, tbxxy, tbxxz, tbxyz, mu_eff, mu_turb,
478  cell_data,
479  s11, s22, s33,
480  s12, s21,
481  s13, s31,
482  s23, s32,
483  er_arr, z_nd, detJ_arr, dxInv,
484  mf_mx, mf_ux, mf_vx,
485  mf_my, mf_uy, mf_vy,
486  s13_corr, s23_corr, s33_corr);
487  }
488 
489  // Remove halo cells from tau_ii but extend across valid_box bdry
490  bxcc.grow(IntVect(-1,-1,0));
491  if (bxcc.smallEnd(0) == valid_bx.smallEnd(0)) bxcc.growLo(0, 1);
492  if (bxcc.bigEnd(0) == valid_bx.bigEnd(0)) bxcc.growHi(0, 1);
493  if (bxcc.smallEnd(1) == valid_bx.smallEnd(1)) bxcc.growLo(1, 1);
494  if (bxcc.bigEnd(1) == valid_bx.bigEnd(1)) bxcc.growHi(1, 1);
495 
496  // Copy from temp FABs back to tau
497  ParallelFor(bxcc,
498  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
499  tau11(i,j,k) = s11(i,j,k);
500  tau22(i,j,k) = s22(i,j,k);
501  tau33(i,j,k) = s33(i,j,k);
502  if (tau33_corr) tau33_corr(i,j,k) = s33_corr(i,j,k);
503  });
504 
505  ParallelFor(tbxxy, tbxxz, tbxyz,
506  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
507  tau12(i,j,k) = s12(i,j,k);
508  tau21(i,j,k) = s21(i,j,k);
509  },
510  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
511  tau13(i,j,k) = s13(i,j,k);
512  tau31(i,j,k) = s31(i,j,k);
513  if(tau13_corr) tau13_corr(i,j,k) = s13_corr(i,j,k);
514  },
515  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
516  tau23(i,j,k) = s23(i,j,k);
517  tau32(i,j,k) = s32(i,j,k);
518  if(tau23_corr) tau23_corr(i,j,k) = s23_corr(i,j,k);
519  });
520  } // end profile
521 
522  } else {
523 
524  // *****************************************************************************
525  // Expansion rate compute no terrain
526  // *****************************************************************************
527  {
528  BL_PROFILE("slow_rhs_making_er_N");
529  if (solverChoice.terrain_type != TerrainType::EB) {
530  ParallelFor(bxcc, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
531  Real mfsq = mf_mx(i,j,0)*mf_my(i,j,0);
532  er_arr(i,j,k) = (u(i+1, j , k )/mf_uy(i+1,j,0) - u(i, j, k)/mf_uy(i,j,0))*dxInv[0]*mfsq +
533  (v(i , j+1, k )/mf_vx(i,j+1,0) - v(i, j, k)/mf_vx(i,j,0))*dxInv[1]*mfsq +
534  (w(i , j , k+1) - w(i, j, k))*dxInv[2];
535  });
536  } else {
537  ParallelFor(bxcc, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
538  if (cflag(i,j,k).isSingleValued()) {
539  er_arr(i,j,k) = (one/vfrac(i,j,k)) * (
540  dxInv[0] * ( apx(i+1,j,k)*u(i+1,j,k) - apx(i,j,k)*u(i,j,k) )
541  + dxInv[1] * ( apy(i,j+1,k)*v(i,j+1,k) - apy(i,j,k)*v(i,j,k) )
542  + dxInv[2] * ( apz(i,j,k+1)*w(i,j,k+1) - apz(i,j,k)*w(i,j,k) ) );
543  } else if (cflag(i,j,k).isRegular()) {
544  er_arr(i,j,k) = (u(i+1, j , k ) - u(i, j, k))*dxInv[0] +
545  (v(i , j+1, k ) - v(i, j, k))*dxInv[1] +
546  (w(i , j , k+1) - w(i, j, k))*dxInv[2];
547  } else {
548  er_arr(i,j,k) = zero;
549  }
550  });
551  }
552  } // end profile
553 
554  // *****************************************************************************
555  // Strain tensor compute no terrain
556  // *****************************************************************************
557  {
558  BL_PROFILE("slow_rhs_making_strain_N");
559  if (solverChoice.terrain_type != TerrainType::EB) {
560  ComputeStrain_N(bxcc, tbxxy, tbxxz, tbxyz, domain,
561  u, v, w,
562  s11, s22, s33,
563  s12, s13, s23,
564  dxInv,
565  mf_mx, mf_ux, mf_vx,
566  mf_my, mf_uy, mf_vy, bc_ptr_h,
567  s13_corr, s23_corr);
568  } else {
569  ComputeStrain_EB(mfi, bxcc, tbxxy, tbxxz, tbxyz, domain,
570  u, v, w,
571  s11, s22, s33,
572  s12, s13, s23,
573  dxInv,
574  bc_ptr_h,
575  ebfact,
576  s13_corr, s23_corr);
577  }
578  } // end profile
579 
580  if (SmnSmn_a) {
581  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
582  {
583  SmnSmn_a(i,j,k) = ComputeSmnSmn(i,j,k,
584  s11,s22,s33,
585  s12,s13,s23);
586  });
587  }
588 
589  // *****************************************************************************
590  // Stress tensor compute no terrain
591  // *****************************************************************************
592  {
593  BL_PROFILE("slow_rhs_making_stress_N");
594 
595  // Remove Halo cells just for tau_ij comps
596  tbxxy.grow(IntVect(-1,-1,0));
597  tbxxz.grow(IntVect(-1,-1,0));
598  tbxyz.grow(IntVect(-1,-1,0));
599  if (tbxxy.smallEnd(2) > domlo_z) {
600  tbxxy.growLo(2,-1);
601  tbxxz.growLo(2,-1);
602  tbxyz.growLo(2,-1);
603  }
604  if (tbxxy.bigEnd(2) < domhi_z) {
605  tbxxy.growHi(2,-1);
606  tbxxz.growHi(2,-1);
607  tbxyz.growHi(2,-1);
608  }
609 
610  if (!l_use_turb) {
611  if (solverChoice.terrain_type != TerrainType::EB) {
612  ComputeStressConsVisc_N(bxcc, tbxxy, tbxxz, tbxyz, mu_eff,
613  cell_data,
614  s11, s22, s33,
615  s12, s13, s23,
616  er_arr,
617  s13_corr, s23_corr, s33_corr);
618  } else {
619  ComputeStressConsVisc_EB(bxcc, tbxxy, tbxxz, tbxyz, mu_eff,
620  cell_data,
621  s11, s22, s33,
622  s12, s13, s23,
623  er_arr,
624  vfrac,
625  s13_corr, s23_corr, s33_corr);
626  }
627  } else {
628  if (solverChoice.terrain_type != TerrainType::EB) {
629  ComputeStressVarVisc_N(bxcc, tbxxy, tbxxz, tbxyz, mu_eff, mu_turb,
630  cell_data,
631  s11, s22, s33,
632  s12, s13, s23,
633  er_arr,
634  s13_corr, s23_corr, s33_corr);
635  } else {
636  ComputeStressVarVisc_EB(bxcc, tbxxy, tbxxz, tbxyz, mu_eff, mu_turb,
637  cell_data,
638  s11, s22, s33,
639  s12, s13, s23,
640  er_arr,
641  vfrac,
642  s13_corr, s23_corr, s33_corr);
643  }
644  }
645 
646  // Remove halo cells from tau_ii but extend across valid_box bdry
647  bxcc.grow(IntVect(-1,-1,0));
648  if (bxcc.smallEnd(0) == valid_bx.smallEnd(0)) bxcc.growLo(0, 1);
649  if (bxcc.bigEnd(0) == valid_bx.bigEnd(0)) bxcc.growHi(0, 1);
650  if (bxcc.smallEnd(1) == valid_bx.smallEnd(1)) bxcc.growLo(1, 1);
651  if (bxcc.bigEnd(1) == valid_bx.bigEnd(1)) bxcc.growHi(1, 1);
652 
653  // Copy from temp FABs back to tau
654  ParallelFor(bxcc,
655  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
656  tau11(i,j,k) = s11(i,j,k);
657  tau22(i,j,k) = s22(i,j,k);
658  tau33(i,j,k) = s33(i,j,k);
659  if (tau33_corr) tau33_corr(i,j,k) = s33_corr(i,j,k);
660  });
661  ParallelFor(tbxxy, tbxxz, tbxyz,
662  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
663  tau12(i,j,k) = s12(i,j,k);
664  },
665  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
666  tau13(i,j,k) = s13(i,j,k);
667  if (tau13_corr) tau13_corr(i,j,k) = s13_corr(i,j,k);
668  },
669  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
670  tau23(i,j,k) = s23(i,j,k);
671  if (tau23_corr) tau23_corr(i,j,k) = s23_corr(i,j,k);
672  });
673  } // end profile
674  } // no terrain
675  } // MFIter
676  } // l_use_diff
677 }
void ComputeStrain_EB(const MFIter &mfi, Box bxcc, Box tbxxy, Box tbxxz, Box tbxyz, Box domain, const Array4< const Real > &u, const Array4< const Real > &v, const Array4< const Real > &w, Array4< Real > &tau11, Array4< Real > &tau22, Array4< Real > &tau33, Array4< Real > &tau12, Array4< Real > &tau13, Array4< Real > &tau23, const GpuArray< Real, AMREX_SPACEDIM > &dxInv, const BCRec *bc_ptr, const eb_ &ebfact, Array4< Real > &tau13i, Array4< Real > &tau23i)
Definition: ERF_ComputeStrain_EB.cpp:28
void ComputeStrain_N(Box bxcc, Box tbxxy, Box tbxxz, Box tbxyz, Box domain, const Array4< const Real > &u, const Array4< const Real > &v, const Array4< const Real > &w, Array4< Real > &tau11, Array4< Real > &tau22, Array4< Real > &tau33, Array4< Real > &tau12, Array4< Real > &tau13, Array4< Real > &tau23, const GpuArray< Real, AMREX_SPACEDIM > &dxInv, const Array4< const Real > &mf_mx, const Array4< const Real > &mf_ux, const Array4< const Real > &mf_vx, const Array4< const Real > &mf_my, const Array4< const Real > &mf_uy, const Array4< const Real > &mf_vy, const BCRec *bc_ptr, Array4< Real > &tau13i, Array4< Real > &tau23i)
Definition: ERF_ComputeStrain_N.cpp:31
void ComputeStrain_S(Box bxcc, Box tbxxy, Box tbxxz, Box tbxyz, Box domain, const Array4< const Real > &u, const Array4< const Real > &v, const Array4< const Real > &w, Array4< Real > &tau11, Array4< Real > &tau22, Array4< Real > &tau33, Array4< Real > &tau12, Array4< Real > &tau21, Array4< Real > &tau13, Array4< Real > &tau31, Array4< Real > &tau23, Array4< Real > &tau32, const Gpu::DeviceVector< Real > &stretched_dz_d, const GpuArray< Real, AMREX_SPACEDIM > &dxInv, const Array4< const Real > &mf_mx, const Array4< const Real > &mf_ux, const Array4< const Real > &mf_vx, const Array4< const Real > &mf_my, const Array4< const Real > &mf_uy, const Array4< const Real > &mf_vy, const BCRec *bc_ptr, Array4< Real > &tau13i, Array4< Real > &tau23i)
Definition: ERF_ComputeStrain_S.cpp:39
void ComputeStrain_T(Box bxcc, Box tbxxy, Box tbxxz, Box tbxyz, Box domain, const Array4< const Real > &u, const Array4< const Real > &v, const Array4< const Real > &w, Array4< Real > &tau11, Array4< Real > &tau22, Array4< Real > &tau33, Array4< Real > &tau12, Array4< Real > &tau21, Array4< Real > &tau13, Array4< Real > &tau31, Array4< Real > &tau23, Array4< Real > &tau32, const Array4< const Real > &z_nd, const Array4< const Real > &detJ, const GpuArray< Real, AMREX_SPACEDIM > &dxInv, const Array4< const Real > &mf_mx, const Array4< const Real > &mf_ux, const Array4< const Real > &mf_vx, const Array4< const Real > &mf_my, const Array4< const Real > &mf_uy, const Array4< const Real > &mf_vy, const BCRec *bc_ptr, Array4< Real > &tau13i, Array4< Real > &tau23i)
Definition: ERF_ComputeStrain_T.cpp:39
void ComputeStressConsVisc_EB(Box bxcc, Box tbxxy, Box tbxxz, Box tbxyz, Real mu_eff, const Array4< const Real > &cell_data, Array4< Real > &tau11, Array4< Real > &tau22, Array4< Real > &tau33, Array4< Real > &tau12, Array4< Real > &tau13, Array4< Real > &tau23, const Array4< const Real > &er_arr, Array4< const Real > &vfrac, Array4< Real > &tau13i, Array4< Real > &tau23i, Array4< Real > &tau33i)
Definition: ERF_ComputeStress_EB.cpp:26
void ComputeStressVarVisc_EB(Box bxcc, Box tbxxy, Box tbxxz, Box tbxyz, Real mu_eff, const Array4< const Real > &mu_turb, const Array4< const Real > &cell_data, Array4< Real > &tau11, Array4< Real > &tau22, Array4< Real > &tau33, Array4< Real > &tau12, Array4< Real > &tau13, Array4< Real > &tau23, const Array4< const Real > &er_arr, Array4< const Real > &vfrac, Array4< Real > &tau13i, Array4< Real > &tau23i, Array4< Real > &tau33i)
Definition: ERF_ComputeStress_EB.cpp:157
void ComputeStressConsVisc_N(Box bxcc, Box tbxxy, Box tbxxz, Box tbxyz, Real mu_eff, const Array4< const Real > &cell_data, Array4< Real > &tau11, Array4< Real > &tau22, Array4< Real > &tau33, Array4< Real > &tau12, Array4< Real > &tau13, Array4< Real > &tau23, const Array4< const Real > &er_arr, Array4< Real > &tau13i, Array4< Real > &tau23i, Array4< Real > &tau33i)
Definition: ERF_ComputeStress_N.cpp:26
void ComputeStressVarVisc_N(Box bxcc, Box tbxxy, Box tbxxz, Box tbxyz, Real mu_eff, const Array4< const Real > &mu_turb, const Array4< const Real > &cell_data, Array4< Real > &tau11, Array4< Real > &tau22, Array4< Real > &tau33, Array4< Real > &tau12, Array4< Real > &tau13, Array4< Real > &tau23, const Array4< const Real > &er_arr, Array4< Real > &tau13i, Array4< Real > &tau23i, Array4< Real > &tau33i)
Definition: ERF_ComputeStress_N.cpp:126
void ComputeStressVarVisc_S(Box bxcc, Box tbxxy, Box tbxxz, Box tbxyz, Real mu_eff, const Array4< const Real > &mu_turb, const Array4< const Real > &cell_data, Array4< Real > &tau11, Array4< Real > &tau22, Array4< Real > &tau33, Array4< Real > &tau12, Array4< Real > &tau21, Array4< Real > &tau13, Array4< Real > &tau31, Array4< Real > &tau23, Array4< Real > &tau32, const Array4< const Real > &er_arr, const Array4< const Real > &mf_mx, const Array4< const Real > &mf_ux, const Array4< const Real > &mf_vx, const Array4< const Real > &mf_my, const Array4< const Real > &mf_uy, const Array4< const Real > &mf_vy, Array4< Real > &tau13i, Array4< Real > &tau23i, Array4< Real > &tau33i)
Definition: ERF_ComputeStress_S.cpp:162
void ComputeStressConsVisc_S(Box bxcc, Box tbxxy, Box tbxxz, Box tbxyz, Real mu_eff, const Array4< const Real > &cell_data, Array4< Real > &tau11, Array4< Real > &tau22, Array4< Real > &tau33, Array4< Real > &tau12, Array4< Real > &tau21, Array4< Real > &tau13, Array4< Real > &tau31, Array4< Real > &tau23, Array4< Real > &tau32, const Array4< const Real > &er_arr, const Array4< const Real > &mf_mx, const Array4< const Real > &mf_ux, const Array4< const Real > &mf_vx, const Array4< const Real > &mf_my, const Array4< const Real > &mf_uy, const Array4< const Real > &mf_vy, Array4< Real > &tau13i, Array4< Real > &tau23i, Array4< Real > &tau33i)
Definition: ERF_ComputeStress_S.cpp:32
void ComputeStressVarVisc_T(Box bxcc, Box tbxxy, Box tbxxz, Box tbxyz, Real mu_eff, const Array4< const Real > &mu_turb, const Array4< const Real > &cell_data, Array4< Real > &tau11, Array4< Real > &tau22, Array4< Real > &tau33, Array4< Real > &tau12, Array4< Real > &tau21, Array4< Real > &tau13, Array4< Real > &tau31, Array4< Real > &tau23, Array4< Real > &tau32, const Array4< const Real > &er_arr, const Array4< const Real > &z_nd, const Array4< const Real > &detJ, const GpuArray< Real, AMREX_SPACEDIM > &dxInv, const Array4< const Real > &mf_mx, const Array4< const Real > &mf_ux, const Array4< const Real > &mf_vx, const Array4< const Real > &mf_my, const Array4< const Real > &mf_uy, const Array4< const Real > &mf_vy, Array4< Real > &tau13i, Array4< Real > &tau23i, Array4< Real > &tau33i)
Definition: ERF_ComputeStress_T.cpp:363
void ComputeStressConsVisc_T(Box bxcc, Box tbxxy, Box tbxxz, Box tbxyz, Real mu_eff, const Array4< const Real > &cell_data, Array4< Real > &tau11, Array4< Real > &tau22, Array4< Real > &tau33, Array4< Real > &tau12, Array4< Real > &tau21, Array4< Real > &tau13, Array4< Real > &tau31, Array4< Real > &tau23, Array4< Real > &tau32, const Array4< const Real > &er_arr, const Array4< const Real > &z_nd, const Array4< const Real > &detJ, const GpuArray< Real, AMREX_SPACEDIM > &dxInv, const Array4< const Real > &mf_mx, const Array4< const Real > &mf_ux, const Array4< const Real > &mf_vx, const Array4< const Real > &mf_my, const Array4< const Real > &mf_uy, const Array4< const Real > &mf_vy, Array4< Real > &tau13i, Array4< Real > &tau23i, Array4< Real > &tau33i)
Definition: ERF_ComputeStress_T.cpp:32
constexpr amrex::Real two
Definition: ERF_Constants.H:10
constexpr amrex::Real one
Definition: ERF_Constants.H:9
constexpr amrex::Real zero
Definition: ERF_Constants.H:8
@ tau12
Definition: ERF_DataStruct.H:32
@ tau33
Definition: ERF_DataStruct.H:32
@ tau22
Definition: ERF_DataStruct.H:32
@ tau32
Definition: ERF_DataStruct.H:32
@ tau31
Definition: ERF_DataStruct.H:32
@ tau21
Definition: ERF_DataStruct.H:32
@ v_x
Definition: ERF_DataStruct.H:24
@ u_y
Definition: ERF_DataStruct.H:25
@ v_y
Definition: ERF_DataStruct.H:25
@ m_y
Definition: ERF_DataStruct.H:25
@ u_x
Definition: ERF_DataStruct.H:24
@ m_x
Definition: ERF_DataStruct.H:24
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real ComputeSmnSmn(int &i, int &j, int &k, const amrex::Array4< amrex::Real const > &tau11, const amrex::Array4< amrex::Real const > &tau22, const amrex::Array4< amrex::Real const > &tau33, const amrex::Array4< amrex::Real const > &tau12, const amrex::Array4< amrex::Real const > &tau13, const amrex::Array4< amrex::Real const > &tau23)
Definition: ERF_EddyViscosity.H:85
amrex::GpuArray< Real, AMREX_SPACEDIM > dxInv
Definition: ERF_InitCustomPertVels_ParticleTests.H:17
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
Real w
Definition: ERF_Plotfile2DInterpolator.cpp:19
amrex::Real Real
Definition: ERF_ShocInterface.H:19
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real OmegaFromW(int &i, int &j, int &k, amrex::Real w, const amrex::Array4< const amrex::Real > &u_arr, const amrex::Array4< const amrex::Real > &v_arr, const amrex::Array4< const amrex::Real > &mf_u, const amrex::Array4< const amrex::Real > &mf_v, const amrex::Array4< const amrex::Real > &z_nd, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dxInv)
Definition: ERF_TerrainMetrics.H:414
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtIface(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:104
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtJface(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:144
const std::unique_ptr< amrex::EBFArrayBoxFactory > & get_const_factory() const noexcept
Definition: ERF_EB.H:46
@ cons
Definition: ERF_IndexDefines.H:193
@ xvel
Definition: ERF_IndexDefines.H:176
@ zvel
Definition: ERF_IndexDefines.H:178
@ yvel
Definition: ERF_IndexDefines.H:177
Definition: ERF_DiffStruct.H:19
amrex::Real rho0_trans
Definition: ERF_DiffStruct.H:91
MolecDiffType molec_diff_type
Definition: ERF_DiffStruct.H:84
amrex::Real dynamic_viscosity
Definition: ERF_DiffStruct.H:96
static MeshType mesh_type
Definition: ERF_DataStruct.H:1239
DiffChoice diffChoice
Definition: ERF_DataStruct.H:1248
amrex::Vector< TurbChoice > turbChoice
Definition: ERF_DataStruct.H:1251
static TerrainType terrain_type
Definition: ERF_DataStruct.H:1230
bool implicit_momentum_diffusion
Definition: ERF_DataStruct.H:1280
amrex::Vector< amrex::Vector< amrex::Real > > vert_implicit_fac
Definition: ERF_DataStruct.H:1274
Definition: ERF_TurbStruct.H:82
PBLType pbl_type
Definition: ERF_TurbStruct.H:541
RANSType rans_type
Definition: ERF_TurbStruct.H:536
LESType les_type
Definition: ERF_TurbStruct.H:494
bool use_kturb
Definition: ERF_TurbStruct.H:577

Referenced by erf_slow_rhs_pre().

Here is the call graph for this function:
Here is the caller graph for this function: