ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_DiffusionSrcForState_N.cpp File Reference
#include <ERF_Diffusion.H>
#include <ERF_EddyViscosity.H>
#include <ERF_PBLModels.H>
Include dependency graph for ERF_DiffusionSrcForState_N.cpp:

Functions

void DiffusionSrcForState_N (const Box &bx, const Box &domain, int start_comp, int num_comp, const bool &exp_most, const Array4< const Real > &u, const Array4< const Real > &v, const Array4< const Real > &cell_data, const Array4< const Real > &cell_prim, const Array4< Real > &cell_rhs, const Array4< Real > &xflux, const Array4< Real > &yflux, const Array4< Real > &zflux, const GpuArray< Real, AMREX_SPACEDIM > &cellSizeInv, const Array4< const Real > &SmnSmn_a, const Array4< const Real > &mf_m, const Array4< const Real > &mf_u, const Array4< const Real > &mf_v, Array4< Real > &hfx_z, Array4< Real > &qfx1_z, Array4< Real > &qfx2_z, Array4< Real > &diss, const Array4< const Real > &mu_turb, const SolverChoice &solverChoice, const int level, const Array4< const Real > &tm_arr, const GpuArray< Real, AMREX_SPACEDIM > grav_gpu, const BCRec *bc_ptr, const bool use_most)
 

Function Documentation

◆ DiffusionSrcForState_N()

void DiffusionSrcForState_N ( const Box &  bx,
const Box &  domain,
int  start_comp,
int  num_comp,
const bool &  exp_most,
const Array4< const Real > &  u,
const Array4< const Real > &  v,
const Array4< const Real > &  cell_data,
const Array4< const Real > &  cell_prim,
const Array4< Real > &  cell_rhs,
const Array4< Real > &  xflux,
const Array4< Real > &  yflux,
const Array4< Real > &  zflux,
const GpuArray< Real, AMREX_SPACEDIM > &  cellSizeInv,
const Array4< const Real > &  SmnSmn_a,
const Array4< const Real > &  mf_m,
const Array4< const Real > &  mf_u,
const Array4< const Real > &  mf_v,
Array4< Real > &  hfx_z,
Array4< Real > &  qfx1_z,
Array4< Real > &  qfx2_z,
Array4< Real > &  diss,
const Array4< const Real > &  mu_turb,
const SolverChoice solverChoice,
const int  level,
const Array4< const Real > &  tm_arr,
const GpuArray< Real, AMREX_SPACEDIM >  grav_gpu,
const BCRec *  bc_ptr,
const bool  use_most 
)

Function for computing the scalar RHS for diffusion operator without terrain.

Parameters
[in]bxcell center box to loop over
[in]domainbox of the whole domain
[in]start_compstarting component index
[in]num_compnumber of components
[in]uvelocity in x-dir
[in]vvelocity in y-dir
[in]cell_dataconserved cell center vars
[in]cell_primprimitive cell center vars
[out]cell_rhsRHS for cell center vars
[in]xfluxflux in x-dir
[in]yfluxflux in y-dir
[in]zfluxflux in z-dir
[in]cellSizeInvinverse cell size array
[in]SmnSmn_astrain rate magnitude
[in]mf_mmap factor at cell center
[in]mf_umap factor at x-face
[in]mf_vmap factor at y-face
[in,out]hfx_zheat flux in z-dir
[in,out]qfx1_zheat flux in z-dir
[out]qfx2_zheat flux in z-dir
[in]dissdissipation of TKE
[in]mu_turbturbulent viscosity
[in]diffChoicecontainer of diffusion parameters
[in]turbChoicecontainer of turbulence parameters
[in]tm_arrtheta mean array
[in]grav_gpugravity vector
[in]bc_ptrcontainer with boundary conditions
[in]use_mostwhether we have turned on MOST BCs
67 {
68  BL_PROFILE_VAR("DiffusionSrcForState_N()",DiffusionSrcForState_N);
69 
70  DiffChoice diffChoice = solverChoice.diffChoice;
71  TurbChoice turbChoice = solverChoice.turbChoice[level];
72 
73  amrex::ignore_unused(use_most);
74 
75  const Real dx_inv = cellSizeInv[0];
76  const Real dy_inv = cellSizeInv[1];
77  const Real dz_inv = cellSizeInv[2];
78 
79  const auto& dom_lo = lbound(domain);
80  const auto& dom_hi = ubound(domain);
81 
82  Real l_inv_theta0 = 1.0 / turbChoice.theta_ref;
83  Real l_abs_g = std::abs(grav_gpu[2]);
84 
85  bool l_use_keqn = ( (turbChoice.les_type == LESType::Deardorff) ||
86  (turbChoice.rans_type == RANSType::kEqn) );
87  bool l_use_mynn = (turbChoice.pbl_type == PBLType::MYNN25);
88 
89  bool l_consA = (diffChoice.molec_diff_type == MolecDiffType::ConstantAlpha);
90  bool l_turb = ( (turbChoice.les_type == LESType::Smagorinsky) ||
91  (turbChoice.les_type == LESType::Deardorff ) ||
92  (turbChoice.rans_type == RANSType::kEqn ) ||
93  (turbChoice.pbl_type == PBLType::MYNN25 ) ||
94  (turbChoice.pbl_type == PBLType::YSU ) );
95 
96  const Box xbx = surroundingNodes(bx,0);
97  const Box ybx = surroundingNodes(bx,1);
98  const Box zbx = surroundingNodes(bx,2);
99 
100  const int end_comp = start_comp + num_comp - 1;
101 
102  // Theta, KE, Scalar
103  Vector<Real> alpha_eff(NPRIMVAR_max, 0.0);
104  if (l_consA) {
105  for (int i = 0; i < NPRIMVAR_max; ++i) {
106  switch (i) {
107  case PrimTheta_comp:
108  alpha_eff[PrimTheta_comp] = diffChoice.alpha_T;
109  break;
110  case PrimScalar_comp:
111  alpha_eff[PrimScalar_comp] = diffChoice.alpha_C;
112  break;
113  case PrimQ1_comp:
114  alpha_eff[PrimQ1_comp] = diffChoice.alpha_C;
115  break;
116  case PrimQ2_comp:
117  alpha_eff[PrimQ2_comp] = diffChoice.alpha_C;
118  break;
119  case PrimQ3_comp:
120  alpha_eff[PrimQ3_comp] = diffChoice.alpha_C;
121  break;
122  case PrimQ4_comp:
123  alpha_eff[PrimQ4_comp] = diffChoice.alpha_C;
124  break;
125  case PrimQ5_comp:
126  alpha_eff[PrimQ5_comp] = diffChoice.alpha_C;
127  break;
128  case PrimQ6_comp:
129  alpha_eff[PrimQ6_comp] = diffChoice.alpha_C;
130  break;
131  default:
132  alpha_eff[i] = 0.0;
133  break;
134  }
135  }
136  } else {
137  for (int i = 0; i < NPRIMVAR_max; ++i) {
138  switch (i) {
139  case PrimTheta_comp:
140  alpha_eff[PrimTheta_comp] = diffChoice.rhoAlpha_T;
141  break;
142  case PrimScalar_comp:
143  alpha_eff[PrimScalar_comp] = diffChoice.rhoAlpha_C;
144  break;
145  case PrimQ1_comp:
146  alpha_eff[PrimQ1_comp] = diffChoice.rhoAlpha_C;
147  break;
148  case PrimQ2_comp:
149  alpha_eff[PrimQ2_comp] = diffChoice.rhoAlpha_C;
150  break;
151  case PrimQ3_comp:
152  alpha_eff[PrimQ3_comp] = diffChoice.rhoAlpha_C;
153  break;
154  case PrimQ4_comp:
155  alpha_eff[PrimQ4_comp] = diffChoice.rhoAlpha_C;
156  break;
157  case PrimQ5_comp:
158  alpha_eff[PrimQ5_comp] = diffChoice.rhoAlpha_C;
159  break;
160  case PrimQ6_comp:
161  alpha_eff[PrimQ6_comp] = diffChoice.rhoAlpha_C;
162  break;
163  default:
164  alpha_eff[i] = 0.0;
165  break;
166  }
167  }
168  }
169 
170  Vector<int> eddy_diff_idx{EddyDiff::Theta_h, EddyDiff::KE_h, EddyDiff::Scalar_h,
173  Vector<int> eddy_diff_idy{EddyDiff::Theta_h, EddyDiff::KE_h, EddyDiff::Scalar_h,
176  Vector<int> eddy_diff_idz{EddyDiff::Theta_v, EddyDiff::KE_v, EddyDiff::Scalar_v,
179 
180  // Device vectors
181  Gpu::AsyncVector<Real> alpha_eff_d;
182  Gpu::AsyncVector<int> eddy_diff_idx_d,eddy_diff_idy_d,eddy_diff_idz_d;
183  alpha_eff_d.resize(alpha_eff.size());
184  eddy_diff_idx_d.resize(eddy_diff_idx.size());
185  eddy_diff_idy_d.resize(eddy_diff_idy.size());
186  eddy_diff_idz_d.resize(eddy_diff_idz.size());
187 
188  Gpu::copy(Gpu::hostToDevice, alpha_eff.begin() , alpha_eff.end() , alpha_eff_d.begin());
189  Gpu::copy(Gpu::hostToDevice, eddy_diff_idx.begin(), eddy_diff_idx.end(), eddy_diff_idx_d.begin());
190  Gpu::copy(Gpu::hostToDevice, eddy_diff_idy.begin(), eddy_diff_idy.end(), eddy_diff_idy_d.begin());
191  Gpu::copy(Gpu::hostToDevice, eddy_diff_idz.begin(), eddy_diff_idz.end(), eddy_diff_idz_d.begin());
192 
193  // Capture pointers for device code
194  Real* d_alpha_eff = alpha_eff_d.data();
195  int* d_eddy_diff_idx = eddy_diff_idx_d.data();
196  int* d_eddy_diff_idy = eddy_diff_idy_d.data();
197  int* d_eddy_diff_idz = eddy_diff_idz_d.data();
198 
199  // Compute fluxes at each face
200  if (l_consA && l_turb) {
201  ParallelFor(xbx, num_comp,[=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
202  {
203  const int qty_index = start_comp + n;
204  const int prim_index = qty_index - 1;
205  // const int prim_scal_index = (qty_index >= RhoScalar_comp && qty_index < RhoScalar_comp+NSCALARS) ? PrimScalar_comp : prim_index;
206  const int prim_scal_index = prim_index;
207 
208  int bc_comp = (qty_index >= RhoScalar_comp && qty_index < RhoScalar_comp+NSCALARS) ?
209  BCVars::RhoScalar_bc_comp : qty_index;
210  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
211  bool ext_dir_on_xlo = ( ((bc_ptr[bc_comp].lo(0) == ERFBCType::ext_dir) ||
212  (bc_ptr[bc_comp].lo(0) == ERFBCType::ext_dir_prim))
213  && i == dom_lo.x);
214  bool ext_dir_on_xhi = ( ((bc_ptr[bc_comp].hi(0) == ERFBCType::ext_dir) ||
215  (bc_ptr[bc_comp].hi(0) == ERFBCType::ext_dir_prim))
216  && i == dom_hi.x+1);
217 
218  Real rhoFace = 0.5 * ( cell_data(i, j, k, Rho_comp) + cell_data(i-1, j, k, Rho_comp) );
219  Real rhoAlpha = rhoFace * d_alpha_eff[prim_scal_index];
220  rhoAlpha += 0.5 * ( mu_turb(i , j, k, d_eddy_diff_idx[prim_scal_index])
221  + mu_turb(i-1, j, k, d_eddy_diff_idx[prim_scal_index]) );
222 
223  if (ext_dir_on_xlo) {
224  xflux(i,j,k,qty_index) = -rhoAlpha * ( -(8./3.) * cell_prim(i-1, j, k, prim_index)
225  + 3. * cell_prim(i , j, k, prim_index)
226  - (1./3.) * cell_prim(i+1, j, k, prim_index) ) * dx_inv;
227  } else if (ext_dir_on_xhi) {
228  xflux(i,j,k,qty_index) = -rhoAlpha * ( (8./3.) * cell_prim(i , j, k, prim_index)
229  - 3. * cell_prim(i-1, j, k, prim_index)
230  + (1./3.) * cell_prim(i-2, j, k, prim_index) ) * dx_inv;
231  } else {
232  xflux(i,j,k,qty_index) = -rhoAlpha * (cell_prim(i, j, k, prim_index) -
233  cell_prim(i-1, j, k, prim_index)) * dx_inv * mf_u(i,j,0);
234  }
235  });
236  ParallelFor(ybx, num_comp,[=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
237  {
238  const int qty_index = start_comp + n;
239  const int prim_index = qty_index - 1;
240  // const int prim_scal_index = (qty_index >= RhoScalar_comp && qty_index < RhoScalar_comp+NSCALARS) ? PrimScalar_comp : prim_index;
241  const int prim_scal_index = prim_index;
242 
243  int bc_comp = (qty_index >= RhoScalar_comp && qty_index < RhoScalar_comp+NSCALARS) ?
244  BCVars::RhoScalar_bc_comp : qty_index;
245  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
246  bool ext_dir_on_ylo = ( ((bc_ptr[bc_comp].lo(1) == ERFBCType::ext_dir) ||
247  (bc_ptr[bc_comp].lo(1) == ERFBCType::ext_dir_prim))
248  && j == dom_lo.y);
249  bool ext_dir_on_yhi = ( ((bc_ptr[bc_comp].hi(1) == ERFBCType::ext_dir) ||
250  (bc_ptr[bc_comp].hi(1) == ERFBCType::ext_dir_prim))
251  && j == dom_hi.y+1);
252 
253  Real rhoFace = 0.5 * ( cell_data(i, j, k, Rho_comp) + cell_data(i, j-1, k, Rho_comp) );
254  Real rhoAlpha = rhoFace * d_alpha_eff[prim_scal_index];
255  rhoAlpha += 0.5 * ( mu_turb(i, j , k, d_eddy_diff_idy[prim_scal_index])
256  + mu_turb(i, j-1, k, d_eddy_diff_idy[prim_scal_index]) );
257 
258  if (ext_dir_on_ylo) {
259  yflux(i,j,k,qty_index) = -rhoAlpha * ( -(8./3.) * cell_prim(i, j-1, k, prim_index)
260  + 3. * cell_prim(i, j , k, prim_index)
261  - (1./3.) * cell_prim(i, j+1, k, prim_index) ) * dy_inv;
262  } else if (ext_dir_on_yhi) {
263  yflux(i,j,k,qty_index) = -rhoAlpha * ( (8./3.) * cell_prim(i, j , k, prim_index)
264  - 3. * cell_prim(i, j-1, k, prim_index)
265  + (1./3.) * cell_prim(i, j-2, k, prim_index) ) * dy_inv;
266  } else {
267  yflux(i,j,k,qty_index) = -rhoAlpha * (cell_prim(i, j, k, prim_index) - cell_prim(i, j-1, k, prim_index)) * dy_inv * mf_v(i,j,0);
268  }
269  });
270  ParallelFor(zbx, num_comp,[=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
271  {
272  const int qty_index = start_comp + n;
273  const int prim_index = qty_index - 1;
274  // const int prim_scal_index = (qty_index >= RhoScalar_comp && qty_index < RhoScalar_comp+NSCALARS) ? PrimScalar_comp : prim_index;
275  const int prim_scal_index = prim_index;
276 
277  Real rhoFace = 0.5 * ( cell_data(i, j, k, Rho_comp) + cell_data(i, j, k-1, Rho_comp) );
278  Real rhoAlpha = rhoFace * d_alpha_eff[prim_scal_index];
279  rhoAlpha += 0.5 * ( mu_turb(i, j, k , d_eddy_diff_idz[prim_scal_index])
280  + mu_turb(i, j, k-1, d_eddy_diff_idz[prim_scal_index]) );
281 
282  int bc_comp = (qty_index >= RhoScalar_comp && qty_index < RhoScalar_comp+NSCALARS) ?
283  BCVars::RhoScalar_bc_comp : qty_index;
284  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
285  bool ext_dir_on_zlo = ( ((bc_ptr[bc_comp].lo(2) == ERFBCType::ext_dir) ||
286  (bc_ptr[bc_comp].lo(2) == ERFBCType::ext_dir_prim))
287  && k == dom_lo.z);
288  bool ext_dir_on_zhi = ( ((bc_ptr[bc_comp].hi(2) == ERFBCType::ext_dir) ||
289  (bc_ptr[bc_comp].hi(2) == ERFBCType::ext_dir_prim))
290  && k == dom_hi.z+1);
291  bool most_on_zlo = ( use_most && exp_most &&
292  (bc_ptr[BCVars::cons_bc+qty_index].lo(2) == ERFBCType::foextrap) &&
293  k == dom_lo.z);
294 
295  if (ext_dir_on_zlo) {
296  zflux(i,j,k,qty_index) = -rhoAlpha * ( -(8./3.) * cell_prim(i, j, k-1, prim_index)
297  + 3. * cell_prim(i, j, k , prim_index)
298  - (1./3.) * cell_prim(i, j, k+1, prim_index) ) * dz_inv;
299  } else if (ext_dir_on_zhi) {
300  zflux(i,j,k,qty_index) = -rhoAlpha * ( (8./3.) * cell_prim(i, j, k , prim_index)
301  - 3. * cell_prim(i, j, k-1, prim_index)
302  + (1./3.) * cell_prim(i, j, k-2, prim_index) ) * dz_inv;
303  } else if (most_on_zlo && (qty_index == RhoTheta_comp)) {
304  zflux(i,j,k,qty_index) = hfx_z(i,j,0);
305  } else if (most_on_zlo && (qty_index == RhoQ1_comp)) {
306  zflux(i,j,k,qty_index) = qfx1_z(i,j,0);
307  } else {
308  zflux(i,j,k,qty_index) = -rhoAlpha * (cell_prim(i, j, k, prim_index) - cell_prim(i, j, k-1, prim_index)) * dz_inv;
309  }
310 
311  if (qty_index == RhoTheta_comp) {
312  if (!most_on_zlo) {
313  hfx_z(i,j,k) = zflux(i,j,k,qty_index);
314  }
315  } else if (qty_index == RhoQ1_comp) {
316  if (!most_on_zlo) {
317  qfx1_z(i,j,k) = zflux(i,j,k,qty_index);
318  }
319  } else if (qty_index == RhoQ2_comp) {
320  qfx2_z(i,j,k) = zflux(i,j,k,qty_index);
321  }
322  });
323  } else if (l_turb) {
324  // with MolecDiffType::Constant or None
325  ParallelFor(xbx, num_comp,[=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
326  {
327  const int qty_index = start_comp + n;
328  const int prim_index = qty_index - 1;
329 
330  int bc_comp = (qty_index >= RhoScalar_comp && qty_index < RhoScalar_comp+NSCALARS) ?
331  BCVars::RhoScalar_bc_comp : qty_index;
332  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
333  bool ext_dir_on_xlo = ( ((bc_ptr[bc_comp].lo(0) == ERFBCType::ext_dir) ||
334  (bc_ptr[bc_comp].lo(0) == ERFBCType::ext_dir_prim))
335  && i == dom_lo.x);
336  bool ext_dir_on_xhi = ( ((bc_ptr[bc_comp].hi(0) == ERFBCType::ext_dir) ||
337  (bc_ptr[bc_comp].hi(0) == ERFBCType::ext_dir_prim))
338  && i == dom_hi.x+1);
339 
340  Real rhoAlpha = d_alpha_eff[prim_index];
341  rhoAlpha += 0.5 * ( mu_turb(i , j, k, d_eddy_diff_idx[prim_index])
342  + mu_turb(i-1, j, k, d_eddy_diff_idx[prim_index]) );
343 
344  if (ext_dir_on_xlo) {
345  xflux(i,j,k,qty_index) = -rhoAlpha * ( -(8./3.) * cell_prim(i-1, j, k, prim_index)
346  + 3. * cell_prim(i , j, k, prim_index)
347  - (1./3.) * cell_prim(i+1, j, k, prim_index) ) * dx_inv;
348  } else if (ext_dir_on_xhi) {
349  xflux(i,j,k,qty_index) = -rhoAlpha * ( (8./3.) * cell_prim(i , j, k, prim_index)
350  - 3. * cell_prim(i-1, j, k, prim_index)
351  + (1./3.) * cell_prim(i-2, j, k, prim_index) ) * dx_inv;
352  } else {
353  xflux(i,j,k,qty_index) = -rhoAlpha * (cell_prim(i, j, k, prim_index) - cell_prim(i-1, j, k, prim_index)) * dx_inv * mf_u(i,j,0);
354  }
355  });
356  ParallelFor(ybx, num_comp,[=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
357  {
358  const int qty_index = start_comp + n;
359  const int prim_index = qty_index - 1;
360 
361  int bc_comp = (qty_index >= RhoScalar_comp && qty_index < RhoScalar_comp+NSCALARS) ?
362  BCVars::RhoScalar_bc_comp : qty_index;
363  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
364  bool ext_dir_on_ylo = ( ((bc_ptr[bc_comp].lo(1) == ERFBCType::ext_dir) ||
365  (bc_ptr[bc_comp].lo(1) == ERFBCType::ext_dir_prim))
366  && j == dom_lo.y);
367  bool ext_dir_on_yhi = ( ((bc_ptr[bc_comp].hi(1) == ERFBCType::ext_dir) ||
368  (bc_ptr[bc_comp].hi(1) == ERFBCType::ext_dir_prim))
369  && j == dom_hi.y+1);
370 
371  Real rhoAlpha = d_alpha_eff[prim_index];
372  rhoAlpha += 0.5 * ( mu_turb(i, j , k, d_eddy_diff_idy[prim_index])
373  + mu_turb(i, j-1, k, d_eddy_diff_idy[prim_index]) );
374 
375  if (ext_dir_on_ylo) {
376  yflux(i,j,k,qty_index) = -rhoAlpha * ( -(8./3.) * cell_prim(i, j-1, k, prim_index)
377  + 3. * cell_prim(i, j , k, prim_index)
378  - (1./3.) * cell_prim(i, j+1, k, prim_index) ) * dy_inv;
379  } else if (ext_dir_on_yhi) {
380  yflux(i,j,k,qty_index) = -rhoAlpha * ( (8./3.) * cell_prim(i, j , k, prim_index)
381  - 3. * cell_prim(i, j-1, k, prim_index)
382  + (1./3.) * cell_prim(i, j-2, k, prim_index) ) * dy_inv;
383  } else {
384  yflux(i,j,k,qty_index) = -rhoAlpha * (cell_prim(i, j, k, prim_index) - cell_prim(i, j-1, k, prim_index)) * dy_inv * mf_v(i,j,0);
385  }
386  });
387  ParallelFor(zbx, num_comp,[=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
388  {
389  const int qty_index = start_comp + n;
390  const int prim_index = qty_index - 1;
391 
392  Real rhoAlpha = d_alpha_eff[prim_index];
393  rhoAlpha += 0.5 * ( mu_turb(i, j, k , d_eddy_diff_idz[prim_index])
394  + mu_turb(i, j, k-1, d_eddy_diff_idz[prim_index]) );
395 
396  int bc_comp = (qty_index >= RhoScalar_comp && qty_index < RhoScalar_comp+NSCALARS) ?
397  BCVars::RhoScalar_bc_comp : qty_index;
398  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
399  bool ext_dir_on_zlo = ( ((bc_ptr[bc_comp].lo(2) == ERFBCType::ext_dir) ||
400  (bc_ptr[bc_comp].lo(2) == ERFBCType::ext_dir_prim))
401  && k == dom_lo.z);
402  bool ext_dir_on_zhi = ( ((bc_ptr[bc_comp].hi(2) == ERFBCType::ext_dir) ||
403  (bc_ptr[bc_comp].hi(2) == ERFBCType::ext_dir_prim))
404  && k == dom_hi.z+1);
405  bool most_on_zlo = ( use_most && exp_most &&
406  (bc_ptr[bc_comp].lo(2) == ERFBCType::foextrap) &&
407  k == dom_lo.z);
408 
409  if (ext_dir_on_zlo) {
410  zflux(i,j,k,qty_index) = -rhoAlpha * ( -(8./3.) * cell_prim(i, j, k-1, prim_index)
411  + 3. * cell_prim(i, j, k , prim_index)
412  - (1./3.) * cell_prim(i, j, k+1, prim_index) ) * dz_inv;
413  } else if (ext_dir_on_zhi) {
414  zflux(i,j,k,qty_index) = -rhoAlpha * ( (8./3.) * cell_prim(i, j, k , prim_index)
415  - 3. * cell_prim(i, j, k-1, prim_index)
416  + (1./3.) * cell_prim(i, j, k-2, prim_index) ) * dz_inv;
417  } else if (most_on_zlo && (qty_index == RhoTheta_comp)) {
418  zflux(i,j,k,qty_index) = hfx_z(i,j,0);
419  } else if (most_on_zlo && (qty_index == RhoQ1_comp)) {
420  zflux(i,j,k,qty_index) = qfx1_z(i,j,0);
421  } else {
422  zflux(i,j,k,qty_index) = -rhoAlpha * (cell_prim(i, j, k, prim_index) - cell_prim(i, j, k-1, prim_index)) * dz_inv;
423  }
424 
425  if (qty_index == RhoTheta_comp) {
426  if (!most_on_zlo) {
427  hfx_z(i,j,k) = zflux(i,j,k,qty_index);
428  }
429  } else if (qty_index == RhoQ1_comp) {
430  if (!most_on_zlo) {
431  qfx1_z(i,j,k) = zflux(i,j,k,qty_index);
432  }
433  } else if (qty_index == RhoQ2_comp) {
434  qfx2_z(i,j,k) = zflux(i,j,k,qty_index);
435  }
436  });
437  } else if(l_consA) {
438  // without an LES/PBL model
439  ParallelFor(xbx, num_comp,[=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
440  {
441  const int qty_index = start_comp + n;
442  const int prim_index = qty_index - 1;
443 
444  int bc_comp = (qty_index >= RhoScalar_comp && qty_index < RhoScalar_comp+NSCALARS) ?
445  BCVars::RhoScalar_bc_comp : qty_index;
446  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
447  bool ext_dir_on_xlo = ( ((bc_ptr[bc_comp].lo(0) == ERFBCType::ext_dir) ||
448  (bc_ptr[bc_comp].lo(0) == ERFBCType::ext_dir_prim))
449  && i == dom_lo.x);
450  bool ext_dir_on_xhi = ( ((bc_ptr[bc_comp].hi(0) == ERFBCType::ext_dir) ||
451  (bc_ptr[bc_comp].hi(0) == ERFBCType::ext_dir_prim))
452  && i == dom_hi.x+1);
453 
454  Real rhoFace = 0.5 * ( cell_data(i, j, k, Rho_comp) + cell_data(i-1, j, k, Rho_comp) );
455  Real rhoAlpha = rhoFace * d_alpha_eff[prim_index];
456 
457  if (ext_dir_on_xlo) {
458  xflux(i,j,k,qty_index) = -rhoAlpha * ( -(8./3.) * cell_prim(i-1, j, k, prim_index)
459  + 3. * cell_prim(i , j, k, prim_index)
460  - (1./3.) * cell_prim(i+1, j, k, prim_index) ) * dx_inv;
461  } else if (ext_dir_on_xhi) {
462  xflux(i,j,k,qty_index) = -rhoAlpha * ( (8./3.) * cell_prim(i , j, k, prim_index)
463  - 3. * cell_prim(i-1, j, k, prim_index)
464  + (1./3.) * cell_prim(i-2, j, k, prim_index) ) * dx_inv;
465  } else {
466  xflux(i,j,k,qty_index) = -rhoAlpha * (cell_prim(i, j, k, prim_index) - cell_prim(i-1, j, k, prim_index)) * dx_inv * mf_u(i,j,0);
467  }
468  });
469  ParallelFor(ybx, num_comp,[=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
470  {
471  const int qty_index = start_comp + n;
472  const int prim_index = qty_index - 1;
473 
474  int bc_comp = (qty_index >= RhoScalar_comp && qty_index < RhoScalar_comp+NSCALARS) ?
475  BCVars::RhoScalar_bc_comp : qty_index;
476  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
477  bool ext_dir_on_ylo = ( ((bc_ptr[bc_comp].lo(1) == ERFBCType::ext_dir) ||
478  (bc_ptr[bc_comp].lo(1) == ERFBCType::ext_dir_prim))
479  && j == dom_lo.y);
480  bool ext_dir_on_yhi = ( ((bc_ptr[bc_comp].hi(1) == ERFBCType::ext_dir) ||
481  (bc_ptr[bc_comp].hi(1) == ERFBCType::ext_dir_prim))
482  && j == dom_hi.y+1);
483 
484  Real rhoFace = 0.5 * ( cell_data(i, j, k, Rho_comp) + cell_data(i, j-1, k, Rho_comp) );
485  Real rhoAlpha = rhoFace * d_alpha_eff[prim_index];
486 
487  if (ext_dir_on_ylo) {
488  yflux(i,j,k,qty_index) = -rhoAlpha * ( -(8./3.) * cell_prim(i, j-1, k, prim_index)
489  + 3. * cell_prim(i, j , k, prim_index)
490  - (1./3.) * cell_prim(i, j+1, k, prim_index) ) * dy_inv;
491  } else if (ext_dir_on_yhi) {
492  yflux(i,j,k,qty_index) = -rhoAlpha * ( (8./3.) * cell_prim(i, j , k, prim_index)
493  - 3. * cell_prim(i, j-1, k, prim_index)
494  + (1./3.) * cell_prim(i, j-2, k, prim_index) ) * dy_inv;
495  } else {
496  yflux(i,j,k,qty_index) = -rhoAlpha * (cell_prim(i, j, k, prim_index) - cell_prim(i, j-1, k, prim_index)) * dy_inv * mf_v(i,j,0);
497  }
498  });
499  ParallelFor(zbx, num_comp,[=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
500  {
501  const int qty_index = start_comp + n;
502  const int prim_index = qty_index - 1;
503 
504  Real rhoFace = 0.5 * ( cell_data(i, j, k, Rho_comp) + cell_data(i, j, k-1, Rho_comp) );
505  Real rhoAlpha = rhoFace * d_alpha_eff[prim_index];
506 
507  int bc_comp = (qty_index >= RhoScalar_comp && qty_index < RhoScalar_comp+NSCALARS) ?
508  BCVars::RhoScalar_bc_comp : qty_index;
509  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
510  bool ext_dir_on_zlo = ( ((bc_ptr[bc_comp].lo(2) == ERFBCType::ext_dir) ||
511  (bc_ptr[bc_comp].lo(2) == ERFBCType::ext_dir_prim))
512  && k == dom_lo.z);
513  bool ext_dir_on_zhi = ( ((bc_ptr[bc_comp].hi(2) == ERFBCType::ext_dir) ||
514  (bc_ptr[bc_comp].hi(2) == ERFBCType::ext_dir_prim))
515  && k == dom_hi.z+1);
516  bool most_on_zlo = ( use_most && exp_most &&
517  (bc_ptr[bc_comp].lo(2) == ERFBCType::foextrap) &&
518  k == dom_lo.z);
519 
520  if (ext_dir_on_zlo) {
521  zflux(i,j,k,qty_index) = -rhoAlpha * ( -(8./3.) * cell_prim(i, j, k-1, prim_index)
522  + 3. * cell_prim(i, j, k , prim_index)
523  - (1./3.) * cell_prim(i, j, k+1, prim_index) ) * dz_inv;
524  } else if (ext_dir_on_zhi) {
525  zflux(i,j,k,qty_index) = -rhoAlpha * ( (8./3.) * cell_prim(i, j, k , prim_index)
526  - 3. * cell_prim(i, j, k-1, prim_index)
527  + (1./3.) * cell_prim(i, j, k-2, prim_index) ) * dz_inv;
528  } else if (most_on_zlo && (qty_index == RhoTheta_comp)) {
529  zflux(i,j,k,qty_index) = hfx_z(i,j,0);
530  } else if (most_on_zlo && (qty_index == RhoQ1_comp)) {
531  zflux(i,j,k,qty_index) = qfx1_z(i,j,0);
532  } else {
533  zflux(i,j,k,qty_index) = -rhoAlpha * (cell_prim(i, j, k, prim_index) - cell_prim(i, j, k-1, prim_index)) * dz_inv;
534  }
535 
536  if (qty_index == RhoTheta_comp) {
537  if (!most_on_zlo) {
538  hfx_z(i,j,k) = zflux(i,j,k,qty_index);
539  }
540  } else if (qty_index == RhoQ1_comp) {
541  if (!most_on_zlo) {
542  qfx1_z(i,j,k) = zflux(i,j,k,qty_index);
543  }
544  } else if (qty_index == RhoQ2_comp) {
545  qfx2_z(i,j,k) = zflux(i,j,k,qty_index);
546  }
547  });
548  } else {
549  // with MolecDiffType::Constant or None
550  // without an LES/PBL model
551  ParallelFor(xbx, num_comp,[=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
552  {
553  const int qty_index = start_comp + n;
554  const int prim_index = qty_index - 1;
555 
556  int bc_comp = (qty_index >= RhoScalar_comp && qty_index < RhoScalar_comp+NSCALARS) ?
557  BCVars::RhoScalar_bc_comp : qty_index;
558  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
559  bool ext_dir_on_xlo = ( ((bc_ptr[bc_comp].lo(0) == ERFBCType::ext_dir) ||
560  (bc_ptr[bc_comp].lo(0) == ERFBCType::ext_dir_prim))
561  && i == dom_lo.x);
562  bool ext_dir_on_xhi = ( ((bc_ptr[bc_comp].hi(0) == ERFBCType::ext_dir) ||
563  (bc_ptr[bc_comp].hi(0) == ERFBCType::ext_dir_prim))
564  && i == dom_hi.x+1);
565 
566  Real rhoAlpha = d_alpha_eff[prim_index];
567 
568  if (ext_dir_on_xlo) {
569  xflux(i,j,k,qty_index) = -rhoAlpha * ( -(8./3.) * cell_prim(i-1, j, k, prim_index)
570  + 3. * cell_prim(i , j, k, prim_index)
571  - (1./3.) * cell_prim(i+1, j, k, prim_index) ) * dx_inv;
572  } else if (ext_dir_on_xhi) {
573  xflux(i,j,k,qty_index) = -rhoAlpha * ( (8./3.) * cell_prim(i , j, k, prim_index)
574  - 3. * cell_prim(i-1, j, k, prim_index)
575  + (1./3.) * cell_prim(i-2, j, k, prim_index) ) * dx_inv;
576  } else {
577  xflux(i,j,k,qty_index) = -rhoAlpha * (cell_prim(i, j, k, prim_index) - cell_prim(i-1, j, k, prim_index)) * dx_inv * mf_u(i,j,0);
578  }
579  });
580  ParallelFor(ybx, num_comp,[=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
581  {
582  const int qty_index = start_comp + n;
583  const int prim_index = qty_index - 1;
584 
585  int bc_comp = (qty_index >= RhoScalar_comp && qty_index < RhoScalar_comp+NSCALARS) ?
586  BCVars::RhoScalar_bc_comp : qty_index;
587  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
588  bool ext_dir_on_ylo = ( ((bc_ptr[bc_comp].lo(1) == ERFBCType::ext_dir) ||
589  (bc_ptr[bc_comp].lo(1) == ERFBCType::ext_dir_prim))
590  && j == dom_lo.y);
591  bool ext_dir_on_yhi = ( ((bc_ptr[bc_comp].hi(1) == ERFBCType::ext_dir) ||
592  (bc_ptr[bc_comp].hi(1) == ERFBCType::ext_dir_prim))
593  && j == dom_hi.y+1);
594 
595  Real rhoAlpha = d_alpha_eff[prim_index];
596 
597  if (ext_dir_on_ylo) {
598  yflux(i,j,k,qty_index) = -rhoAlpha * ( -(8./3.) * cell_prim(i, j-1, k, prim_index)
599  + 3. * cell_prim(i, j , k, prim_index)
600  - (1./3.) * cell_prim(i, j+1, k, prim_index) ) * dy_inv;
601  } else if (ext_dir_on_yhi) {
602  yflux(i,j,k,qty_index) = -rhoAlpha * ( (8./3.) * cell_prim(i, j , k, prim_index)
603  - 3. * cell_prim(i, j-1, k, prim_index)
604  + (1./3.) * cell_prim(i, j-2, k, prim_index) ) * dy_inv;
605  } else {
606  yflux(i,j,k,qty_index) = -rhoAlpha * (cell_prim(i, j, k, prim_index) - cell_prim(i, j-1, k, prim_index)) * dy_inv * mf_v(i,j,0);
607  }
608  });
609  ParallelFor(zbx, num_comp,[=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
610  {
611  const int qty_index = start_comp + n;
612  const int prim_index = qty_index - 1;
613 
614  Real rhoAlpha = d_alpha_eff[prim_index];
615 
616  int bc_comp = (qty_index >= RhoScalar_comp && qty_index < RhoScalar_comp+NSCALARS) ?
617  BCVars::RhoScalar_bc_comp : qty_index;
618  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
619  bool ext_dir_on_zlo = ( ((bc_ptr[bc_comp].lo(2) == ERFBCType::ext_dir) ||
620  (bc_ptr[bc_comp].lo(2) == ERFBCType::ext_dir_prim))
621  && k == dom_lo.z);
622  bool ext_dir_on_zhi = ( ((bc_ptr[bc_comp].hi(2) == ERFBCType::ext_dir) ||
623  (bc_ptr[bc_comp].hi(2) == ERFBCType::ext_dir_prim))
624  && k == dom_hi.z+1);
625  bool most_on_zlo = ( use_most && exp_most &&
626  (bc_ptr[BCVars::cons_bc+qty_index].lo(2) == ERFBCType::foextrap) &&
627  k == dom_lo.z);
628 
629  if (ext_dir_on_zlo) {
630  zflux(i,j,k,qty_index) = -rhoAlpha * ( -(8./3.) * cell_prim(i, j, k-1, prim_index)
631  + 3. * cell_prim(i, j, k , prim_index)
632  - (1./3.) * cell_prim(i, j, k+1, prim_index) ) * dz_inv;
633  } else if (ext_dir_on_zhi) {
634  zflux(i,j,k,qty_index) = -rhoAlpha * ( (8./3.) * cell_prim(i, j, k , prim_index)
635  - 3. * cell_prim(i, j, k-1, prim_index)
636  + (1./3.) * cell_prim(i, j, k-2, prim_index) ) * dz_inv;
637  } else if (most_on_zlo && (qty_index == RhoTheta_comp)) {
638  zflux(i,j,k,qty_index) = hfx_z(i,j,0);
639  } else if (most_on_zlo && (qty_index == RhoQ1_comp)) {
640  zflux(i,j,k,qty_index) = qfx1_z(i,j,0);
641  } else {
642  zflux(i,j,k,qty_index) = -rhoAlpha * (cell_prim(i, j, k, prim_index) - cell_prim(i, j, k-1, prim_index)) * dz_inv;
643  }
644 
645  if (qty_index == RhoTheta_comp) {
646  if (!most_on_zlo) {
647  hfx_z(i,j,k) = zflux(i,j,k,qty_index);
648  }
649  } else if (qty_index == RhoQ1_comp) {
650  if (!most_on_zlo) {
651  qfx1_z(i,j,k) = zflux(i,j,k,qty_index);
652  }
653  } else if (qty_index == RhoQ2_comp) {
654  qfx2_z(i,j,k) = zflux(i,j,k,qty_index);
655  }
656  });
657  }
658 
659  // Use fluxes to compute RHS
660  for (int n(0); n < num_comp; ++n)
661  {
662  int qty_index = start_comp + n;
663  ParallelFor(bx,[=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
664  {
665 
666  cell_rhs(i,j,k,qty_index) -= (xflux(i+1,j ,k ,qty_index) - xflux(i, j, k, qty_index)) * dx_inv * mf_m(i,j,0) // Diffusive flux in x-dir
667  +(yflux(i ,j+1,k ,qty_index) - yflux(i, j, k, qty_index)) * dy_inv * mf_m(i,j,0) // Diffusive flux in y-dir
668  +(zflux(i ,j ,k+1,qty_index) - zflux(i, j, k, qty_index)) * dz_inv; // Diffusive flux in z-dir
669  });
670  }
671 
672  // Using Deardorff (see Sullivan et al 1994)
673  // or k-eqn RANS (see Axell & Liungman 2001)
674  //
675  // Note: At this point, the thermal diffusivity ("Khv" field in ERF), the
676  // subgrid heat flux ("hfx_z" here), and the subgrid dissipation
677  // ("diss" here) have been updated by ComputeTurbulentViscosityLES --
678  // at the beginning of each timestep.
679  // The strain rate magnitude is updated at the beginning of the first
680  // RK stage only, therefore the shear production term also does not
681  // change between RK stages.
682  // The surface heat flux hfx_z(i,j,-1) is updated in MOSTStress at
683  // each RK stage if using the ERF_EXPLICIT_MOST_STRESS path, but that
684  // does not change the buoyancy production term here.
685  if (l_use_keqn && (start_comp <= RhoKE_comp) && (end_comp >= RhoKE_comp)) {
686  int qty_index = RhoKE_comp;
687  ParallelFor(bx,[=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
688  {
689  // Add Buoyancy Source
690  // where the SGS buoyancy flux tau_{theta,i} = -KH * dtheta/dx_i,
691  // such that for dtheta/dz < 0, there is a positive (upward) heat
692  // flux; the TKE buoyancy production is then
693  // B = g/theta_0 * tau_{theta,w}
694  // for a dry atmosphere.
695  // TODO: To account for moisture, the Brunt-Vaisala frequency,
696  // N^2 = g[1/theta * dtheta/dz + ...]
697  // **should** be a function of the water vapor and total water
698  // mixing ratios, depending on whether conditions are saturated or
699  // not (see the WRF model description, Skamarock et al 2019).
700  cell_rhs(i,j,k,qty_index) += l_abs_g * l_inv_theta0 * hfx_z(i,j,k);
701 
702  // TKE shear production
703  // P = -tau_ij * S_ij = 2 * mu_turb * S_ij * S_ij
704  // Note: This assumes that the horizontal and vertical diffusivities
705  // of momentum are equal
706  cell_rhs(i,j,k,qty_index) += 2.0*mu_turb(i,j,k,EddyDiff::Mom_v) * SmnSmn_a(i,j,k);
707 
708  // TKE dissipation
709  cell_rhs(i,j,k,qty_index) -= diss(i,j,k);
710  });
711  }
712 
713  // Using PBL
714  if (l_use_mynn && start_comp <= RhoKE_comp && end_comp >=RhoKE_comp) {
715  int qty_index = RhoKE_comp;
716  auto pbl_mynn_B1_l = turbChoice.pbl_mynn.B1;
717 
718  const int rhoqv_comp = solverChoice.RhoQv_comp;
719  const int rhoqc_comp = solverChoice.RhoQc_comp;
720  const int rhoqr_comp = solverChoice.RhoQr_comp;
721 
722  ParallelFor(bx,[=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
723  {
724  bool c_ext_dir_on_zlo = ( (bc_ptr[BCVars::cons_bc].lo(2) == ERFBCType::ext_dir) );
725  bool c_ext_dir_on_zhi = ( (bc_ptr[BCVars::cons_bc].lo(5) == ERFBCType::ext_dir) );
726  bool u_ext_dir_on_zlo = ( (bc_ptr[BCVars::xvel_bc].lo(2) == ERFBCType::ext_dir) );
727  bool u_ext_dir_on_zhi = ( (bc_ptr[BCVars::xvel_bc].lo(5) == ERFBCType::ext_dir) );
728  bool v_ext_dir_on_zlo = ( (bc_ptr[BCVars::yvel_bc].lo(2) == ERFBCType::ext_dir) );
729  bool v_ext_dir_on_zhi = ( (bc_ptr[BCVars::yvel_bc].lo(5) == ERFBCType::ext_dir) );
730 
731  // This computes shear production, buoyancy production, and dissipation terms only.
732  cell_rhs(i, j, k, qty_index) += ComputeQKESourceTerms(i,j,k,u,v,cell_data,cell_prim,
733  mu_turb,cellSizeInv,domain,
734  pbl_mynn_B1_l,tm_arr(i,j,0),
735  rhoqv_comp, rhoqc_comp, rhoqr_comp,
736  c_ext_dir_on_zlo, c_ext_dir_on_zhi,
737  u_ext_dir_on_zlo, u_ext_dir_on_zhi,
738  v_ext_dir_on_zlo, v_ext_dir_on_zhi,
739  use_most);
740  });
741  }
742 }
void DiffusionSrcForState_N(const Box &bx, const Box &domain, int start_comp, int num_comp, const bool &exp_most, const Array4< const Real > &u, const Array4< const Real > &v, const Array4< const Real > &cell_data, const Array4< const Real > &cell_prim, const Array4< Real > &cell_rhs, const Array4< Real > &xflux, const Array4< Real > &yflux, const Array4< Real > &zflux, const GpuArray< Real, AMREX_SPACEDIM > &cellSizeInv, const Array4< const Real > &SmnSmn_a, const Array4< const Real > &mf_m, const Array4< const Real > &mf_u, const Array4< const Real > &mf_v, Array4< Real > &hfx_z, Array4< Real > &qfx1_z, Array4< Real > &qfx2_z, Array4< Real > &diss, const Array4< const Real > &mu_turb, const SolverChoice &solverChoice, const int level, const Array4< const Real > &tm_arr, const GpuArray< Real, AMREX_SPACEDIM > grav_gpu, const BCRec *bc_ptr, const bool use_most)
Definition: ERF_DiffusionSrcForState_N.cpp:40
#define RhoScalar_comp
Definition: ERF_IndexDefines.H:40
#define PrimQ1_comp
Definition: ERF_IndexDefines.H:53
#define NPRIMVAR_max
Definition: ERF_IndexDefines.H:33
#define PrimQ2_comp
Definition: ERF_IndexDefines.H:54
#define Rho_comp
Definition: ERF_IndexDefines.H:36
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:37
#define PrimQ4_comp
Definition: ERF_IndexDefines.H:56
#define RhoQ2_comp
Definition: ERF_IndexDefines.H:43
#define PrimQ6_comp
Definition: ERF_IndexDefines.H:58
#define NSCALARS
Definition: ERF_IndexDefines.H:16
#define PrimQ5_comp
Definition: ERF_IndexDefines.H:57
#define PrimTheta_comp
Definition: ERF_IndexDefines.H:50
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:42
#define PrimScalar_comp
Definition: ERF_IndexDefines.H:52
#define PrimQ3_comp
Definition: ERF_IndexDefines.H:55
#define RhoKE_comp
Definition: ERF_IndexDefines.H:38
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real ComputeQKESourceTerms(int i, int j, int k, const amrex::Array4< const amrex::Real > &uvel, const amrex::Array4< const amrex::Real > &vvel, const amrex::Array4< const amrex::Real > &cell_data, const amrex::Array4< const amrex::Real > &cell_prim, const amrex::Array4< const amrex::Real > &K_turb, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Box &domain, amrex::Real pbl_mynn_B1_l, const amrex::Real theta_mean, const int RhoQv_comp, const int RhoQc_comp, const int RhoQr_comp, bool c_ext_dir_on_zlo, bool c_ext_dir_on_zhi, bool u_ext_dir_on_zlo, bool u_ext_dir_on_zhi, bool v_ext_dir_on_zlo, bool v_ext_dir_on_zhi, const bool use_most=false, const amrex::Real met_h_zeta=1.0)
Definition: ERF_PBLModels.H:160
@ RhoScalar_bc_comp
Definition: ERF_IndexDefines.H:80
@ yvel_bc
Definition: ERF_IndexDefines.H:89
@ cons_bc
Definition: ERF_IndexDefines.H:76
@ xvel_bc
Definition: ERF_IndexDefines.H:88
@ foextrap
Definition: ERF_IndexDefines.H:179
@ ext_dir
Definition: ERF_IndexDefines.H:180
@ ext_dir_prim
Definition: ERF_IndexDefines.H:182
@ Theta_v
Definition: ERF_IndexDefines.H:157
@ Scalar_v
Definition: ERF_IndexDefines.H:159
@ Q_v
Definition: ERF_IndexDefines.H:160
@ Q_h
Definition: ERF_IndexDefines.H:155
@ Mom_v
Definition: ERF_IndexDefines.H:156
@ Scalar_h
Definition: ERF_IndexDefines.H:154
@ KE_v
Definition: ERF_IndexDefines.H:158
@ Theta_h
Definition: ERF_IndexDefines.H:152
@ KE_h
Definition: ERF_IndexDefines.H:153
Definition: ERF_DiffStruct.H:19
amrex::Real rhoAlpha_C
Definition: ERF_DiffStruct.H:95
amrex::Real rhoAlpha_T
Definition: ERF_DiffStruct.H:94
amrex::Real alpha_T
Definition: ERF_DiffStruct.H:87
amrex::Real alpha_C
Definition: ERF_DiffStruct.H:88
MolecDiffType molec_diff_type
Definition: ERF_DiffStruct.H:84
amrex::Real B1
Definition: ERF_MYNNStruct.H:43
int RhoQr_comp
Definition: ERF_DataStruct.H:700
DiffChoice diffChoice
Definition: ERF_DataStruct.H:592
int RhoQc_comp
Definition: ERF_DataStruct.H:694
int RhoQv_comp
Definition: ERF_DataStruct.H:693
amrex::Vector< TurbChoice > turbChoice
Definition: ERF_DataStruct.H:594
Definition: ERF_TurbStruct.H:31
MYNNLevel25 pbl_mynn
Definition: ERF_TurbStruct.H:243
PBLType pbl_type
Definition: ERF_TurbStruct.H:241
RANSType rans_type
Definition: ERF_TurbStruct.H:238
LESType les_type
Definition: ERF_TurbStruct.H:205
amrex::Real theta_ref
Definition: ERF_TurbStruct.H:235
Here is the call graph for this function: