30 amrex::Print() <<
"Adding divergence-free perturbations "
35 amrex::Print() <<
"Adding random x-velocity perturbations" << std::endl;
38 amrex::Print() <<
"Adding random y-velocity perturbations" << std::endl;
43 ParallelForRNG(
xbx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k,
const amrex::RandomEngine& engine) noexcept {
45 const Real*
dx = geomdata.CellSize();
47 const Real z = (z_nd) ? 0.25*( z_nd(i,j ,k) + z_nd(i,j ,k+1)
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;
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
72 const Real*
dx = geomdata.CellSize();
74 const Real z = (z_nd) ? 0.25*( z_nd(i ,j,k) + z_nd(i ,j,k+1)
75 + z_nd(i+1,j,k) + z_nd(i+1,j,k+1) )
79 y_vel_pert(i, j, k) =
V_0;
82 Real rand_double = amrex::Random(engine);
84 y_vel_pert(i, j, k) += y_vel_prime;
91 y_vel_pert(i, j, k) +=
vfac * damp *
z * std::cos(
bval * xl);
96 ParallelForRNG(
zbx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k,
const amrex::RandomEngine& engine) noexcept
98 const int dom_lo_z = geomdata.Domain().smallEnd()[2];
99 const int dom_hi_z = geomdata.Domain().bigEnd()[2];
102 if (k == dom_lo_z || k == dom_hi_z+1)
104 z_vel_pert(i, j, k) = 0.0;
108 Real rand_double = amrex::Random(engine);
110 z_vel_pert(i, j, k) =
W_0 + z_vel_prime;
constexpr amrex::Real PI
Definition: ERF_Constants.H:6
Real bval
Definition: ERF_InitCustomPertVels_ABL.H:24
Real aval
Definition: ERF_InitCustomPertVels_ABL.H:23
Real W_0_Pert_Mag
Definition: ERF_InitCustomPertVels_ABL.H:11
Real pert_ref_height
Definition: ERF_InitCustomPertVels_ABL.H:18
auto probhi
Definition: ERF_InitCustomPertVels_ABL.H:21
ParmParse pp_prob("prob")
Real U_0_Pert_Mag
Definition: ERF_InitCustomPertVels_ABL.H:9
Real pert_periods_V
Definition: ERF_InitCustomPertVels_ABL.H:17
Real vfac
Definition: ERF_InitCustomPertVels_ABL.H:26
Real pert_deltaV
Definition: ERF_InitCustomPertVels_ABL.H:15
Real U_0
Definition: ERF_InitCustomPertVels_ABL.H:4
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=(z_nd) ? 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 amrex::Real yl=y - prob_lo[1];const amrex::Real zl=z/pert_ref_height;const amrex::Real damp=std::exp(-0.5 *zl *zl);x_vel_pert(i, j, k)+=ufac *damp *z *std::cos(aval *yl);} })
Real ufac
Definition: ERF_InitCustomPertVels_ABL.H:25
Real V_0
Definition: ERF_InitCustomPertVels_ABL.H:5
Real pert_deltaU
Definition: ERF_InitCustomPertVels_ABL.H:14
Real pert_periods_U
Definition: ERF_InitCustomPertVels_ABL.H:16
Real W_0
Definition: ERF_InitCustomPertVels_ABL.H:6
Real V_0_Pert_Mag
Definition: ERF_InitCustomPertVels_ABL.H:10
auto problo
Definition: ERF_InitCustomPertVels_ABL.H:20
const Real dx
Definition: ERF_InitCustomPert_ABL.H:23
const amrex::Real * prob_lo
Definition: ERF_InitCustomPert_IsentropicVortex.H:16
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