38 const GpuArray<Real,AMREX_SPACEDIM>
prob_lo{AMREX_D_DECL(geomdata.ProbLo(0), geomdata.ProbLo(1), geomdata.ProbLo(2))};
39 const GpuArray<Real,AMREX_SPACEDIM>
prob_hi{AMREX_D_DECL(geomdata.ProbHi(0), geomdata.ProbHi(1), geomdata.ProbHi(2))};
50 amrex::Print() <<
"Adding divergence-free perturbations "
55 amrex::Print() <<
"Adding random x-velocity perturbations" << std::endl;
58 amrex::Print() <<
"Adding random y-velocity perturbations" << std::endl;
62 amrex::Print() <<
"Adding random rho*theta perturbations" << std::endl;
64 amrex::Print() <<
"Adding random theta perturbations" << std::endl;
69 ParallelForRNG(bx, [=,one_d=
one] AMREX_GPU_DEVICE(
int i,
int j,
int k,
const amrex::RandomEngine& engine) noexcept
71 const Real*
dx = geomdata.CellSize();
74 const Real z = z_cc(i,j,k);
86 Real rand_double = amrex::Random(engine);
#define RhoScalar_comp
Definition: ERF_IndexDefines.H:57
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:54
#define RhoKE_comp
Definition: ERF_IndexDefines.H:55
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_TurbulentInflow.H:38
Real W_0_Pert_Mag
Definition: ERF_InitCustomPert_TurbulentInflow.H:25
Real T_0_Pert_Mag
Definition: ERF_InitCustomPert_TurbulentInflow.H:26
Real pert_ref_height
Definition: ERF_InitCustomPert_TurbulentInflow.H:34
Real KE_0
Definition: ERF_InitCustomPert_TurbulentInflow.H:13
Real rho_0
Definition: ERF_InitCustomPert_TurbulentInflow.H:9
const Real phys_z_hi
Definition: ERF_InitCustomPert_TurbulentInflow.H:5
Real U_0_Pert_Mag
Definition: ERF_InitCustomPert_TurbulentInflow.H:23
ParallelForRNG(bx, [=, one_d=one] AMREX_GPU_DEVICE(int i, int j, int k, const amrex::RandomEngine &engine) noexcept { 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=z_cc(i, j, k);const Real z_agl=z - erf_prob_heights::z_ground_cc(i, j, z_sfc_nd);const Real xc=myhalf *(prob_lo[0]+prob_hi[0]);const Real yc=myhalf *(prob_lo[1]+prob_hi[1]);const Real zc=myhalf *(phys_z_lo+phys_z_hi);const Real r=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc)+(z-zc) *(z-zc));if((z_agl<=pert_ref_height) &&(T_0_Pert_Mag !=zero)) { Real rand_double=amrex::Random(engine);state_pert(i, j, k, RhoTheta_comp)=(rand_double *two - one_d) *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 *std::exp(-amrex::Real(10.) *r *r);if(state_pert.nComp() > RhoKE_comp) { 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) *=max(std::pow(1 - min(z_agl/KE_decay_height, one_d), KE_decay_order), amrex::Real(1e-12));} } })
Real pert_periods_V
Definition: ERF_InitCustomPert_TurbulentInflow.H:33
Real T_0
Definition: ERF_InitCustomPert_TurbulentInflow.H:10
Real pert_deltaV
Definition: ERF_InitCustomPert_TurbulentInflow.H:31
Real U_0
Definition: ERF_InitCustomPert_TurbulentInflow.H:18
Real KE_decay_order
Definition: ERF_InitCustomPert_TurbulentInflow.H:16
Real V_0
Definition: ERF_InitCustomPert_TurbulentInflow.H:19
Real pert_deltaU
Definition: ERF_InitCustomPert_TurbulentInflow.H:30
Real pert_periods_U
Definition: ERF_InitCustomPert_TurbulentInflow.H:32
Real KE_decay_height
Definition: ERF_InitCustomPert_TurbulentInflow.H:15
const GpuArray< Real, AMREX_SPACEDIM > prob_hi
Definition: ERF_InitCustomPert_TurbulentInflow.H:39
bool pert_rhotheta
Definition: ERF_InitCustomPert_TurbulentInflow.H:27
Real W_0
Definition: ERF_InitCustomPert_TurbulentInflow.H:20
Real A_0
Definition: ERF_InitCustomPert_TurbulentInflow.H:12
Real V_0_Pert_Mag
Definition: ERF_InitCustomPert_TurbulentInflow.H:24
const Real phys_z_lo
Definition: ERF_InitCustomPert_TurbulentInflow.H:4
constexpr amrex::Real two
Definition: ERF_NumericalConstants.H:38
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:37
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
constexpr amrex::Real myhalf
Definition: ERF_NumericalConstants.H:41
amrex::Real Real
Definition: ERF_ShocInterface.H:19
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real z_ground_cc(int i, int j, amrex::Array4< amrex::Real const > const &z_sfc_nd) noexcept
Definition: ERF_ProbHeights.H:49