ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_InitCustomPert_KE.H
Go to the documentation of this file.
1 
2  ParmParse pp("prob");
3 
4  Real KE_0 = 0.1; pp.query("KE_0", KE_0);
5  Real KE_decay_height = -1; pp.query("KE_decay_height", KE_decay_height);
6  Real KE_decay_order = 1; pp.query("KE_decay_order" , KE_decay_order );
7 
8  if (KE_decay_height > 0) {
9  amrex::Print() << "Initial KE profile (order " << KE_decay_order
10  << ") will extend up to " << KE_decay_height
11  << std::endl;
12  }
13 
14  ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
15  {
16  // Set an initial value for SGS KE
17  const Real z = z_cc(i,j,k);
18  if (state_pert.nComp() > RhoKE_comp) {
19  state_pert(i, j, k, RhoKE_comp) = r_hse(i,j,k) * KE_0;
20  // scale initial SGS kinetic energy with height
21  if (KE_decay_height > 0) {
22  state_pert(i, j, k, RhoKE_comp) *= max(
23  std::pow(1 - min(z/KE_decay_height,1.0), KE_decay_order),
24  1e-12);
25  }
26  }
27  });
#define RhoKE_comp
Definition: ERF_IndexDefines.H:38
state_pert(i, j, k, RhoTheta_comp)
Real KE_0
Definition: ERF_InitCustomPert_KE.H:4
ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const Real z=z_cc(i, j, k);if(state_pert.nComp() > RhoKE_comp) { state_pert(i, j, k, RhoKE_comp)=r_hse(i, j, k) *KE_0;if(KE_decay_height > 0) { state_pert(i, j, k, RhoKE_comp) *=max(std::pow(1 - min(z/KE_decay_height, 1.0), KE_decay_order), 1e-12);} } })
ParmParse pp("prob")
Real KE_decay_order
Definition: ERF_InitCustomPert_KE.H:6
Real KE_decay_height
Definition: ERF_InitCustomPert_KE.H:5
amrex::Real Real
Definition: ERF_ShocInterface.H:19