19 Vector<Real> abl_geo_wind(3);
21 AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
22 (amrex::Math::abs(abl_geo_wind[1]) <
amrex::Real(1.0e-15)) &&
23 (amrex::Math::abs(abl_geo_wind[2]) <
amrex::Real(1.0e-15)),
24 "Ekman Spiral uses geostrophic forcing of the form (V_0, 0, 0)");
25 const Real u_0 = abl_geo_wind[0];
27 const Real DE = std::sqrt(
two * Az / coriolis_factor);
31 ParallelFor(
xbx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept {
32 const auto dx = geomdata.CellSize();
36 x_vel_pert(i, j, k) = u_0 * (
one - std::exp(-a * z) * std::cos(-a * z));
40 ParallelFor(
ybx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept {
41 const auto dx = geomdata.CellSize();
45 y_vel_pert(i, j, k) = -u_0 * std::exp(-a * z) * std::sin(-a * z);
49 ParallelFor(
zbx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept {
50 z_vel_pert(i, j, k) =
zero;
constexpr amrex::Real two
Definition: ERF_Constants.H:8
constexpr amrex::Real one
Definition: ERF_Constants.H:7
constexpr amrex::Real zero
Definition: ERF_Constants.H:6
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:11
constexpr amrex::Real PI
Definition: ERF_Constants.H:16
Real rho_0
Definition: ERF_InitCustomPertVels_EkmanSpiral.H:7
ParmParse pp_for_pert_vels("erf")
const Real dx
Definition: ERF_InitCustomPert_ABL.H:23
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+myhalf) *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<=one) { Real dT=T_pert *(std::cos(PI *L)+one)/two;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 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