ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
DampingChoice Struct Reference

#include <ERF_DampingStruct.H>

Collaboration diagram for DampingChoice:

Public Member Functions

void init_params (std::string pp_prefix)
 Read damping options from the input parameter database. More...
 
void display ()
 Print the configured damping options. More...
 

Public Attributes

bool rayleigh_damp_U = false
 Whether Rayleigh damping is applied to x-momentum. More...
 
bool rayleigh_damp_V = false
 Whether Rayleigh damping is applied to y-momentum. More...
 
bool rayleigh_damp_W = false
 Whether Rayleigh damping is applied to vertical momentum. More...
 
bool rayleigh_damp_T = false
 Whether Rayleigh damping is applied to potential temperature. More...
 
amrex::Real rayleigh_dampcoef = amrex::Real(0.2)
 Rayleigh damping inverse time scale [1/s]. More...
 
amrex::Real rayleigh_zdamp = amrex::Real(500.0)
 Rayleigh damping layer depth [m]. More...
 
amrex::Real rayleigh_ztop
 Top of the Rayleigh damping layer [m]. More...
 
bool w_damping = false
 Whether vertical-velocity damping is enabled. More...
 
amrex::Real w_damping_cfl = one
 CFL threshold used by vertical-velocity damping. More...
 
amrex::Real w_damping_const = -1
 Constant vertical damping coefficient. More...
 
amrex::Real w_damping_coeff = -1
 Grid-dependent vertical damping coefficient multiplier. More...
 
RayleighDampingType rayleigh_damping_type = RayleighDampingType::SlowExplicit
 Selected Rayleigh damping time-integration treatment. More...
 
bool rayleigh_damping_type_given = false
 

Detailed Description

Container holding damping-related choices

Member Function Documentation

◆ display()

void DampingChoice::display ( )
inline

Print the configured damping options.

77  {
78  amrex::Print() << "Rayleigh damping :";
80  if (rayleigh_damp_U) amrex::Print() << " U";
81  if (rayleigh_damp_V) amrex::Print() << " V";
82  if (rayleigh_damp_W) amrex::Print() << " W";
83  if (rayleigh_damp_T) amrex::Print() << " T";
84  amrex::Print() << " (coef=" << rayleigh_dampcoef << " 1/s,"
85  << " depth=" << rayleigh_zdamp << " m)"
86  << std::endl;
87  } else {
88  amrex::Print() << " None" << std::endl;
89  }
90 
91  amrex::Print() << "w damping : " << w_damping;
92  if (w_damping_const > 0) {
93  amrex::Print() << " (coeff = " << w_damping_const << ")" << std::endl;
94  } else {
95  amrex::Print() << " (coeff = " << w_damping_coeff << " * dz/dt**2)" << std::endl;
96  }
97  }
amrex::Real rayleigh_dampcoef
Rayleigh damping inverse time scale [1/s].
Definition: ERF_DampingStruct.H:103
bool rayleigh_damp_U
Whether Rayleigh damping is applied to x-momentum.
Definition: ERF_DampingStruct.H:99
bool rayleigh_damp_V
Whether Rayleigh damping is applied to y-momentum.
Definition: ERF_DampingStruct.H:100
bool rayleigh_damp_W
Whether Rayleigh damping is applied to vertical momentum.
Definition: ERF_DampingStruct.H:101
amrex::Real rayleigh_zdamp
Rayleigh damping layer depth [m].
Definition: ERF_DampingStruct.H:104
bool w_damping
Whether vertical-velocity damping is enabled.
Definition: ERF_DampingStruct.H:107
bool rayleigh_damp_T
Whether Rayleigh damping is applied to potential temperature.
Definition: ERF_DampingStruct.H:102
amrex::Real w_damping_const
Constant vertical damping coefficient.
Definition: ERF_DampingStruct.H:110
amrex::Real w_damping_coeff
Grid-dependent vertical damping coefficient multiplier.
Definition: ERF_DampingStruct.H:113

Referenced by SolverChoice::display().

Here is the caller graph for this function:

◆ init_params()

void DampingChoice::init_params ( std::string  pp_prefix)
inline

Read damping options from the input parameter database.

Parameters
pp_prefixParmParse prefix for the ERF input namespace.
29  {
30  amrex::ParmParse pp(pp_prefix);
31 
32  static std::string rayleigh_type_string = "SlowExplicit";
33  // Whether the type was given: anelastic and pseudo-incompressible levels default to
34  // SlowImplicit for w, compressible levels to SlowExplicit (rayleigh_slow_implicit_w)
35  rayleigh_damping_type_given = pp.contains("rayleigh_damping_type");
36  pp.queryAdd("rayleigh_damping_type",rayleigh_type_string);
37 
38  if (!rayleigh_type_string.compare("SlowExplicit")) {
40  } else if (!rayleigh_type_string.compare("SlowImplicit")) {
42  } else if (!rayleigh_type_string.compare("FastExplicit")) {
44  } else if (!rayleigh_type_string.compare("FastImplicit")) {
46  } else {
47  amrex::Error("Don't know this rayleigh_damping_type");
48  }
49 
50  // Include Rayleigh damping (separate flags for each variable)
51  pp.queryAdd("rayleigh_damp_U", rayleigh_damp_U);
52  pp.queryAdd("rayleigh_damp_V", rayleigh_damp_V);
53  pp.queryAdd("rayleigh_damp_W", rayleigh_damp_W);
54  pp.queryAdd("rayleigh_damp_T", rayleigh_damp_T);
55  pp.queryAdd("rayleigh_dampcoef", rayleigh_dampcoef);
56  pp.queryAdd("rayleigh_zdamp", rayleigh_zdamp);
57 
58  if (pp.countval("rayleigh_damp_substep") > 0) {
59  amrex::Abort("The input rayleigh_damp_substep is deprecated. Set rayleigh_damping_type instead.");
60  }
61 
62  // Include vertical-velocity damping to improve robustness
63  pp.queryAdd("w_damping", w_damping);
64  pp.queryAdd("w_damping_cfl", w_damping_cfl);
65  pp.queryAdd("w_damping_const", w_damping_const);
66  pp.queryAdd("w_damping_coeff", w_damping_coeff);
67 
68  if (w_damping && (w_damping_const < 0 && w_damping_coeff < 0)) {
69  amrex::Abort("Need to specify vertical damping coefficient w_damping_const (like WRF) or w_damping_coeff (~ dz/dt**2)");
70  }
71  }
ParmParse pp("prob")
RayleighDampingType rayleigh_damping_type
Selected Rayleigh damping time-integration treatment.
Definition: ERF_DampingStruct.H:116
bool rayleigh_damping_type_given
Definition: ERF_DampingStruct.H:117
amrex::Real w_damping_cfl
CFL threshold used by vertical-velocity damping.
Definition: ERF_DampingStruct.H:108

Referenced by SolverChoice::init_params().

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

Member Data Documentation

◆ rayleigh_damp_T

DampingChoice::rayleigh_damp_T = false

Whether Rayleigh damping is applied to potential temperature.

Referenced by display(), init_params(), and make_sources().

◆ rayleigh_damp_U

DampingChoice::rayleigh_damp_U = false

Whether Rayleigh damping is applied to x-momentum.

Referenced by display(), init_params(), and make_mom_sources().

◆ rayleigh_damp_V

DampingChoice::rayleigh_damp_V = false

Whether Rayleigh damping is applied to y-momentum.

Referenced by display(), init_params(), and make_mom_sources().

◆ rayleigh_damp_W

DampingChoice::rayleigh_damp_W = false

Whether Rayleigh damping is applied to vertical momentum.

Referenced by display(), init_params(), make_mom_sources(), SolverChoice::rayleigh_implicit_w(), and SolverChoice::rayleigh_slow_implicit_w().

◆ rayleigh_dampcoef

DampingChoice::rayleigh_dampcoef = amrex::Real(0.2)

Rayleigh damping inverse time scale [1/s].

Referenced by display(), init_params(), make_mom_sources(), and make_sources().

◆ rayleigh_damping_type

◆ rayleigh_damping_type_given

bool DampingChoice::rayleigh_damping_type_given = false

◆ rayleigh_zdamp

DampingChoice::rayleigh_zdamp = amrex::Real(500.0)

Rayleigh damping layer depth [m].

Referenced by display(), and init_params().

◆ rayleigh_ztop

DampingChoice::rayleigh_ztop

Top of the Rayleigh damping layer [m].

◆ w_damping

DampingChoice::w_damping = false

Whether vertical-velocity damping is enabled.

Referenced by display(), and init_params().

◆ w_damping_cfl

DampingChoice::w_damping_cfl = one

CFL threshold used by vertical-velocity damping.

Referenced by init_params().

◆ w_damping_coeff

DampingChoice::w_damping_coeff = -1

Grid-dependent vertical damping coefficient multiplier.

Referenced by display(), and init_params().

◆ w_damping_const

DampingChoice::w_damping_const = -1

Constant vertical damping coefficient.

Referenced by display(), and init_params().


The documentation for this struct was generated from the following file: