42 ParallelForRNG(
xbx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k,
const amrex::RandomEngine& engine) noexcept
45 const Real*
dx = geomdata.CellSize();
48 + z_nd(i,j+1,k) + z_nd(i,j+1,k+1) )
52 x_vel_pert(i, j, k) =
U_0;
55 Real rand_double = amrex::Random(engine);
57 x_vel_pert(i, j, k) += x_vel_prime;
63 const Real damp = std::exp(-0.5 * zl * zl);
64 x_vel_pert(i, j, k) +=
ufac * damp *
z * std::cos(
aval * yl);
69 ParallelForRNG(
ybx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k,
const amrex::RandomEngine& engine) noexcept {
71 const Real*
dx = geomdata.CellSize();
74 + z_nd(i+1,j,k) + z_nd(i+1,j,k+1) )
78 y_vel_pert(i, j, k) =
V_0;
81 Real rand_double = amrex::Random(engine);
83 y_vel_pert(i, j, k) += y_vel_prime;
89 const Real damp = std::exp(-0.5 * zl * zl);
90 y_vel_pert(i, j, k) +=
vfac * damp *
z * std::cos(
bval * xl);
95 ParallelForRNG(
zbx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k,
const amrex::RandomEngine& engine) noexcept {
96 const int dom_lo_z = geomdata.Domain().smallEnd()[2];
97 const int dom_hi_z = geomdata.Domain().bigEnd()[2];
100 if (k == dom_lo_z || k == dom_hi_z+1)
102 z_vel_pert(i, j, k) = 0.0;
106 Real rand_double = amrex::Random(engine);
108 z_vel_pert(i, j, k) =
W_0 + z_vel_prime;
constexpr amrex::Real PI
Definition: ERF_Constants.H:6
const auto dx
Definition: ERF_InitCustomPertVels_ParticleTests.H:15
const bool use_terrain
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:39
Real bval
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:35
Real aval
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:34
Real W_0_Pert_Mag
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:19
Real T_0_Pert_Mag
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:20
Real pert_ref_height
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:28
Real KE_0
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:7
const Real * prob_lo
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:30
Real rho_0
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:3
ParmParse pp_for_pert_vels("prob")
Real U_0_Pert_Mag
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:17
Real pert_periods_V
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:27
Real vfac
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:37
Real T_0
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:4
Real pert_deltaV
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:25
Real U_0
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:12
Real ufac
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:36
Real KE_decay_order
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:10
Real V_0
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:13
Real pert_deltaU
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:24
const Real * prob_hi
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:31
Real pert_periods_U
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:26
Real KE_decay_height
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:9
bool pert_rhotheta
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:21
Real W_0
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:14
Real A_0
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:6
Real V_0_Pert_Mag
Definition: ERF_InitCustomPertVels_TurbulentInflow.H:18
ParallelForRNG(xbx, [=] AMREX_GPU_DEVICE(int i, int j, int k, const amrex::RandomEngine &engine) noexcept { const Real *prob_lo=geomdata.ProbLo();const Real *dx=geomdata.CellSize();const Real y=prob_lo[1]+(j+0.5) *dx[1];const Real z=use_terrain ? 0.25 *(z_nd(i, j, k)+z_nd(i, j, k+1)+z_nd(i, j+1, k)+z_nd(i, j+1, k+1)) :prob_lo[2]+(k+0.5) *dx[2];x_vel_pert(i, j, k)=U_0;if((z<=pert_ref_height) &&(U_0_Pert_Mag !=0.0)) { Real rand_double=amrex::Random(engine);Real x_vel_prime=(rand_double *2.0 - 1.0) *U_0_Pert_Mag;x_vel_pert(i, j, k)+=x_vel_prime;} if(pert_deltaU !=0.0) { const Real yl=y - prob_lo[1];const Real zl=z/pert_ref_height;const Real damp=std::exp(-0.5 *zl *zl);x_vel_pert(i, j, k)+=ufac *damp *z *std::cos(aval *yl);} })
const Box zbx
Definition: ERF_SetupDiff.H:9
const Box xbx
Definition: ERF_SetupDiff.H:7
const Box ybx
Definition: ERF_SetupDiff.H:8
amrex::Real Real
Definition: ERF_ShocInterface.H:19
static TerrainType terrain_type
Definition: ERF_DataStruct.H:1056