|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
#include <ERF_Constants.H>#include <ERF_TerrainMetrics.H>#include <AMReX.H>#include <AMReX_REAL.H>#include <AMReX_Array.H>#include <AMReX_Array4.H>#include <AMReX_Algorithm.H>#include <AMReX_Math.H>#include <cmath>

Go to the source code of this file.
Functions | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_InvDt_Compressible (const int i, const int j, const int k, const amrex::Real c, const amrex::Real u, const amrex::Real v, const amrex::Real w, const amrex::Array4< const amrex::Real > &z_nd, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dxinv, const bool l_terrain_aware, const bool l_substepping, const int nxc=2, const int nyc=2) |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | Compute_InvDt_Anelastic (const int i, const int j, const int k, const amrex::Real u, const amrex::Real v, const amrex::Real w, const amrex::Array4< const amrex::Real > &z_nd, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dxinv, const bool l_terrain_aware) |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_InvDt_Anelastic | ( | const int | i, |
| const int | j, | ||
| const int | k, | ||
| const amrex::Real | u, | ||
| const amrex::Real | v, | ||
| const amrex::Real | w, | ||
| const amrex::Array4< const amrex::Real > & | z_nd, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | dxinv, | ||
| const bool | l_terrain_aware | ||
| ) |
Pointwise inverse time step (1/dt, before the CFL is applied) for the anelastic (low Mach) solver – this is a purely advective constraint.
As above, the metric terms are computed here from z_nd:
terrain aware : the vertical spacing is the local dxinv[2]/h_zeta and w should be the contravariant (Omega) vertical velocity terrain unaware : the vertical spacing is dxinv[2] and w should be the Cartesian vertical velocity
The slope metrics h_xi and h_eta do not appear explicitly: for the advective constraint their effect is already carried by Omega, which is the vertical velocity relative to the terrain-following surfaces.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | u | cell-centered x-velocity |
| [in] | v | cell-centered y-velocity |
| [in] | w | cell-centered vertical velocity (Omega if terrain aware) |
| [in] | z_nd | nodal physical height field (not accessed if terrain unaware) |
| [in] | dxinv | inverse cell spacing of the computational mesh |
| [in] | l_terrain_aware | true to include the metric terms |
Referenced by ERF::estTimeStep().


| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_InvDt_Compressible | ( | const int | i, |
| const int | j, | ||
| const int | k, | ||
| const amrex::Real | c, | ||
| const amrex::Real | u, | ||
| const amrex::Real | v, | ||
| const amrex::Real | w, | ||
| const amrex::Array4< const amrex::Real > & | z_nd, | ||
| const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & | dxinv, | ||
| const bool | l_terrain_aware, | ||
| const bool | l_substepping, | ||
| const int | nxc = 2, |
||
| const int | nyc = 2 |
||
| ) |
Pointwise inverse time step (1/dt, before the CFL is applied) for the compressible solver.
The terrain metric terms are computed here from z_nd, so the same routine returns either the terrain aware or the terrain unaware estimate:
terrain aware : h_xi and h_eta are retained and the vertical spacing is the local dxinv[2]/h_zeta – w should be the contravariant (Omega) vertical velocity terrain unaware : h_xi = h_eta = 0 and the vertical spacing is dxinv[2] – w should be the Cartesian vertical velocity
Note that dxinv[2]*(h_xi/h_zeta) == h_xi*idz, which is why h_zeta only ever enters through idz.
| [in] | i | x-index |
| [in] | j | y-index |
| [in] | k | z-index |
| [in] | c | sound speed |
| [in] | u | cell-centered x-velocity |
| [in] | v | cell-centered y-velocity |
| [in] | w | cell-centered vertical velocity (Omega if terrain aware) |
| [in] | z_nd | nodal physical height field (not accessed if terrain unaware) |
| [in] | dxinv | inverse cell spacing of the computational mesh |
| [in] | l_terrain_aware | true to include the metric terms |
| [in] | l_substepping | true if implicit acoustic substepping is used |
| [in] | nxc | number of cells in x on the level 0 domain |
| [in] | nyc | number of cells in y on the level 0 domain |
Referenced by ERF::estTimeStep().

