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 DiffChoice l_diff_choice = solverChoice.diffChoice
 
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)
38  {
39 #ifdef _OPENMP
40 #pragma omp parallel if (Gpu::notInLaunchRegion())
41 #endif
42  for ( MFIter mfi(S_new[IntVars::cons],TilingIfNotGPU()); mfi.isValid(); ++mfi)
43  {
44  const Box& tbx = mfi.tilebox();
45  const Array4<Real>& cons = S_new[IntVars::cons].array(mfi);
46 
47  if (l_limit_KE) {
48  const bool skip_klo = l_dirichlet_k && (tbx.smallEnd(2) <= l_klo);
49  ParallelFor(tbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
50  {
51  if (skip_klo && k == l_klo) { return; }
52  const Real ke_floor = (l_tke_floor > zero) ? cons(i,j,k,Rho_comp) * l_tke_floor : l_eps;
53  cons(i,j,k,RhoKE_comp) = amrex::max(cons(i,j,k,RhoKE_comp), ke_floor);
54  });
55  }
56 
57  if (l_limit_Q) {
58  ParallelFor(tbx, l_nq, [=,zero_d=zero] AMREX_GPU_DEVICE (int i, int j, int k, int nn) noexcept
59  {
60  const int n = RhoQ1_comp + nn;
61  if (!l_diff_choice.host_transports(n)) { return; }
62  cons(i,j,k,n) = amrex::max(cons(i,j,k,n), zero_d);
63  });
64  }
65  } // mfi
66  } // limit KE or Q
#define Rho_comp
Definition: ERF_IndexDefines.H:53
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:66
#define RhoKE_comp
Definition: ERF_IndexDefines.H:55
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:23
const Real l_eps
Definition: ERF_ScalarLimitPost.H:26
const DiffChoice l_diff_choice
Definition: ERF_ScalarLimitPost.H:17
const bool l_dirichlet_k
Definition: ERF_ScalarLimitPost.H:21
const bool l_limit_KE
Definition: ERF_ScalarLimitPost.H:14
const int l_nq
Definition: ERF_ScalarLimitPost.H:31
const bool l_limit_Q
Definition: ERF_ScalarLimitPost.H:15
const Real l_tke_floor
Definition: ERF_ScalarLimitPost.H:25
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ cons
Definition: ERF_IndexDefines.H:272
@ nn
Definition: ERF_WDM6.H:33
@ cons
Definition: ERF_IndexDefines.H:254
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool host_transports(int n) const noexcept
Definition: ERF_DiffStruct.H:121
Here is the call graph for this function:

◆ if() [2/2]

if ( l_limit_Q  )
33  {
36  }
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_diff_choice

const DiffChoice l_diff_choice = solverChoice.diffChoice

Referenced by if().

◆ 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:877
bool dirichlet_k
Whether TKE uses Dirichlet boundary treatment.
Definition: ERF_TurbStruct.H:879

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().