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

Go to the source code of this file.

Functions

ParmParse pp ("prob")
 
pp query ("x_c", x_c)
 
pp query ("z_c", z_c)
 
pp query ("x_r", x_r)
 
pp query ("z_r", z_r)
 
pp query ("T_pert", T_pert)
 
 ParallelFor (bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const auto prob_lo=geomdata.ProbLo();const auto dx=geomdata.CellSize();const Real x=(prob_lo[0]+(i+myhalf) *dx[0])/mf_m(i, j, 0);const Real z=z_cc(i, j, k);Real L=std::sqrt(std::pow((x - x_c)/x_r, 2)+std::pow((z - z_c)/z_r, 2));if(L<=one) { Real dT=T_pert *(std::cos(PI *L)+one)/two;Real Tbar_hse=p_hse(i, j, k)/(R_d *r_hse(i, j, k));Real theta_perturbed=(Tbar_hse+dT) *std::pow(p_0/p_hse(i, j, k), rdOcp);Real theta_0=(Tbar_hse) *std::pow(p_0/p_hse(i, j, k), rdOcp);if(const_rho) { state_pert(i, j, k, RhoTheta_comp)=r_hse(i, j, k) *(theta_perturbed - theta_0);} else { state_pert(i, j, k, Rho_comp)=getRhoThetagivenP(p_hse(i, j, k))/theta_perturbed - r_hse(i, j, k);} } })
 

Variables

Real x_c = zero
 
Real z_c = amrex::Real(3000.)
 
Real x_r = amrex::Real(4000.)
 
Real z_r = amrex::Real(2000.)
 
Real T_pert = -amrex::Real(15.)
 
const bool const_rho = (sc.fixed_density[lev] == 1)
 
const Real rdOcp = sc.rdOcp
 

Function Documentation

◆ ParallelFor()

ParallelFor ( bx  ,
[=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const auto prob_lo=geomdata.ProbLo();const auto dx=geomdata.CellSize();const Real x=(prob_lo[0]+(i+myhalf) *dx[0])/mf_m(i, j, 0);const Real z=z_cc(i, j, k);Real L=std::sqrt(std::pow((x - x_c)/x_r, 2)+std::pow((z - z_c)/z_r, 2));if(L<=one) { Real dT=T_pert *(std::cos(PI *L)+one)/two;Real Tbar_hse=p_hse(i, j, k)/(R_d *r_hse(i, j, k));Real theta_perturbed=(Tbar_hse+dT) *std::pow(p_0/p_hse(i, j, k), rdOcp);Real theta_0=(Tbar_hse) *std::pow(p_0/p_hse(i, j, k), rdOcp);if(const_rho) { state_pert(i, j, k, RhoTheta_comp)=r_hse(i, j, k) *(theta_perturbed - theta_0);} else { state_pert(i, j, k, Rho_comp)=getRhoThetagivenP(p_hse(i, j, k))/theta_perturbed - r_hse(i, j, k);} } }   
)
Here is the call graph for this function:

◆ pp()

ParmParse pp ( "prob"  )

◆ query() [1/5]

pp query ( "T_pert"  ,
T_pert   
)

◆ query() [2/5]

pp query ( "x_c"  ,
x_c   
)

◆ query() [3/5]

pp query ( "x_r"  ,
x_r   
)

◆ query() [4/5]

pp query ( "z_c"  ,
z_c   
)

◆ query() [5/5]

pp query ( "z_r"  ,
z_r   
)

Variable Documentation

◆ const_rho

const bool const_rho = (sc.fixed_density[lev] == 1)

Referenced by ParallelFor().

◆ rdOcp

const Real rdOcp = sc.rdOcp

Referenced by ParallelFor().

◆ T_pert

Real T_pert = -amrex::Real(15.)

Referenced by ParallelFor().

◆ x_c

Real x_c = zero

Referenced by ParallelFor().

◆ x_r

Real x_r = amrex::Real(4000.)

Referenced by ParallelFor().

◆ z_c

Real z_c = amrex::Real(3000.)

Referenced by ParallelFor().

◆ z_r

Real z_r = amrex::Real(2000.)

Referenced by ParallelFor().