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

Go to the source code of this file.

Functions

ParmParse pp ("prob")
 
pp query ("A_0", A_0)
 
pp query ("B_0", B_0)
 
pp query ("rad_0", rad_0)
 
pp query ("rho_0", rho_0)
 
pp query ("xc_frac", xc_frac)
 
pp query ("yc_frac", yc_frac)
 
pp query ("zc_frac", zc_frac)
 
pp query ("prob_type", prob_type)
 
pp query ("xradius", xradius)
 
pp query ("zradius", zradius)
 
 if (prob_type==11)
 
 AMREX_ALWAYS_ASSERT (sc.terrain_type==TerrainType::EB)
 
 ParallelFor (bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const Real *prob_lo=geomdata.ProbLo();const Real *prob_hi=geomdata.ProbHi();const Real *dx=geomdata.CellSize();const Real x=prob_lo[0]+(i+myhalf) *dx[0];const Real y=prob_lo[1]+(j+myhalf) *dx[1];const Real z=use_z_phys ? z_cc(i, j, k) :prob_lo[2]+(k+myhalf) *dx[2];const Real xc=prob_lo[0]+xc_frac *(prob_hi[0] - prob_lo[0]);const Real yc=prob_lo[1]+yc_frac *(prob_hi[1] - prob_lo[1]);const Real zc=phys_z_lo+zc_frac *(phys_z_hi - phys_z_lo);const Real r0=rad_0 *(prob_hi[0] - prob_lo[0]);const Real r3d=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc)+(z-zc) *(z-zc));const Real r2d_xz=std::sqrt((x-xc) *(x-xc)+(z-zc) *(z-zc));const Real r2d_xz_nd=std::sqrt((x-xc) *(x-xc)/xradius/xradius+(z-zc) *(z-zc)/zradius/zradius);if(prob_type==10) { state_pert(i, j, k, RhoScalar_comp)=A_0 *std::exp(-amrex::Real(0.1) *r2d_xz *r2d_xz)+B_0 *std::sin(x);} else if(prob_type==11) { if(r2d_xz_nd< one) { state_pert(i, j, k, RhoScalar_comp)=myhalf *A_0 *(one+std::cos(PI *r2d_xz_nd));} } else { if(r3d< r0) { state_pert(i, j, k, RhoScalar_comp)=A_0;} } state_pert(i, j, k, RhoScalar_comp) *=rho_0;})
 

Variables

const bool use_z_phys = use_physical_z()
 
const Real phys_z_lo = phys_zlo(geomdata, lev)
 
const Real phys_z_hi = phys_zhi(geomdata, lev)
 
Real A_0 = one
 
Real B_0 = zero
 
Real rad_0 = zero
 
Real rho_0 = one
 
Real xc_frac = myhalf
 
Real yc_frac = myhalf
 
Real zc_frac = myhalf
 
int prob_type = -1
 
Real xradius = amrex::Real(10.0)
 
Real zradius = amrex::Real(10.0)
 

Function Documentation

◆ AMREX_ALWAYS_ASSERT()

AMREX_ALWAYS_ASSERT ( sc.  terrain_type = =TerrainType::EB)

◆ if()

else if ( prob_type  = = 11)
25  {
27  "prob.xradius and prob.zradius must be > 0 for prob.prob_type = 11");
28  }
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(axis >=0 &&axis< AMREX_SPACEDIM, "prob.axis must be 0, 1 or 2")
Real zradius
Definition: ERF_InitCustomPert_EBPoiseuille.H:22
Real xradius
Definition: ERF_InitCustomPert_EBPoiseuille.H:21
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
Here is the call graph for this function:

◆ ParallelFor()

ParallelFor ( bx  ,
[=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const Real *prob_lo=geomdata.ProbLo();const Real *prob_hi=geomdata.ProbHi();const Real *dx=geomdata.CellSize();const Real x=prob_lo[0]+(i+myhalf) *dx[0];const Real y=prob_lo[1]+(j+myhalf) *dx[1];const Real z=use_z_phys ? z_cc(i, j, k) :prob_lo[2]+(k+myhalf) *dx[2];const Real xc=prob_lo[0]+xc_frac *(prob_hi[0] - prob_lo[0]);const Real yc=prob_lo[1]+yc_frac *(prob_hi[1] - prob_lo[1]);const Real zc=phys_z_lo+zc_frac *(phys_z_hi - phys_z_lo);const Real r0=rad_0 *(prob_hi[0] - prob_lo[0]);const Real r3d=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc)+(z-zc) *(z-zc));const Real r2d_xz=std::sqrt((x-xc) *(x-xc)+(z-zc) *(z-zc));const Real r2d_xz_nd=std::sqrt((x-xc) *(x-xc)/xradius/xradius+(z-zc) *(z-zc)/zradius/zradius);if(prob_type==10) { state_pert(i, j, k, RhoScalar_comp)=A_0 *std::exp(-amrex::Real(0.1) *r2d_xz *r2d_xz)+B_0 *std::sin(x);} else if(prob_type==11) { if(r2d_xz_nd< one) { state_pert(i, j, k, RhoScalar_comp)=myhalf *A_0 *(one+std::cos(PI *r2d_xz_nd));} } else { if(r3d< r0) { state_pert(i, j, k, RhoScalar_comp)=A_0;} } state_pert(i, j, k, RhoScalar_comp) *=rho_0;}   
)

◆ pp()

ParmParse pp ( "prob"  )

◆ query() [1/10]

pp query ( "A_0"  ,
A_0   
)

◆ query() [2/10]

pp query ( "B_0"  ,
B_0   
)

◆ query() [3/10]

pp query ( "prob_type"  ,
prob_type   
)

◆ query() [4/10]

pp query ( "rad_0"  ,
rad_0   
)

◆ query() [5/10]

pp query ( "rho_0"  ,
rho_0   
)

◆ query() [6/10]

pp query ( "xc_frac"  ,
xc_frac   
)

◆ query() [7/10]

pp query ( "xradius"  ,
xradius   
)

◆ query() [8/10]

pp query ( "yc_frac"  ,
yc_frac   
)

◆ query() [9/10]

pp query ( "zc_frac"  ,
zc_frac   
)

◆ query() [10/10]

pp query ( "zradius"  ,
zradius   
)

Variable Documentation

◆ A_0

Real A_0 = one

Referenced by ParallelFor().

◆ B_0

Real B_0 = zero

Referenced by ParallelFor().

◆ phys_z_hi

const Real phys_z_hi = phys_zhi(geomdata, lev)

Referenced by ParallelFor().

◆ phys_z_lo

const Real phys_z_lo = phys_zlo(geomdata, lev)

Referenced by ParallelFor().

◆ prob_type

int prob_type = -1

Referenced by ParallelFor().

◆ rad_0

Real rad_0 = zero

Referenced by ParallelFor().

◆ rho_0

Real rho_0 = one

Referenced by ParallelFor().

◆ use_z_phys

const bool use_z_phys = use_physical_z()

Referenced by ParallelFor().

◆ xc_frac

Real xc_frac = myhalf

Referenced by ParallelFor().

◆ xradius

Real xradius = amrex::Real(10.0)

Referenced by if(), and ParallelFor().

◆ yc_frac

Real yc_frac = myhalf

Referenced by ParallelFor().

◆ zc_frac

Real zc_frac = myhalf

Referenced by ParallelFor().

◆ zradius

Real zradius = amrex::Real(10.0)

Referenced by if(), and ParallelFor().