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 Real *dx=geomdata.CellSize();const Real x=(i+0.5) *dx[0];const Real y=(j+0.5) *dx[1];const Real Omg=erf_vortex_Gaussian(x, y, xc, yc, R, beta, sigma);const Real deltaT=-(gamma - 1.0)/(2.0 *sigma *sigma) *Omg *Omg;const Real rho_norm=std::pow(1.0+deltaT, inv_gm1);const Real T=(1.0+deltaT) *T_inf;const Real p=std::pow(rho_norm, Gamma)/Gamma *rho_0 *a_inf *a_inf;const Real rho_theta=rho_0 *rho_norm *(T *std::pow(p_0/p, rdOcp));state_pert(i, j, k, RhoTheta_comp)=rho_theta - getRhoThetagivenP(p_hse(i, j, k));const Real r2d_xy=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc));state_pert(i, j, k, RhoScalar_comp)=0.25 *(1.0+std::cos(PI *std::min(r2d_xy, R)/R));})
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