ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_AddQKESources.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_use_mynn &&start_comp<=RhoKE_comp &&end_comp >=RhoKE_comp)
 

Function Documentation

◆ if()

if ( l_use_mynn &&start_comp<=RhoKE_comp &&end_comp >=  RhoKE_comp)
2  {
3  int qty_index = RhoKE_comp;
4  auto pbl_mynn_B1_l = turbChoice.pbl_mynn.B1;
5 
6  ParallelFor(bx,[=,moist_indices=solverChoice.moisture_indices] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
7  {
8  bool c_ext_dir_on_zlo = ( (bc_ptr[BCVars::cons_bc].lo(2) == ERFBCType::ext_dir) );
9  bool c_ext_dir_on_zhi = ( (bc_ptr[BCVars::cons_bc].hi(2) == ERFBCType::ext_dir) );
10  bool u_ext_dir_on_zlo = ( (bc_ptr[BCVars::xvel_bc].lo(2) == ERFBCType::ext_dir) );
11  bool u_ext_dir_on_zhi = ( (bc_ptr[BCVars::xvel_bc].hi(2) == ERFBCType::ext_dir) );
12  bool v_ext_dir_on_zlo = ( (bc_ptr[BCVars::yvel_bc].lo(2) == ERFBCType::ext_dir) );
13  bool v_ext_dir_on_zhi = ( (bc_ptr[BCVars::yvel_bc].hi(2) == ERFBCType::ext_dir) );
14 
15  // This computes shear production, buoyancy production, and dissipation terms only.
16  cell_rhs(i, j, k, qty_index) += ComputeQKESourceTerms(i,j,k,u,v,cell_data,cell_prim,
17  mu_turb,cellSizeInv,domain,
18  pbl_mynn_B1_l,tm_arr(i,j,0),
19  moist_indices,
20  c_ext_dir_on_zlo, c_ext_dir_on_zhi,
21  u_ext_dir_on_zlo, u_ext_dir_on_zhi,
22  v_ext_dir_on_zlo, v_ext_dir_on_zhi);
23  });
24  }
#define RhoKE_comp
Definition: ERF_IndexDefines.H:38
ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const Real *dx=geomdata.CellSize();const Real x=(i+0.5) *dx[0];const Real y=(j+0.5) *dx[1];const Real Omg=erf_vortex_Gaussian(x, y, xc, yc, R, beta, sigma);const Real deltaT=-(gamma - 1.0)/(2.0 *sigma *sigma) *Omg *Omg;const Real rho_norm=std::pow(1.0+deltaT, inv_gm1);const Real T=(1.0+deltaT) *T_inf;const Real p=std::pow(rho_norm, Gamma)/Gamma *rho_0 *a_inf *a_inf;const Real rho_theta=rho_0 *rho_norm *(T *std::pow(p_0/p, rdOcp));state_pert(i, j, k, RhoTheta_comp)=rho_theta - getRhoThetagivenP(p_hse(i, j, k));const Real r2d_xy=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc));state_pert(i, j, k, RhoScalar_comp)=0.25 *(1.0+std::cos(PI *std::min(r2d_xy, R)/R));})
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 MoistureComponentIndices &moisture_indices, 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 amrex::Real met_h_zeta=one)
Definition: ERF_PBLModels.H:249
TurbChoice turbChoice
Definition: ERF_SetupVertDiff.H:6
@ yvel_bc
Definition: ERF_IndexDefines.H:88
@ cons_bc
Definition: ERF_IndexDefines.H:76
@ xvel_bc
Definition: ERF_IndexDefines.H:87
@ ext_dir
Definition: ERF_IndexDefines.H:227
amrex::Real B1
Definition: ERF_MYNNStruct.H:45
MYNNLevel25 pbl_mynn
Definition: ERF_TurbStruct.H:441

Referenced by ComputeTurbulentViscosityLES(), and ComputeTurbulentViscosityRANS().

Here is the call graph for this function:
Here is the caller graph for this function: