13 Real coriolis_factor = 4.0 *
PI / rot_time_period;
19 Vector<Real> abl_geo_wind(3);
21 AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
22 (amrex::Math::abs(abl_geo_wind[1]) < 1.0e-15) &&
23 (amrex::Math::abs(abl_geo_wind[2]) < 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(2.0 * Az / coriolis_factor);
28 const Real a = 1.0 / DE;
31 ParallelFor(
xbx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept {
32 const auto dx = geomdata.CellSize();
33 const Real z = (k + 0.5) *
dx[2];
36 x_vel_pert(i, j, k) = u_0 * (1.0 - 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();
42 const Real z = (k + 0.5) *
dx[2];
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) = 0.0;
constexpr amrex::Real PI
Definition: ERF_Constants.H:6
Real rho_0
Definition: ERF_InitCustomPertVels_EkmanSpiral.H:7
ParmParse pp_for_pert_vels("erf")
const auto dx
Definition: ERF_InitCustomPertVels_ParticleTests.H:15
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 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