ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_InitCustomPertVels_EkmanSpiral.H File Reference

Go to the source code of this file.

Functions

ParmParse pp_for_pert_vels ("erf")
 
pp_for_pert_vels query_enum_case_insensitive ("init_type", init_type)
 
ParmParse pp_for_pert_vels_prob ("prob")
 
pp_for_pert_vels_prob query ("rho_0", rho_0)
 
 if (init_type==InitType::Uniform)
 

Variables

const bool use_z_phys = use_physical_z()
 
const Real phys_z_lo = phys_zlo(geomdata, lev)
 
InitType init_type = InitType::None
 
Real rho_0 = one
 

Function Documentation

◆ if()

if ( init_type  = = InitType::Uniform)
15  {
16  double rot_time_period;
17  pp_for_pert_vels.get("rotational_time_period", rot_time_period);
18  Real coriolis_factor = static_cast<Real>(4.0 * PI / rot_time_period);
19 
20  Real Az;
21  pp_for_pert_vels.get("dynamic_viscosity", Az); // dynamic viscosity [kg-m/s]
22  Az = Az / rho_0; // kinematic viscosity [m^2/s]
23 
24  Vector<Real> abl_geo_wind(3);
25  pp_for_pert_vels.queryarr("abl_geo_wind",abl_geo_wind);
27  (amrex::Math::abs(abl_geo_wind[1]) < amrex::Real(1.0e-15)) &&
28  (amrex::Math::abs(abl_geo_wind[2]) < amrex::Real(1.0e-15)),
29  "Ekman Spiral uses geostrophic forcing of the form (V_0, 0, 0)");
30  const Real u_0 = abl_geo_wind[0];
31 
32  const Real DE = std::sqrt(two * Az / coriolis_factor);
33  const Real a = one / DE;
34 
35  // Set the x-velocity
36  ParallelFor(xbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
37  const auto dx = geomdata.CellSize();
38  const Real z = use_z_phys ? erf_prob_heights::z_xface(i,j,k,z_nd) - phys_z_lo : (k + myhalf) * dx[2];
39 
40  // Set the x-velocity
41  x_vel_pert(i, j, k) = u_0 * (one - std::exp(-a * z) * std::cos(-a * z));
42  });
43 
44  // Set the y-velocity
45  ParallelFor(ybx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
46  const auto dx = geomdata.CellSize();
47  const Real z = use_z_phys ? erf_prob_heights::z_yface(i,j,k,z_nd) - phys_z_lo : (k + myhalf) * dx[2];
48 
49  // Set the y-velocity
50  y_vel_pert(i, j, k) = -u_0 * std::exp(-a * z) * std::sin(-a * z);
51  });
52 
53  // Set the z-velocity
54  ParallelFor(zbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
55  z_vel_pert(i, j, k) = zero;
56  });
57  } // end if uniform
const bool use_z_phys
Definition: ERF_InitCustomPertVels_EkmanSpiral.H:4
Real rho_0
Definition: ERF_InitCustomPertVels_EkmanSpiral.H:12
ParmParse pp_for_pert_vels("erf")
const Real phys_z_lo
Definition: ERF_InitCustomPertVels_EkmanSpiral.H:5
const Real dx
Definition: ERF_InitCustomPert_ABL.H:44
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(axis >=0 &&axis< AMREX_SPACEDIM, "prob.axis must be 0, 1 or 2")
ParallelFor(fab_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) { qrcuten_arr(i, j, k)=Real(0);qscuten_arr(i, j, k)=Real(0);qicuten_arr(i, j, k)=Real(0);})
constexpr amrex::Real two
Definition: ERF_NumericalConstants.H:38
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:37
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
constexpr amrex::Real myhalf
Definition: ERF_NumericalConstants.H:41
constexpr amrex::Real PI
Definition: ERF_NumericalConstants.H:46
amrex::Real Real
Definition: ERF_ShocInterface.H:19
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real z_yface(int i, int j, int k, amrex::Array4< amrex::Real const > const &z_nd) noexcept
Height of the centre of y-face (i,j,k)
Definition: ERF_ProbHeights.H:30
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real z_xface(int i, int j, int k, amrex::Array4< amrex::Real const > const &z_nd) noexcept
Height of the centre of x-face (i,j,k)
Definition: ERF_ProbHeights.H:21
Here is the call graph for this function:

◆ pp_for_pert_vels()

ParmParse pp_for_pert_vels ( "erf"  )

Referenced by if().

Here is the caller graph for this function:

◆ pp_for_pert_vels_prob()

ParmParse pp_for_pert_vels_prob ( "prob"  )

◆ query()

pp_for_pert_vels_prob query ( "rho_0"  ,
rho_0   
)

◆ query_enum_case_insensitive()

pp_for_pert_vels query_enum_case_insensitive ( "init_type"  ,
init_type   
)

Variable Documentation

◆ init_type

InitType init_type = InitType::None

◆ phys_z_lo

const Real phys_z_lo = phys_zlo(geomdata, lev)

Referenced by if().

◆ rho_0

Real rho_0 = one

Referenced by if().

◆ use_z_phys

const bool use_z_phys = use_physical_z()

Referenced by if().