ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_Advection.H File Reference
#include <AMReX.H>
#include <AMReX_MultiFab.H>
#include <AMReX_BCRec.H>
#include <AMReX_YAFluxRegister.H>
#include <ERF_DataStruct.H>
#include <ERF_IndexDefines.H>
#include <ERF_ABLMost.H>
Include dependency graph for ERF_Advection.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void AdvectionSrcForRho (const amrex::Box &bx, const amrex::Array4< amrex::Real > &src, const amrex::Array4< const amrex::Real > &rho_u, const amrex::Array4< const amrex::Real > &rho_v, const amrex::Array4< const amrex::Real > &omega, const amrex::Array4< amrex::Real > &avg_xmom, const amrex::Array4< amrex::Real > &avg_ymom, const amrex::Array4< amrex::Real > &avg_zmom, const amrex::Array4< const amrex::Real > &ax_arr, const amrex::Array4< const amrex::Real > &ay_arr, const amrex::Array4< const amrex::Real > &az_arr, const amrex::Array4< const amrex::Real > &detJ, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &mf_m, const amrex::Array4< const amrex::Real > &mf_u, const amrex::Array4< const amrex::Real > &mf_v, const amrex::GpuArray< const amrex::Array4< amrex::Real >, AMREX_SPACEDIM > &flx_arr, const bool const_rho)
 
void AdvectionSrcForScalars (const amrex::Real &dt, const amrex::Box &bx, const int icomp, const int ncomp, const amrex::Array4< const amrex::Real > &avg_xmom, const amrex::Array4< const amrex::Real > &avg_ymom, const amrex::Array4< const amrex::Real > &avg_zmom, const amrex::Array4< const amrex::Real > &cur_cons, const amrex::Array4< const amrex::Real > &cell_prim, const amrex::Array4< amrex::Real > &src, const bool &use_mono_adv, amrex::Real *max_s_ptr, amrex::Real *min_s_ptr, const amrex::Array4< const amrex::Real > &vf_arr, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &mf_m, const AdvType horiz_adv_type, const AdvType vert_adv_type, const amrex::Real horiz_upw_frac, const amrex::Real vert_upw_frac, const amrex::GpuArray< const amrex::Array4< amrex::Real >, AMREX_SPACEDIM > &flx_arr, const amrex::GpuArray< amrex::Array4< amrex::Real >, AMREX_SPACEDIM > &flx_tmp_arr, const amrex::Box &domain, const amrex::BCRec *bc_ptr_h)
 
void AdvectionSrcForMom (const amrex::Box &bx, const amrex::Box &bxx, const amrex::Box &bxy, const amrex::Box &bxz, const amrex::Array4< amrex::Real > &rho_u_rhs, const amrex::Array4< amrex::Real > &rho_v_rhs, const amrex::Array4< amrex::Real > &rho_w_rhs, const amrex::Array4< const amrex::Real > &rho, const amrex::Array4< const amrex::Real > &u, const amrex::Array4< const amrex::Real > &v, const amrex::Array4< const amrex::Real > &w, const amrex::Array4< const amrex::Real > &rho_u, const amrex::Array4< const amrex::Real > &rho_v, const amrex::Array4< const amrex::Real > &Omega, const amrex::Array4< const amrex::Real > &z_nd, const amrex::Array4< const amrex::Real > &ax, const amrex::Array4< const amrex::Real > &ay, const amrex::Array4< const amrex::Real > &az, const amrex::Array4< const amrex::Real > &detJ, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &mf_m, const amrex::Array4< const amrex::Real > &mf_u, const amrex::Array4< const amrex::Real > &mf_v, const AdvType horiz_adv_type, const AdvType vert_adv_type, const amrex::Real horiz_upw_frac, const amrex::Real vert_upw_frac, const bool use_terrain, const int lo_z_face, const int hi_z_face, const amrex::Box &domain, const amrex::BCRec *bc_ptr_h)
 
void AdvectionSrcForOpenBC_Normal (const amrex::Box &bx, const int &dir, const amrex::Array4< amrex::Real > &rhs_arr, const amrex::Array4< const amrex::Real > &vel_norm_arr, const amrex::Array4< const amrex::Real > &cell_data_arr, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dxInv, const bool do_lo=false)
 
void AdvectionSrcForOpenBC_Tangent_Xmom (const amrex::Box &bxx, const int &dir, const amrex::Array4< amrex::Real > &rho_u_rhs, const amrex::Array4< const amrex::Real > &u, const amrex::Array4< const amrex::Real > &rho_u, const amrex::Array4< const amrex::Real > &rho_v, const amrex::Array4< const amrex::Real > &Omega, const amrex::Array4< const amrex::Real > &ax, const amrex::Array4< const amrex::Real > &az, const amrex::Array4< const amrex::Real > &detJ, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const bool do_lo=false)
 
void AdvectionSrcForOpenBC_Tangent_Ymom (const amrex::Box &bxy, const int &dir, const amrex::Array4< amrex::Real > &rho_v_rhs, const amrex::Array4< const amrex::Real > &v, const amrex::Array4< const amrex::Real > &rho_u, const amrex::Array4< const amrex::Real > &rho_v, const amrex::Array4< const amrex::Real > &Omega, const amrex::Array4< const amrex::Real > &ay, const amrex::Array4< const amrex::Real > &az, const amrex::Array4< const amrex::Real > &detJ, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const bool do_lo=false)
 
void AdvectionSrcForOpenBC_Tangent_Zmom (const amrex::Box &bxz, const int &dir, const amrex::Array4< amrex::Real > &rho_w_rhs, const amrex::Array4< const amrex::Real > &w, const amrex::Array4< const amrex::Real > &rho_u, const amrex::Array4< const amrex::Real > &rho_v, const amrex::Array4< const amrex::Real > &Omega, const amrex::Array4< const amrex::Real > &ax, const amrex::Array4< const amrex::Real > &ay, const amrex::Array4< const amrex::Real > &az, const amrex::Array4< const amrex::Real > &detJ, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const int domhi_z, const bool do_lo=false)
 
void AdvectionSrcForOpenBC_Tangent_Cons (const amrex::Box &bx, const int &dir, const int &icomp, const int &ncomp, const amrex::Array4< amrex::Real > &cell_rhs, const amrex::Array4< const amrex::Real > &cell_prim, const amrex::Array4< const amrex::Real > &avg_xmom, const amrex::Array4< const amrex::Real > &avg_ymom, const amrex::Array4< const amrex::Real > &avg_zmom, const amrex::Array4< const amrex::Real > &detJ, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const bool do_lo=false)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real AdvectionSrcForOpenBC_Tangent (const int &i, const int &j, const int &k, const int &nprim, const int &dir, const amrex::Array4< const amrex::Real > &prim_tang_arr, const amrex::Array4< const amrex::Real > &mom_norm_arr, const amrex::Real &dxInv, const bool do_lo=false)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE AdvType EfficientAdvType (int nrk, AdvType adv_type)
 

Function Documentation

◆ AdvectionSrcForMom()

void AdvectionSrcForMom ( const amrex::Box &  bx,
const amrex::Box &  bxx,
const amrex::Box &  bxy,
const amrex::Box &  bxz,
const amrex::Array4< amrex::Real > &  rho_u_rhs,
const amrex::Array4< amrex::Real > &  rho_v_rhs,
const amrex::Array4< amrex::Real > &  rho_w_rhs,
const amrex::Array4< const amrex::Real > &  rho,
const amrex::Array4< const amrex::Real > &  u,
const amrex::Array4< const amrex::Real > &  v,
const amrex::Array4< const amrex::Real > &  w,
const amrex::Array4< const amrex::Real > &  rho_u,
const amrex::Array4< const amrex::Real > &  rho_v,
const amrex::Array4< const amrex::Real > &  Omega,
const amrex::Array4< const amrex::Real > &  z_nd,
const amrex::Array4< const amrex::Real > &  ax,
const amrex::Array4< const amrex::Real > &  ay,
const amrex::Array4< const amrex::Real > &  az,
const amrex::Array4< const amrex::Real > &  detJ,
const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &  cellSizeInv,
const amrex::Array4< const amrex::Real > &  mf_m,
const amrex::Array4< const amrex::Real > &  mf_u,
const amrex::Array4< const amrex::Real > &  mf_v,
const AdvType  horiz_adv_type,
const AdvType  vert_adv_type,
const amrex::Real  horiz_upw_frac,
const amrex::Real  vert_upw_frac,
const bool  use_terrain,
const int  lo_z_face,
const int  hi_z_face,
const amrex::Box &  domain,
const amrex::BCRec *  bc_ptr_h 
)

Compute advection tendencies for all components of momentum

Referenced by erf_slow_rhs_pre().

Here is the caller graph for this function:

◆ AdvectionSrcForOpenBC_Normal()

void AdvectionSrcForOpenBC_Normal ( const amrex::Box &  bx,
const int &  dir,
const amrex::Array4< amrex::Real > &  rhs_arr,
const amrex::Array4< const amrex::Real > &  vel_norm_arr,
const amrex::Array4< const amrex::Real > &  cell_data_arr,
const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &  dxInv,
const bool  do_lo = false 
)

Compute advection tendencies for all normal components of momentum

Referenced by AdvectionSrcForMom().

Here is the caller graph for this function:

◆ AdvectionSrcForOpenBC_Tangent()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real AdvectionSrcForOpenBC_Tangent ( const int &  i,
const int &  j,
const int &  k,
const int &  nprim,
const int &  dir,
const amrex::Array4< const amrex::Real > &  prim_tang_arr,
const amrex::Array4< const amrex::Real > &  mom_norm_arr,
const amrex::Real &  dxInv,
const bool  do_lo = false 
)

Compute advection tendencies in normal dir for vars tangent to open bc

◆ AdvectionSrcForOpenBC_Tangent_Cons()

void AdvectionSrcForOpenBC_Tangent_Cons ( const amrex::Box &  bx,
const int &  dir,
const int &  icomp,
const int &  ncomp,
const amrex::Array4< amrex::Real > &  cell_rhs,
const amrex::Array4< const amrex::Real > &  cell_prim,
const amrex::Array4< const amrex::Real > &  avg_xmom,
const amrex::Array4< const amrex::Real > &  avg_ymom,
const amrex::Array4< const amrex::Real > &  avg_zmom,
const amrex::Array4< const amrex::Real > &  detJ,
const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &  cellSizeInv,
const bool  do_lo = false 
)

Compute advection tendencies for cons tangential to BC (2nd order)

Referenced by AdvectionSrcForScalars().

Here is the caller graph for this function:

◆ AdvectionSrcForOpenBC_Tangent_Xmom()

void AdvectionSrcForOpenBC_Tangent_Xmom ( const amrex::Box &  bxx,
const int &  dir,
const amrex::Array4< amrex::Real > &  rho_u_rhs,
const amrex::Array4< const amrex::Real > &  u,
const amrex::Array4< const amrex::Real > &  rho_u,
const amrex::Array4< const amrex::Real > &  rho_v,
const amrex::Array4< const amrex::Real > &  Omega,
const amrex::Array4< const amrex::Real > &  ax,
const amrex::Array4< const amrex::Real > &  az,
const amrex::Array4< const amrex::Real > &  detJ,
const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &  cellSizeInv,
const bool  do_lo = false 
)

Compute advection tendencies for u momentum tangent to open bc

Referenced by AdvectionSrcForMom().

Here is the caller graph for this function:

◆ AdvectionSrcForOpenBC_Tangent_Ymom()

void AdvectionSrcForOpenBC_Tangent_Ymom ( const amrex::Box &  bxy,
const int &  dir,
const amrex::Array4< amrex::Real > &  rho_v_rhs,
const amrex::Array4< const amrex::Real > &  v,
const amrex::Array4< const amrex::Real > &  rho_u,
const amrex::Array4< const amrex::Real > &  rho_v,
const amrex::Array4< const amrex::Real > &  Omega,
const amrex::Array4< const amrex::Real > &  ay,
const amrex::Array4< const amrex::Real > &  az,
const amrex::Array4< const amrex::Real > &  detJ,
const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &  cellSizeInv,
const bool  do_lo = false 
)

Compute advection tendencies for v momentum tangent to open bc

Referenced by AdvectionSrcForMom().

Here is the caller graph for this function:

◆ AdvectionSrcForOpenBC_Tangent_Zmom()

void AdvectionSrcForOpenBC_Tangent_Zmom ( const amrex::Box &  bxz,
const int &  dir,
const amrex::Array4< amrex::Real > &  rho_w_rhs,
const amrex::Array4< const amrex::Real > &  w,
const amrex::Array4< const amrex::Real > &  rho_u,
const amrex::Array4< const amrex::Real > &  rho_v,
const amrex::Array4< const amrex::Real > &  Omega,
const amrex::Array4< const amrex::Real > &  ax,
const amrex::Array4< const amrex::Real > &  ay,
const amrex::Array4< const amrex::Real > &  az,
const amrex::Array4< const amrex::Real > &  detJ,
const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &  cellSizeInv,
const int  domhi_z,
const bool  do_lo = false 
)

Compute advection tendencies for w momentum tangent to open bc

Referenced by AdvectionSrcForMom().

Here is the caller graph for this function:

◆ AdvectionSrcForRho()

void AdvectionSrcForRho ( const amrex::Box &  bx,
const amrex::Array4< amrex::Real > &  src,
const amrex::Array4< const amrex::Real > &  rho_u,
const amrex::Array4< const amrex::Real > &  rho_v,
const amrex::Array4< const amrex::Real > &  omega,
const amrex::Array4< amrex::Real > &  avg_xmom,
const amrex::Array4< amrex::Real > &  avg_ymom,
const amrex::Array4< amrex::Real > &  avg_zmom,
const amrex::Array4< const amrex::Real > &  ax_arr,
const amrex::Array4< const amrex::Real > &  ay_arr,
const amrex::Array4< const amrex::Real > &  az_arr,
const amrex::Array4< const amrex::Real > &  detJ,
const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &  cellSizeInv,
const amrex::Array4< const amrex::Real > &  mf_m,
const amrex::Array4< const amrex::Real > &  mf_u,
const amrex::Array4< const amrex::Real > &  mf_v,
const amrex::GpuArray< const amrex::Array4< amrex::Real >, AMREX_SPACEDIM > &  flx_arr,
const bool  const_rho 
)

Compute advection tendency for density and potential temperature

Referenced by erf_slow_rhs_pre().

Here is the caller graph for this function:

◆ AdvectionSrcForScalars()

void AdvectionSrcForScalars ( const amrex::Real &  dt,
const amrex::Box &  bx,
const int  icomp,
const int  ncomp,
const amrex::Array4< const amrex::Real > &  avg_xmom,
const amrex::Array4< const amrex::Real > &  avg_ymom,
const amrex::Array4< const amrex::Real > &  avg_zmom,
const amrex::Array4< const amrex::Real > &  cur_cons,
const amrex::Array4< const amrex::Real > &  cell_prim,
const amrex::Array4< amrex::Real > &  src,
const bool &  use_mono_adv,
amrex::Real *  max_s_ptr,
amrex::Real *  min_s_ptr,
const amrex::Array4< const amrex::Real > &  vf_arr,
const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &  cellSizeInv,
const amrex::Array4< const amrex::Real > &  mf_m,
const AdvType  horiz_adv_type,
const AdvType  vert_adv_type,
const amrex::Real  horiz_upw_frac,
const amrex::Real  vert_upw_frac,
const amrex::GpuArray< const amrex::Array4< amrex::Real >, AMREX_SPACEDIM > &  flx_arr,
const amrex::GpuArray< amrex::Array4< amrex::Real >, AMREX_SPACEDIM > &  flx_tmp_arr,
const amrex::Box &  domain,
const amrex::BCRec *  bc_ptr_h 
)

Compute advection tendency for all scalars other than density and potential temperature

Referenced by erf_slow_rhs_post(), and erf_slow_rhs_pre().

Here is the caller graph for this function:

◆ EfficientAdvType()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE AdvType EfficientAdvType ( int  nrk,
AdvType  adv_type 
)
171 {
172  AdvType eff_adv_type;
173 
174  if (nrk == 0) {
175 
176  eff_adv_type = AdvType::Centered_2nd;
177 
178  } else if (nrk == 1) {
179 
180  if ( (adv_type == AdvType::Centered_2nd) ||
181  (adv_type == AdvType::Upwind_3rd) ||
182  (adv_type == AdvType::Centered_4th) ||
183  (adv_type == AdvType::Weno_3) ||
184  (adv_type == AdvType::Weno_3Z) ||
185  (adv_type == AdvType::Weno_3MZQ) )
186  {
187  eff_adv_type = AdvType::Centered_2nd;
188 
189  } else if ( (adv_type == AdvType::Upwind_5th) ||
190  (adv_type == AdvType::Weno_5) ||
191  (adv_type == AdvType::Weno_5Z) )
192  {
193  eff_adv_type = AdvType::Upwind_3rd;
194 
195  } else { // (adv_type == AdvType::Centered_6th)
196 
197  eff_adv_type = AdvType::Centered_4th;
198  }
199 
200  } else {
201 
202  eff_adv_type = adv_type;
203  }
204 
205  return(eff_adv_type);
206 }
AdvType
Definition: ERF_IndexDefines.H:191
@ Centered_4th
@ Centered_2nd

Referenced by erf_slow_rhs_post().

Here is the caller graph for this function: