26 const bool use_moisture = (sc.moisture_type != MoistureType::None);
30 ParallelForRNG(bx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k,
const amrex::RandomEngine& engine) noexcept {
34 const Real*
dx = geomdata.CellSize();
48 Real rand_double = amrex::Random(engine);
52 Real rand_double = amrex::Random(engine);
71 const Real damp = std::exp(-0.5 * zl * zl);
80 Real Tnew = Told + Tpert;
92 const Real damp = std::exp(-0.5 * zl * zl);
100 state_pert(i, j, k,
RhoQ1_comp) = rhonew * qvnew - rhoold * qvold;
constexpr amrex::Real PI
Definition: ERF_Constants.H:42
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:43
#define Rho_comp
Definition: ERF_IndexDefines.H:39
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:40
#define RhoQ2_comp
Definition: ERF_IndexDefines.H:46
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:45
#define RhoKE_comp
Definition: ERF_IndexDefines.H:41
const Real zc
Definition: ERF_InitCustomPert_ABL.H:56
const Real yc
Definition: ERF_InitCustomPert_ABL.H:55
const Real xc
Definition: ERF_InitCustomPert_ABL.H:54
const Real dx
Definition: ERF_InitCustomPert_ABL.H:44
const GpuArray< Real, AMREX_SPACEDIM > prob_lo
Definition: ERF_InitCustomPert_CloudChamber.H:33
const amrex::Real * prob_hi
Definition: ERF_InitCustomPert_DataAssimilation_ISV.H:17
Real pert_periods_QV
Definition: ERF_InitCustomPert_SDMCongestus3DCold.H:16
amrex::Real A_0
Definition: ERF_InitCustomPert_SDMCongestus3DCold.H:6
Real T_0_Pert_Mag
Definition: ERF_InitCustomPert_SDMCongestus3DCold.H:9
Real pert_ref_height
Definition: ERF_InitCustomPert_SDMCongestus3DCold.H:11
const bool use_moisture
Definition: ERF_InitCustomPert_SDMCongestus3DCold.H:26
ParallelForRNG(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k, const amrex::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+0.5) *dx[0];const Real y=prob_lo[1]+(j+0.5) *dx[1];const Real z=prob_lo[2]+(k+0.5) *dx[2];const Real xc=0.5 *(prob_lo[0]+prob_hi[0]);const Real yc=0.5 *(prob_lo[1]+prob_hi[1]);const Real zc=0.5 *(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 !=0.0)) { Real rand_double=amrex::Random(engine);state_pert(i, j, k, RhoTheta_comp)=(rand_double *2.0 - 1.0) *T_0_Pert_Mag;} if((z<=pert_ref_height) &&(Q_0_Pert_Mag !=0.0)) { Real rand_double=amrex::Random(engine);state_pert(i, j, k, RhoQ1_comp)=(rand_double *2.0 - 1.0) *Q_0_Pert_Mag;} state_pert(i, j, k, RhoScalar_comp)=A_0 *exp(-10.*r *r);state_pert(i, j, k, RhoKE_comp)=KE_0;if(use_moisture) { state_pert(i, j, k, RhoQ1_comp)=0.0;state_pert(i, j, k, RhoQ2_comp)=0.0;} if(pert_deltaT !=0.0) { const Real zl=z/pert_ref_height;const Real damp=std::exp(-0.5 *zl *zl);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 Tpert=tfac *damp *z *std::cos(cval *(x - xc));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)=0.0;} if(use_moisture &&pert_deltaQV !=0.0) { const Real zl=z/pert_ref_height;const Real damp=std::exp(-0.5 *zl *zl);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 qvnew=qvold+qvfac *damp *z *std::cos(dval *(x - xc));state_pert(i, j, k, RhoQ1_comp)=rhonew *qvnew - rhoold *qvold;} })
Real dval
Definition: ERF_InitCustomPert_SDMCongestus3DCold.H:22
const Real rdOcp
Definition: ERF_InitCustomPert_SDMCongestus3DCold.H:28
Real Q_0_Pert_Mag
Definition: ERF_InitCustomPert_SDMCongestus3DCold.H:10
amrex::Real rho_0
Definition: ERF_InitCustomPert_SDMCongestus3DCold.H:4
auto probhi_arr
Definition: ERF_InitCustomPert_SDMCongestus3DCold.H:19
Real tfac
Definition: ERF_InitCustomPert_SDMCongestus3DCold.H:23
amrex::Real KE_0
Definition: ERF_InitCustomPert_SDMCongestus3DCold.H:7
auto problo_arr
Definition: ERF_InitCustomPert_SDMCongestus3DCold.H:18
Real pert_deltaQV
Definition: ERF_InitCustomPert_SDMCongestus3DCold.H:14
Real pert_periods_T
Definition: ERF_InitCustomPert_SDMCongestus3DCold.H:15
Real qvfac
Definition: ERF_InitCustomPert_SDMCongestus3DCold.H:24
Real pert_deltaT
Definition: ERF_InitCustomPert_SDMCongestus3DCold.H:13
amrex::Real T_0
Definition: ERF_InitCustomPert_SDMCongestus3DCold.H:5
Real cval
Definition: ERF_InitCustomPert_SDMCongestus3DCold.H:21
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ P
Definition: ERF_IndexDefines.H:204
@ rho
Definition: ERF_Kessler.H:24
@ qv
Definition: ERF_Kessler.H:30