23 const Real dx = geomdata.CellSize(0);
24 const Real dy = geomdata.CellSize(1);
47 amrex::Print() <<
"Adding random rho*theta perturbations" << std::endl;
49 amrex::Print() <<
"Adding random theta perturbations" << std::endl;
55 ParallelForRNG(bx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k,
const amrex::RandomEngine& engine) noexcept
59 const Real z = z_cc(i,j,k);
65 Real rand_double = amrex::Random(engine);
#define RhoScalar_comp
Definition: ERF_IndexDefines.H:40
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:37
#define RhoKE_comp
Definition: ERF_IndexDefines.H:38
const Real prob_lo_z
Definition: ERF_InitCustomPert_ABL.H:27
const Real prob_lo_y
Definition: ERF_InitCustomPert_ABL.H:26
ParallelForRNG(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k, const amrex::RandomEngine &engine) noexcept { const Real x=prob_lo_x+(i+0.5) *dx;const Real y=prob_lo_y+(j+0.5) *dy;const Real z=z_cc(i, j, k);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(!pert_rhotheta) { state_pert(i, j, k, RhoTheta_comp) *=r_hse(i, j, k);} } state_pert(i, j, k, RhoScalar_comp)=A_0 *exp(-10.*r *r);if(state_pert.nComp() > RhoKE_comp) { if(rhoKE_0 > 0) { state_pert(i, j, k, RhoKE_comp)=rhoKE_0;} else { state_pert(i, j, k, RhoKE_comp)=r_hse(i, j, k) *KE_0;} if(KE_decay_height > 0) { state_pert(i, j, k, RhoKE_comp) *=amrex::max(std::pow(1 - amrex::min(z/KE_decay_height, 1.0), KE_decay_order), 1e-12);} } })
Real T_0_Pert_Mag
Definition: ERF_InitCustomPert_ABL.H:14
Real pert_ref_height
Definition: ERF_InitCustomPert_ABL.H:20
Real KE_0
Definition: ERF_InitCustomPert_ABL.H:7
const Real dy
Definition: ERF_InitCustomPert_ABL.H:24
Real rho_0
Definition: ERF_InitCustomPert_ABL.H:4
const Real zc
Definition: ERF_InitCustomPert_ABL.H:35
Real rhoKE_0
Definition: ERF_InitCustomPert_ABL.H:8
const Real yc
Definition: ERF_InitCustomPert_ABL.H:34
const Real prob_lo_x
Definition: ERF_InitCustomPert_ABL.H:25
Real T_0
Definition: ERF_InitCustomPert_ABL.H:5
Real pert_deltaV
Definition: ERF_InitCustomPert_ABL.H:19
const Real prob_hi_y
Definition: ERF_InitCustomPert_ABL.H:29
const Real prob_hi_x
Definition: ERF_InitCustomPert_ABL.H:28
Real KE_decay_order
Definition: ERF_InitCustomPert_ABL.H:11
Real pert_deltaU
Definition: ERF_InitCustomPert_ABL.H:18
const Real prob_hi_z
Definition: ERF_InitCustomPert_ABL.H:30
Real KE_decay_height
Definition: ERF_InitCustomPert_ABL.H:10
bool pert_rhotheta
Definition: ERF_InitCustomPert_ABL.H:15
Real A_0
Definition: ERF_InitCustomPert_ABL.H:6
const Real xc
Definition: ERF_InitCustomPert_ABL.H:33
const Real dx
Definition: ERF_InitCustomPert_ABL.H:23
state_pert(i, j, k, RhoTheta_comp)
amrex::Real Real
Definition: ERF_ShocInterface.H:19