ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_TI_slow_headers.H File Reference
#include "AMReX_MultiFab.H"
#include "AMReX_BCRec.H"
#include "AMReX_YAFluxRegister.H"
#include "AMReX_MultiCutFab.H"
#include "AMReX_EBMultiFabUtil.H"
#include "ERF_DataStruct.H"
#include "ERF_IndexDefines.H"
#include "ERF_SurfaceLayer.H"
#include "ERF_Advection.H"
#include "ERF_Diffusion.H"
#include "ERF_EddyViscosity.H"
#include "ERF_TerrainMetrics.H"
#include "ERF_TileNoZ.H"
#include "ERF_EB.H"
#include "ERF_ReadBndryPlanes.H"
#include "Prob/ERF_CloudChamber.H"
Include dependency graph for ERF_TI_slow_headers.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 erf_auxiliary
 
 erf_sbm
 

Functions

amrex::Real StageFluxWeight (const SolverChoice &solverChoice, int level, int nrk)
 
amrex::Real RefluxStageWeight (const SolverChoice &solverChoice, int level, int finest_level, int nrk)
 
bool IsRefluxStage (const SolverChoice &solverChoice, int level, int finest_level, int nrk)
 
void erf_make_tau_terms (int level, int nrk, const amrex::Vector< amrex::BCRec > &domain_bcs_type, const amrex::MultiFab &z_phys_nd, amrex::Vector< amrex::MultiFab > &S_data, const amrex::MultiFab &xvel, const amrex::MultiFab &yvel, const amrex::MultiFab &zvel, amrex::Vector< std::unique_ptr< amrex::MultiFab >> &Tau_lev, amrex::Vector< std::unique_ptr< amrex::MultiFab >> &Tau_corr_lev, amrex::MultiFab *SmnSmn, amrex::MultiFab *eddyDiffs, const amrex::Geometry geom, const SolverChoice &solverChoice, const amrex::Vector< std::unique_ptr< SurfaceLayer >> &SurfLayer, amrex::Gpu::DeviceVector< amrex::Real > &stretched_dz_d, const amrex::MultiFab &detJ, amrex::Vector< std::unique_ptr< amrex::MultiFab >> &mapfac, const amrex::MultiFab &ax, const amrex::MultiFab &ay, const amrex::MultiFab &az, const eb_ &ebfact, const amrex::MultiFab *ib_wall_face13=nullptr, const amrex::MultiFab *ib_wall_face23=nullptr, const amrex::MultiFab *walldist=nullptr)
 
void copy_surface_tau_for_implicit (amrex::Vector< std::unique_ptr< amrex::MultiFab >> &Tau_lev, amrex::Vector< std::unique_ptr< amrex::MultiFab >> &Tau_corr_lev)
 
void erf_slow_rhs_pre (int level, int finest_level, int nrk, double dt, amrex::Vector< amrex::MultiFab > &S_rhs, amrex::Vector< amrex::MultiFab > &S_old, amrex::Vector< amrex::MultiFab > &S_data, const amrex::MultiFab &S_prim, const amrex::MultiFab &qt, amrex::MultiFab &avg_xmom, amrex::MultiFab &avg_ymom, amrex::MultiFab &avg_zmom, const amrex::Array< const amrex::MultiFab *, AMREX_SPACEDIM > &upw_dir, amrex::MultiFab *pi_adv_rt, const amrex::MultiFab &xvel, const amrex::MultiFab &yvel, const amrex::MultiFab &zvel, std::unique_ptr< amrex::MultiFab > &z_t, const amrex::MultiFab &cc_src, const amrex::MultiFab &xmom_src, const amrex::MultiFab &ymom_src, const amrex::MultiFab &zmom_src, const amrex::MultiFab &buoyancy, const amrex::MultiFab *zmom_crse_rhs, amrex::Vector< std::unique_ptr< amrex::MultiFab >> &Tau_lev, amrex::Vector< std::unique_ptr< amrex::MultiFab >> &Tau_corr_lev, amrex::Vector< amrex::Vector< std::unique_ptr< amrex::MultiFab >>> &Tau_EB, amrex::MultiFab *SmnSmn, amrex::MultiFab *eddyDiffs, amrex::MultiFab *Hfx1, amrex::MultiFab *Hfx2, amrex::MultiFab *Hfx3, amrex::MultiFab *Q1fx1, amrex::MultiFab *Q1fx2, amrex::MultiFab *Q1fx3, amrex::MultiFab *Q2fx3, amrex::MultiFab *Diss, amrex::MultiFab *mf_surface_fluxes, amrex::MultiFab *Hfx3_EB, const amrex::Geometry geom, const SolverChoice &solverChoice, const amrex::Vector< std::unique_ptr< SurfaceLayer >> &SurfLayer, const amrex::Gpu::DeviceVector< amrex::BCRec > &domain_bcs_type_d, const amrex::Vector< amrex::BCRec > &domain_bcs_type, const amrex::MultiFab &z_phys_nd, const amrex::MultiFab &z_phys_cc, const amrex::MultiFab &ax, const amrex::MultiFab &ay, const amrex::MultiFab &az, const amrex::MultiFab &dJ, amrex::Gpu::DeviceVector< amrex::Real > &stretched_dz_d, amrex::Vector< amrex::MultiFab > &gradp, amrex::Vector< std::unique_ptr< amrex::MultiFab >> &mapfac, const eb_ &ebfact, const amrex::Vector< amrex::iMultiFab > &physbnd_mask, ShocDriver *native_shoc_lev, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, const amrex::MultiFab *cloud_chamber_base_state, const erf_cloud_chamber::Config *cloud_chamber_config, CloudChamberBudget *cloud_budget, const amrex::MultiFab *ib_wall_face13=nullptr, const amrex::MultiFab *ib_wall_face23=nullptr, const amrex::MultiFab *ib_wall_face33=nullptr, const amrex::MultiFab *ib_wall_hfx=nullptr, const amrex::MultiFab *walldist=nullptr)
 
void erf_slow_rhs_post (int level, int finest_level, int nrk, double step_old_time, double input_time, double target_time, double dt, int n_qstate, amrex::Vector< amrex::MultiFab > &S_rhs, amrex::Vector< amrex::MultiFab > &S_old, amrex::Vector< amrex::MultiFab > &S_new, amrex::Vector< amrex::MultiFab > &S_data, const amrex::MultiFab &S_prim, amrex::MultiFab &avg_xmom, amrex::MultiFab &avg_ymom, amrex::MultiFab &avg_zmom, const amrex::Array< const amrex::MultiFab *, AMREX_SPACEDIM > &upw_dir, const amrex::MultiFab &xvel, const amrex::MultiFab &yvel, const amrex::MultiFab &zvel, const amrex::MultiFab &source, amrex::MultiFab *terrain_blank, amrex::MultiFab *terrain_blank_xface, amrex::MultiFab *terrain_blank_yface, amrex::MultiFab *terrain_blank_zface, const amrex::MultiFab *SmnSmn, const amrex::MultiFab *eddyDiffs, amrex::MultiFab *Hfx1, amrex::MultiFab *Hfx2, amrex::MultiFab *Hfx3, amrex::MultiFab *Q1fx1, amrex::MultiFab *Q1fx2, amrex::MultiFab *Q1fx3, amrex::MultiFab *Q2fx3, amrex::MultiFab *Diss, amrex::MultiFab *Tau13, amrex::MultiFab *Tau23, const amrex::Geometry geom, const SolverChoice &solverChoice, const amrex::Vector< std::unique_ptr< SurfaceLayer >> &SurfLayer, const amrex::Gpu::DeviceVector< amrex::BCRec > &domain_bcs_type_d, const amrex::Vector< amrex::BCRec > &domain_bcs_type, std::unique_ptr< amrex::MultiFab > &z_phys_nd, std::unique_ptr< amrex::MultiFab > &z_phys_cc, std::unique_ptr< amrex::MultiFab > &ax, std::unique_ptr< amrex::MultiFab > &ay, std::unique_ptr< amrex::MultiFab > &az, std::unique_ptr< amrex::MultiFab > &dJ_old, amrex::MultiFab *dJ_new, amrex::Gpu::DeviceVector< amrex::Real > &stretched_dz_d, amrex::Vector< std::unique_ptr< amrex::MultiFab >> &mapfac, const eb_ &ebfact, const amrex::iMultiFab &physbnd_mask, ShocDriver *native_shoc_lev, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, std::unique_ptr< ReadBndryPlanes > &m_r2d, const amrex::MultiFab *cloud_chamber_base_state, const erf_cloud_chamber::Config *cloud_chamber_config, CloudChamberBudget *cloud_budget, erf_auxiliary::AuxiliaryInertTracer *auxiliary_inert_tracer, erf_sbm::SBMStateManager *sbm_state_manager, erf_sbm::SBMTransport *sbm_transport, const amrex::MultiFab *ib_wall_face33=nullptr, const amrex::MultiFab *ib_wall_ktarget=nullptr, const amrex::MultiFab *ib_wall_qfx=nullptr, const erf_sbm::SBMAMRStageParent *sbm_parent_stage=nullptr)
 

Function Documentation

◆ copy_surface_tau_for_implicit()

void copy_surface_tau_for_implicit ( amrex::Vector< std::unique_ptr< amrex::MultiFab >> &  Tau_lev,
amrex::Vector< std::unique_ptr< amrex::MultiFab >> &  Tau_corr_lev 
)

◆ erf_make_tau_terms()

void erf_make_tau_terms ( int  level,
int  nrk,
const amrex::Vector< amrex::BCRec > &  domain_bcs_type,
const amrex::MultiFab &  z_phys_nd,
amrex::Vector< amrex::MultiFab > &  S_data,
const amrex::MultiFab &  xvel,
const amrex::MultiFab &  yvel,
const amrex::MultiFab &  zvel,
amrex::Vector< std::unique_ptr< amrex::MultiFab >> &  Tau_lev,
amrex::Vector< std::unique_ptr< amrex::MultiFab >> &  Tau_corr_lev,
amrex::MultiFab *  SmnSmn,
amrex::MultiFab *  eddyDiffs,
const amrex::Geometry  geom,
const SolverChoice &  solverChoice,
const amrex::Vector< std::unique_ptr< SurfaceLayer >> &  SurfLayer,
amrex::Gpu::DeviceVector< amrex::Real > &  stretched_dz_d,
const amrex::MultiFab &  detJ,
amrex::Vector< std::unique_ptr< amrex::MultiFab >> &  mapfac,
const amrex::MultiFab &  ax,
const amrex::MultiFab &  ay,
const amrex::MultiFab &  az,
const eb_ &  ebfact,
const amrex::MultiFab *  ib_wall_face13 = nullptr,
const amrex::MultiFab *  ib_wall_face23 = nullptr,
const amrex::MultiFab *  walldist = nullptr 
)

◆ erf_slow_rhs_post()

void erf_slow_rhs_post ( int  level,
int  finest_level,
int  nrk,
double  step_old_time,
double  input_time,
double  target_time,
double  dt,
int  n_qstate,
amrex::Vector< amrex::MultiFab > &  S_rhs,
amrex::Vector< amrex::MultiFab > &  S_old,
amrex::Vector< amrex::MultiFab > &  S_new,
amrex::Vector< amrex::MultiFab > &  S_data,
const amrex::MultiFab &  S_prim,
amrex::MultiFab &  avg_xmom,
amrex::MultiFab &  avg_ymom,
amrex::MultiFab &  avg_zmom,
const amrex::Array< const amrex::MultiFab *, AMREX_SPACEDIM > &  upw_dir,
const amrex::MultiFab &  xvel,
const amrex::MultiFab &  yvel,
const amrex::MultiFab &  zvel,
const amrex::MultiFab &  source,
amrex::MultiFab *  terrain_blank,
amrex::MultiFab *  terrain_blank_xface,
amrex::MultiFab *  terrain_blank_yface,
amrex::MultiFab *  terrain_blank_zface,
const amrex::MultiFab *  SmnSmn,
const amrex::MultiFab *  eddyDiffs,
amrex::MultiFab *  Hfx1,
amrex::MultiFab *  Hfx2,
amrex::MultiFab *  Hfx3,
amrex::MultiFab *  Q1fx1,
amrex::MultiFab *  Q1fx2,
amrex::MultiFab *  Q1fx3,
amrex::MultiFab *  Q2fx3,
amrex::MultiFab *  Diss,
amrex::MultiFab *  Tau13,
amrex::MultiFab *  Tau23,
const amrex::Geometry  geom,
const SolverChoice &  solverChoice,
const amrex::Vector< std::unique_ptr< SurfaceLayer >> &  SurfLayer,
const amrex::Gpu::DeviceVector< amrex::BCRec > &  domain_bcs_type_d,
const amrex::Vector< amrex::BCRec > &  domain_bcs_type,
std::unique_ptr< amrex::MultiFab > &  z_phys_nd,
std::unique_ptr< amrex::MultiFab > &  z_phys_cc,
std::unique_ptr< amrex::MultiFab > &  ax,
std::unique_ptr< amrex::MultiFab > &  ay,
std::unique_ptr< amrex::MultiFab > &  az,
std::unique_ptr< amrex::MultiFab > &  dJ_old,
amrex::MultiFab *  dJ_new,
amrex::Gpu::DeviceVector< amrex::Real > &  stretched_dz_d,
amrex::Vector< std::unique_ptr< amrex::MultiFab >> &  mapfac,
const eb_ &  ebfact,
const amrex::iMultiFab &  physbnd_mask,
ShocDriver *  native_shoc_lev,
amrex::YAFluxRegister *  fr_as_crse,
amrex::YAFluxRegister *  fr_as_fine,
std::unique_ptr< ReadBndryPlanes > &  m_r2d,
const amrex::MultiFab *  cloud_chamber_base_state,
const erf_cloud_chamber::Config *  cloud_chamber_config,
CloudChamberBudget *  cloud_budget,
erf_auxiliary::AuxiliaryInertTracer *  auxiliary_inert_tracer,
erf_sbm::SBMStateManager *  sbm_state_manager,
erf_sbm::SBMTransport *  sbm_transport,
const amrex::MultiFab *  ib_wall_face33 = nullptr,
const amrex::MultiFab *  ib_wall_ktarget = nullptr,
const amrex::MultiFab *  ib_wall_qfx = nullptr,
const erf_sbm::SBMAMRStageParent *  sbm_parent_stage = nullptr 
)

Function for computing the slow RHS for the evolution equations for the scalars other than density or potential temperature

◆ erf_slow_rhs_pre()

void erf_slow_rhs_pre ( int  level,
int  finest_level,
int  nrk,
double  dt,
amrex::Vector< amrex::MultiFab > &  S_rhs,
amrex::Vector< amrex::MultiFab > &  S_old,
amrex::Vector< amrex::MultiFab > &  S_data,
const amrex::MultiFab &  S_prim,
const amrex::MultiFab &  qt,
amrex::MultiFab &  avg_xmom,
amrex::MultiFab &  avg_ymom,
amrex::MultiFab &  avg_zmom,
const amrex::Array< const amrex::MultiFab *, AMREX_SPACEDIM > &  upw_dir,
amrex::MultiFab *  pi_adv_rt,
const amrex::MultiFab &  xvel,
const amrex::MultiFab &  yvel,
const amrex::MultiFab &  zvel,
std::unique_ptr< amrex::MultiFab > &  z_t,
const amrex::MultiFab &  cc_src,
const amrex::MultiFab &  xmom_src,
const amrex::MultiFab &  ymom_src,
const amrex::MultiFab &  zmom_src,
const amrex::MultiFab &  buoyancy,
const amrex::MultiFab *  zmom_crse_rhs,
amrex::Vector< std::unique_ptr< amrex::MultiFab >> &  Tau_lev,
amrex::Vector< std::unique_ptr< amrex::MultiFab >> &  Tau_corr_lev,
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::MultiFab >>> &  Tau_EB,
amrex::MultiFab *  SmnSmn,
amrex::MultiFab *  eddyDiffs,
amrex::MultiFab *  Hfx1,
amrex::MultiFab *  Hfx2,
amrex::MultiFab *  Hfx3,
amrex::MultiFab *  Q1fx1,
amrex::MultiFab *  Q1fx2,
amrex::MultiFab *  Q1fx3,
amrex::MultiFab *  Q2fx3,
amrex::MultiFab *  Diss,
amrex::MultiFab *  mf_surface_fluxes,
amrex::MultiFab *  Hfx3_EB,
const amrex::Geometry  geom,
const SolverChoice &  solverChoice,
const amrex::Vector< std::unique_ptr< SurfaceLayer >> &  SurfLayer,
const amrex::Gpu::DeviceVector< amrex::BCRec > &  domain_bcs_type_d,
const amrex::Vector< amrex::BCRec > &  domain_bcs_type,
const amrex::MultiFab &  z_phys_nd,
const amrex::MultiFab &  z_phys_cc,
const amrex::MultiFab &  ax,
const amrex::MultiFab &  ay,
const amrex::MultiFab &  az,
const amrex::MultiFab &  dJ,
amrex::Gpu::DeviceVector< amrex::Real > &  stretched_dz_d,
amrex::Vector< amrex::MultiFab > &  gradp,
amrex::Vector< std::unique_ptr< amrex::MultiFab >> &  mapfac,
const eb_ &  ebfact,
const amrex::Vector< amrex::iMultiFab > &  physbnd_mask,
ShocDriver *  native_shoc_lev,
amrex::YAFluxRegister *  fr_as_crse,
amrex::YAFluxRegister *  fr_as_fine,
const amrex::MultiFab *  cloud_chamber_base_state,
const erf_cloud_chamber::Config *  cloud_chamber_config,
CloudChamberBudget *  cloud_budget,
const amrex::MultiFab *  ib_wall_face13 = nullptr,
const amrex::MultiFab *  ib_wall_face23 = nullptr,
const amrex::MultiFab *  ib_wall_face33 = nullptr,
const amrex::MultiFab *  ib_wall_hfx = nullptr,
const amrex::MultiFab *  walldist = nullptr 
)

Function for computing the slow RHS for the evolution equations for the density, potential temperature and momentum.

◆ IsRefluxStage()

bool IsRefluxStage ( const SolverChoice &  solverChoice,
int  level,
int  finest_level,
int  nrk 
)
inline

Whether the fluxes of RK stage nrk at this level go into the flux registers (RefluxStageWeight is not zero).

92 {
93  return RefluxStageWeight(solverChoice, level, finest_level, nrk) > amrex::Real(0.);
94 }
amrex::Real RefluxStageWeight(const SolverChoice &solverChoice, int level, int finest_level, int nrk)
Definition: ERF_TI_slow_headers.H:78

Referenced by erf_slow_rhs_post(), and erf_slow_rhs_pre().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RefluxStageWeight()

amrex::Real RefluxStageWeight ( const SolverChoice &  solverChoice,
int  level,
int  finest_level,
int  nrk 
)
inline

The weight with which the fluxes of RK stage nrk at this level go into the flux registers: the weight of that stage's fluxes in the update the step ends with, or zero if they are not registered. Only with two-way coupling and more than one level. The compressible integrator and the MidPoint integrator of anelastic and pseudo-incompressible levels update from their final stage alone (nrk = 2 and nrk = 1), which takes weight 1. The RK2 integrator of those levels is Heun's, S^{n+1} = S^n + dt (R0 + R1) / 2, so both of its stages take weight 1/2. Every stage that adds fluxes to the registers must use this, so that the registers hold the fluxes the update applied.

Parameters
[in]solverChoicethe solver options
[in]levelthe level being advanced
[in]finest_levelthe finest level
[in]nrkthe RK stage
79 {
80  if (solverChoice.coupling_type != CouplingType::TwoWay || finest_level == 0) {
81  return amrex::Real(0.);
82  }
83  return StageFluxWeight(solverChoice, level, nrk);
84 }
amrex::Real StageFluxWeight(const SolverChoice &solverChoice, int level, int nrk)
Definition: ERF_TI_slow_headers.H:51
CouplingType coupling_type
Multilevel coupling strategy.
Definition: ERF_DataStruct.H:3432

Referenced by erf_slow_rhs_post(), erf_slow_rhs_pre(), and IsRefluxStage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StageFluxWeight()

amrex::Real StageFluxWeight ( const SolverChoice &  solverChoice,
int  level,
int  nrk 
)
inline

The weight of the fluxes of RK stage nrk at this level in the update the step ends with. The compressible integrator and the MidPoint integrator of anelastic and pseudo-incompressible levels update from their final stage alone (nrk = 2 and nrk = 1), which takes weight 1. The RK2 integrator of those levels is Heun's, S^{n+1} = S^n + dt (R0 + R1) / 2, so both of its stages take weight 1/2.

Parameters
[in]solverChoicethe solver options
[in]levelthe level being advanced
[in]nrkthe RK stage
52 {
53  if (solverChoice.compressibility_type[level] != CompressibilityType::FullyCompressible) {
54  if (solverChoice.timestepping_type[level] == TimesteppingType::RK2) {
55  return amrex::Real(0.5);
56  }
57  return (nrk == 1) ? amrex::Real(1.) : amrex::Real(0.);
58  }
59  return (nrk == 2) ? amrex::Real(1.) : amrex::Real(0.);
60 }
Definition: ERF_ConsoleIO.cpp:17
amrex::Vector< TimesteppingType > timestepping_type
Per-level time integrator (RK3_ImplicitSubstep, RK3_NoSubstepping, RK2 or MidPoint).
Definition: ERF_DataStruct.H:3029
amrex::Vector< CompressibilityType > compressibility_type
Per-level compressibility (FullyCompressible, Anelastic or PseudoIncompressible).
Definition: ERF_DataStruct.H:3028

Referenced by ERF::cf_anelastic_record(), and RefluxStageWeight().

Here is the caller graph for this function: