ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_SlowRhsPreUtils.H
Go to the documentation of this file.
1 #ifndef ERF_SLOW_RHS_PRE_UTILS_H_
2 #define ERF_SLOW_RHS_PRE_UTILS_H_
3 
4 #include <AMReX_Array4.H>
5 
6 #include <ERF_Constants.H>
7 
8 /**
9  * Return the pressure and buoyancy contribution to the vertical momentum RHS.
10  *
11  * The moisture inertia is face-centered from the two adjacent cell values,
12  * matching the z-momentum staggering in erf_slow_rhs_pre. In a dry run the
13  * moisture array is not read.
14  */
15 AMREX_GPU_HOST_DEVICE
16 AMREX_FORCE_INLINE
18 slow_rhs_pre_z_pressure_buoyancy (const amrex::Array4<const amrex::Real>& qt_arr,
19  int i, int j, int k, bool use_moisture,
20  amrex::Real gpz, amrex::Real abl_pressure_grad_z,
21  amrex::Real buoyancy)
22 {
24  ? myhalf * (qt_arr(i,j,k) + qt_arr(i,j,k-1))
25  : zero;
26  return (-gpz - abl_pressure_grad_z + buoyancy) / (one + q);
27 }
28 
29 #endif
const bool use_moisture
Definition: ERF_InitCustomPert_ABL.H:71
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
amrex::Real Real
Definition: ERF_ShocInterface.H:19
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real slow_rhs_pre_z_pressure_buoyancy(const amrex::Array4< const amrex::Real > &qt_arr, int i, int j, int k, bool use_moisture, amrex::Real gpz, amrex::Real abl_pressure_grad_z, amrex::Real buoyancy)
Definition: ERF_SlowRhsPreUtils.H:18
@ gpz
Definition: ERF_IndexDefines.H:229
@ q
Definition: ERF_WSM6.H:273