ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_InitCustomPert_KE.H File Reference

Go to the source code of this file.

Functions

ParmParse pp ("prob")
 
pp query ("KE_0", KE_0)
 
pp query ("KE_decay_height", KE_decay_height)
 
pp query ("KE_decay_order", KE_decay_order)
 
 if (KE_decay_height > 0 &&state_pert.nComp() > RhoKE_comp)
 
 if (state_pert.nComp() > RhoKE_comp)
 

Variables

Real KE_0 = zero
 
Real KE_decay_height = -1
 
Real KE_decay_order = 1
 
const bool use_eb = (sc.terrain_type == TerrainType::EB)
 
const int klo = geomdata.Domain().smallEnd(2)
 

Function Documentation

◆ if() [1/2]

if ( KE_decay_height  ,
0 &&state_pert.  nComp(),
RhoKE_comp   
)
11  {
12  amrex::Print() << "Initial KE profile (order " << KE_decay_order
13  << ") will extend up to " << KE_decay_height
14  << std::endl;
15  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(klo == bx.smallEnd(2),
16  "Vertical decomposition with KE initialization is not allowed.");
17  }
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(m_cloud_chamber_config.active, "Cloud Chamber: initializer reached without a parsed configuration")
const int klo
Definition: ERF_InitCustomPert_KE.H:9
Real KE_decay_order
Definition: ERF_InitCustomPert_KE.H:6
Real KE_decay_height
Definition: ERF_InitCustomPert_KE.H:5
Here is the call graph for this function:

◆ if() [2/2]

if ( state_pert.  nComp(),
RhoKE_comp   
)
19  {
21  "KE_0 must be non-negative.");
22 
23  ParallelFor(bx, [=,one_d=one] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
24  {
25  // Set an initial value for SGS KE
26  state_pert(i, j, k, RhoKE_comp) = r_hse(i,j,k) * KE_0;
27  // scale initial SGS kinetic energy with height
28  if (KE_decay_height > 0) {
29  const Real z_sfc = (use_eb) ? zero :
30  fourth * ( z_nd(i ,j ,klo) + z_nd(i+1,j ,klo)
31  + z_nd(i ,j+1,klo) + z_nd(i+1,j+1,klo) );
32  const Real z_agl = z_cc(i,j,k) - z_sfc;
33  state_pert(i, j, k, RhoKE_comp) *= max(
34  std::pow(1 - min(z_agl/KE_decay_height,one_d), KE_decay_order),
35  amrex::Real(1e-12));
36  }
37  });
38  }
#define RhoKE_comp
Definition: ERF_IndexDefines.H:41
Real KE_0
Definition: ERF_InitCustomPert_KE.H:4
const bool use_eb
Definition: ERF_InitCustomPert_KE.H:8
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 one
Definition: ERF_NumericalConstants.H:30
constexpr amrex::Real fourth
Definition: ERF_NumericalConstants.H:35
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:29
amrex::Real Real
Definition: ERF_ShocInterface.H:19
Here is the call graph for this function:

◆ pp()

ParmParse pp ( "prob"  )

◆ query() [1/3]

pp query ( "KE_0"  ,
KE_0   
)

◆ query() [2/3]

pp query ( "KE_decay_height"  ,
KE_decay_height   
)

◆ query() [3/3]

pp query ( "KE_decay_order"  ,
KE_decay_order   
)

Variable Documentation

◆ KE_0

Real KE_0 = zero

Referenced by if().

◆ KE_decay_height

Real KE_decay_height = -1

Referenced by if().

◆ KE_decay_order

Real KE_decay_order = 1

Referenced by if().

◆ klo

const int klo = geomdata.Domain().smallEnd(2)

Referenced by if().

◆ use_eb

const bool use_eb = (sc.terrain_type == TerrainType::EB)

Referenced by if().