9 const bool const_rho = (sc.fixed_density[lev] == 1);
13 ParallelFor(bx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept
16 const auto prob_lo = geomdata.ProbLo();
17 const auto dx = geomdata.CellSize();
20 const Real z = z_cc(i,j,k);
29 Real Tbar_hse = p_hse(i,j,k) / (
R_d * r_hse(i,j,k));
32 Real theta_perturbed = (Tbar_hse+dT)*std::pow(
p_0/p_hse(i,j,k),
rdOcp);
33 Real theta_0 = (Tbar_hse )*std::pow(
p_0/p_hse(i,j,k),
rdOcp);
36 state_pert(i, j, k,
RhoTheta_comp) = r_hse(i,j,k) * (theta_perturbed - theta_0);
constexpr amrex::Real PI
Definition: ERF_Constants.H:6
constexpr amrex::Real p_0
Definition: ERF_Constants.H:18
constexpr amrex::Real R_d
Definition: ERF_Constants.H:10
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getRhoThetagivenP(const amrex::Real p, const amrex::Real qv=0.0)
Definition: ERF_EOS.H:172
#define Rho_comp
Definition: ERF_IndexDefines.H:36
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:37
const auto dx
Definition: ERF_InitCustomPertVels_ParticleTests.H:15
const bool const_rho
Definition: ERF_InitCustomPert_DensityCurrent.H:9
Real z_c
Definition: ERF_InitCustomPert_DensityCurrent.H:4
Real x_r
Definition: ERF_InitCustomPert_DensityCurrent.H:5
const Real rdOcp
Definition: ERF_InitCustomPert_DensityCurrent.H:11
Real x_c
Definition: ERF_InitCustomPert_DensityCurrent.H:3
Real z_r
Definition: ERF_InitCustomPert_DensityCurrent.H:6
Real T_pert
Definition: ERF_InitCustomPert_DensityCurrent.H:7
ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const auto prob_lo=geomdata.ProbLo();const auto dx=geomdata.CellSize();const Real x=(prob_lo[0]+(i+0.5) *dx[0])/mf_m(i, j, 0);const Real z=z_cc(i, j, k);Real L=std::sqrt(std::pow((x - x_c)/x_r, 2)+std::pow((z - z_c)/z_r, 2));if(L<=1.0) { Real dT=T_pert *(std::cos(PI *L)+1.0)/2.0;Real Tbar_hse=p_hse(i, j, k)/(R_d *r_hse(i, j, k));Real theta_perturbed=(Tbar_hse+dT) *std::pow(p_0/p_hse(i, j, k), rdOcp);Real theta_0=(Tbar_hse) *std::pow(p_0/p_hse(i, j, k), rdOcp);if(const_rho) { state_pert(i, j, k, RhoTheta_comp)=r_hse(i, j, k) *(theta_perturbed - theta_0);} else { state_pert(i, j, k, Rho_comp)=getRhoThetagivenP(p_hse(i, j, k))/theta_perturbed - r_hse(i, j, k);} } })
const amrex::Real * prob_lo
Definition: ERF_InitCustomPert_IsentropicVortex.H:16
amrex::Real Real
Definition: ERF_ShocInterface.H:19