ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_ScalarLimitPost.H File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 if (l_limit_Q)
 
 if (l_limit_KE||l_limit_Q)
 

Variables

const TurbChoice & l_tc = solverChoice.turbChoice[level]
 
const bool l_limit_KE = l_tc.use_tke
 
const bool l_limit_Q = (solverChoice.moisture_type != MoistureType::None)
 
const bool l_sbm = (solverChoice.moisture_type == MoistureType::SBM)
 
const bool l_dirichlet_k
 
const int l_klo = fine_geom.Domain().smallEnd(2)
 
const Real l_tke_floor = l_tc.tke_floor
 
const Real l_eps = std::numeric_limits<Real>::epsilon()
 
const int l_nq = (l_sbm) ? 1 : S_new[IntVars::cons].nComp() - RhoQ1_comp
 

Function Documentation

◆ if() [1/2]

if ( l_limit_KE||  l_limit_Q)
37  {
38 #ifdef _OPENMP
39 #pragma omp parallel if (Gpu::notInLaunchRegion())
40 #endif
41  for ( MFIter mfi(S_new[IntVars::cons],TilingIfNotGPU()); mfi.isValid(); ++mfi)
42  {
43  const Box& tbx = mfi.tilebox();
44  const Array4<Real>& cons = S_new[IntVars::cons].array(mfi);
45 
46  if (l_limit_KE) {
47  const bool skip_klo = l_dirichlet_k && (tbx.smallEnd(2) <= l_klo);
48  ParallelFor(tbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
49  {
50  if (skip_klo && k == l_klo) { return; }
51  const Real ke_floor = (l_tke_floor > zero) ? cons(i,j,k,Rho_comp) * l_tke_floor : l_eps;
52  cons(i,j,k,RhoKE_comp) = amrex::max(cons(i,j,k,RhoKE_comp), ke_floor);
53  });
54  }
55 
56  if (l_limit_Q) {
57  ParallelFor(tbx, l_nq, [=,zero_d=zero] AMREX_GPU_DEVICE (int i, int j, int k, int nn) noexcept
58  {
59  const int n = RhoQ1_comp + nn;
60  cons(i,j,k,n) = amrex::max(cons(i,j,k,n), zero_d);
61  });
62  }
63  } // mfi
64  } // limit KE or Q
#define Rho_comp
Definition: ERF_IndexDefines.H:42
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:48
#define RhoKE_comp
Definition: ERF_IndexDefines.H:44
ParallelFor(fab_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) { qrcuten_arr(i, j, k)=Real(0);qscuten_arr(i, j, k)=Real(0);qicuten_arr(i, j, k)=Real(0);})
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
const int l_klo
Definition: ERF_ScalarLimitPost.H:22
const Real l_eps
Definition: ERF_ScalarLimitPost.H:25
const bool l_dirichlet_k
Definition: ERF_ScalarLimitPost.H:20
const bool l_limit_KE
Definition: ERF_ScalarLimitPost.H:14
const int l_nq
Definition: ERF_ScalarLimitPost.H:30
const bool l_limit_Q
Definition: ERF_ScalarLimitPost.H:15
const Real l_tke_floor
Definition: ERF_ScalarLimitPost.H:24
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ cons
Definition: ERF_IndexDefines.H:235
@ nn
Definition: ERF_WDM6.H:32
@ cons
Definition: ERF_IndexDefines.H:217
Here is the call graph for this function:

◆ if() [2/2]

if ( l_limit_Q  )
32  {
35  }
const bool l_sbm
Definition: ERF_ScalarLimitPost.H:16
void require_host_write_range_allowed(const bool sbm_active, const int start_component, const int num_components, const HostWritePath path)
Definition: ERF_SBMOwnership.cpp:47
Here is the call graph for this function:

Variable Documentation

◆ l_dirichlet_k

const bool l_dirichlet_k
Initial value:
= ( l_tc.rans_type == RANSType::kEqn && l_tc.dirichlet_k &&
(m_SurfaceLayer[Orientation(Direction::z, Orientation::low)] != nullptr) )
const TurbChoice & l_tc
Definition: ERF_ScalarLimitPost.H:12
RANSType rans_type
Selected RANS closure.
Definition: ERF_TurbStruct.H:828
bool dirichlet_k
Whether TKE uses Dirichlet boundary treatment.
Definition: ERF_TurbStruct.H:830

Referenced by erf_slow_rhs_post(), and if().

◆ l_eps

const Real l_eps = std::numeric_limits<Real>::epsilon()

Referenced by if().

◆ l_klo

const int l_klo = fine_geom.Domain().smallEnd(2)

Referenced by if().

◆ l_limit_KE

const bool l_limit_KE = l_tc.use_tke

Referenced by if().

◆ l_limit_Q

const bool l_limit_Q = (solverChoice.moisture_type != MoistureType::None)

Referenced by if().

◆ l_nq

const int l_nq = (l_sbm) ? 1 : S_new[IntVars::cons].nComp() - RhoQ1_comp

Referenced by if().

◆ l_sbm

const bool l_sbm = (solverChoice.moisture_type == MoistureType::SBM)

Referenced by if().

◆ l_tc

const TurbChoice& l_tc = solverChoice.turbChoice[level]

◆ l_tke_floor

const Real l_tke_floor = l_tc.tke_floor

Referenced by if().