14 ParallelFor(bx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept
19 const Real*
dx = geomdata.CellSize();
34 const Real r2d_xz = std::sqrt((
x-
xc)*(
x-
xc) + (
z-zc)*(
z-zc));
43 state_pert(i, j, k,
RhoScalar_comp) =
A_0 * 0.25 * (1.0 + std::cos(
PI * std::min(r2d_xy, r0) / r0));
45 state_pert(i, j, k,
RhoScalar_comp) =
A_0 * 0.25 * (1.0 + std::cos(
PI * std::min(r2d_xz, r0) / r0));
49 const Real r2d_xz_ell = std::sqrt((
x-
xc)*(
x-
xc)/(r0*r0) + (
z-zc)*(
z-zc)/(r0_z*r0_z));
50 state_pert(i, j, k,
RhoScalar_comp) =
A_0 * 0.25 * (1.0 + std::cos(
PI * std::min(r2d_xz_ell, r0_z) / r0_z));
constexpr amrex::Real PI
Definition: ERF_Constants.H:6
#define RhoScalar_comp
Definition: ERF_IndexDefines.H:40
const auto dx
Definition: ERF_InitCustomPertVels_ParticleTests.H:15
const amrex::Real * prob_lo
Definition: ERF_InitCustomPert_IsentropicVortex.H:16
amrex::Real yc
Definition: ERF_InitCustomPert_IsentropicVortex.H:20
const amrex::Real * prob_hi
Definition: ERF_InitCustomPert_IsentropicVortex.H:17
amrex::Real xc
Definition: ERF_InitCustomPert_IsentropicVortex.H:19
Real B_0
Definition: ERF_InitCustomPert_ScalarAdvDiff.H:5
Real zc_frac
Definition: ERF_InitCustomPert_ScalarAdvDiff.H:11
Real xc_frac
Definition: ERF_InitCustomPert_ScalarAdvDiff.H:9
Real rho_0
Definition: ERF_InitCustomPert_ScalarAdvDiff.H:3
ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) 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=xc_frac *(prob_lo[0]+prob_hi[0]);const Real yc=yc_frac *(prob_lo[1]+prob_hi[1]);const Real zc=zc_frac *(prob_lo[2]+prob_hi[2]);const Real r0=rad_0 *(prob_hi[0] - prob_lo[0]);const Real r3d=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc)+(z-zc) *(z-zc));const Real r2d_xy=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc));const Real r2d_xz=std::sqrt((x-xc) *(x-xc)+(z-zc) *(z-zc));if(prob_type==10) { state_pert(i, j, k, RhoScalar_comp)=A_0 *exp(-10.*r3d *r3d)+B_0 *sin(x);} else if(prob_type==11) { state_pert(i, j, k, RhoScalar_comp)=A_0 *0.25 *(1.0+std::cos(PI *std::min(r2d_xy, r0)/r0));} else if(prob_type==12) { state_pert(i, j, k, RhoScalar_comp)=A_0 *0.25 *(1.0+std::cos(PI *std::min(r2d_xz, r0)/r0));} else if(prob_type==13) { const Real r0_z=rad_0 *(prob_hi[2] - prob_lo[2]);const Real r2d_xz_ell=std::sqrt((x-xc) *(x-xc)/(r0 *r0)+(z-zc) *(z-zc)/(r0_z *r0_z));state_pert(i, j, k, RhoScalar_comp)=A_0 *0.25 *(1.0+std::cos(PI *std::min(r2d_xz_ell, r0_z)/r0_z));} else if(prob_type==14) { state_pert(i, j, k, RhoScalar_comp)=std::cos(PI *x);} else { if(r3d< r0) { state_pert(i, j, k, RhoScalar_comp)=A_0;} else { state_pert(i, j, k, RhoScalar_comp)=0.0;} } state_pert(i, j, k, RhoScalar_comp) *=rho_0;})
Real yc_frac
Definition: ERF_InitCustomPert_ScalarAdvDiff.H:10
int prob_type
Definition: ERF_InitCustomPert_ScalarAdvDiff.H:13
Real A_0
Definition: ERF_InitCustomPert_ScalarAdvDiff.H:4
Real rad_0
Definition: ERF_InitCustomPert_ScalarAdvDiff.H:6
amrex::Real Real
Definition: ERF_ShocInterface.H:19