14 const bool use_moisture = (sc.moisture_type != MoistureType::None);
18 ParallelForRNG(bx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k,
const RandomEngine& engine) noexcept
23 const Real*
dx = geomdata.CellSize();
46 Real rand_double = amrex::Random(engine);
48 Real Tnew = Told + Tpert;
82 Real rand_double = amrex::Random(engine);
constexpr amrex::Real two
Definition: ERF_Constants.H:8
constexpr amrex::Real one
Definition: ERF_Constants.H:7
constexpr amrex::Real zero
Definition: ERF_Constants.H:6
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:11
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getRhogivenThetaPress(const amrex::Real th, const amrex::Real p, const amrex::Real rdOcp, const amrex::Real qv=amrex::Real(0))
Definition: ERF_EOS.H:96
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getTgivenRandRTh(const amrex::Real rho, const amrex::Real rhotheta, const amrex::Real qv=amrex::Real(0))
Definition: ERF_EOS.H:46
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getThgivenTandP(const amrex::Real T, const amrex::Real P, const amrex::Real rdOcp)
Definition: ERF_EOS.H:18
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getPgivenRTh(const amrex::Real rhotheta, const amrex::Real qv=amrex::Real(0))
Definition: ERF_EOS.H:81
#define RhoScalar_comp
Definition: ERF_IndexDefines.H:40
#define Rho_comp
Definition: ERF_IndexDefines.H:36
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:37
#define RhoQ2_comp
Definition: ERF_IndexDefines.H:43
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:42
#define RhoKE_comp
Definition: ERF_IndexDefines.H:38
const Real zc
Definition: ERF_InitCustomPert_ABL.H:35
const Real yc
Definition: ERF_InitCustomPert_ABL.H:34
const Real xc
Definition: ERF_InitCustomPert_ABL.H:33
const Real dx
Definition: ERF_InitCustomPert_ABL.H:23
amrex::Real A_0
Definition: ERF_InitCustomPert_Bomex.H:6
Real T_0_Pert_Mag
Definition: ERF_InitCustomPert_Bomex.H:9
Real pert_ref_height
Definition: ERF_InitCustomPert_Bomex.H:11
const bool use_moisture
Definition: ERF_InitCustomPert_Bomex.H:14
const Real rdOcp
Definition: ERF_InitCustomPert_Bomex.H:16
amrex::Real rho_0
Definition: ERF_InitCustomPert_Bomex.H:4
amrex::Real KE_0
Definition: ERF_InitCustomPert_Bomex.H:7
ParallelForRNG(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k, const RandomEngine &engine) 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=prob_lo[2]+(k+myhalf) *dx[2];const Real xc=myhalf *(prob_lo[0]+prob_hi[0]);const Real yc=myhalf *(prob_lo[1]+prob_hi[1]);const Real zc=myhalf *(prob_lo[2]+prob_hi[2]);const Real r=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc)+(z-zc) *(z-zc));if((z<=pert_ref_height) &&(T_0_Pert_Mag !=zero)) { Real rhotheta=state(i, j, k, RhoTheta_comp);Real rho=state(i, j, k, Rho_comp);Real qv=state(i, j, k, RhoQ1_comp)/rho;Real Told=getTgivenRandRTh(rho, rhotheta, qv);Real P=getPgivenRTh(rhotheta, qv);Real rand_double=amrex::Random(engine);Real Tpert=(rand_double *two - one) *T_0_Pert_Mag;Real Tnew=Told+Tpert;Real theta_new=getThgivenTandP(Tnew, P, rdOcp);Real rhonew=getRhogivenThetaPress(theta_new, P, rdOcp, qv);state_pert(i, j, k, Rho_comp)=rhonew - rho;state_pert(i, j, k, RhoTheta_comp)=zero;} state_pert(i, j, k, RhoScalar_comp)=A_0 *exp(-amrex::Real(10.) *r *r);if(custom_TKE) { state_pert(i, j, k, RhoKE_comp)=(one - z/prob_hi[2]) *r_hse(i, j, k);} else { state_pert(i, j, k, RhoKE_comp)=KE_0;} if(use_moisture) { state_pert(i, j, k, RhoQ1_comp)=zero;state_pert(i, j, k, RhoQ2_comp)=zero;if((z<=pert_ref_height) &&(qv_0_Pert_Mag !=zero)) { Real rhoold=state(i, j, k, Rho_comp);Real rhonew=rhoold+state_pert(i, j, k, Rho_comp);Real qvold=state(i, j, k, RhoQ1_comp)/rhoold;Real rand_double=amrex::Random(engine);Real qvnew=qvold+(rand_double *two - one) *qv_0_Pert_Mag;state_pert(i, j, k, RhoQ1_comp)=rhonew *qvnew - rhoold *qvold;} } })
Real qv_0_Pert_Mag
Definition: ERF_InitCustomPert_Bomex.H:10
amrex::Real T_0
Definition: ERF_InitCustomPert_Bomex.H:5
bool custom_TKE
Definition: ERF_InitCustomPert_Bomex.H:12
state_pert(i, j, k, RhoTheta_comp)
rho
Definition: ERF_InitCustomPert_Bubble.H:106
const amrex::Real * prob_lo
Definition: ERF_InitCustomPert_IsentropicVortex.H:16
const amrex::Real * prob_hi
Definition: ERF_InitCustomPert_IsentropicVortex.H:17
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ P
Definition: ERF_IndexDefines.H:148
@ qv
Definition: ERF_Kessler.H:28