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...
 

Detailed Description

Container holding damping-related choices

Member Function Documentation

◆ display()

void DampingChoice::display ( )
inline

Print the configured damping options.

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

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  pp.query("rayleigh_damping_type",rayleigh_type_string);
34 
35  if (!rayleigh_type_string.compare("SlowExplicit")) {
37  } else if (!rayleigh_type_string.compare("FastExplicit")) {
39  } else if (!rayleigh_type_string.compare("FastImplicit")) {
41  } else {
42  amrex::Error("Don't know this rayleigh_damping_type");
43  }
44 
45  // Include Rayleigh damping (separate flags for each variable)
46  pp.query("rayleigh_damp_U", rayleigh_damp_U);
47  pp.query("rayleigh_damp_V", rayleigh_damp_V);
48  pp.query("rayleigh_damp_W", rayleigh_damp_W);
49  pp.query("rayleigh_damp_T", rayleigh_damp_T);
50  pp.query("rayleigh_dampcoef", rayleigh_dampcoef);
51  pp.query("rayleigh_zdamp", rayleigh_zdamp);
52 
53  if (pp.countval("rayleigh_damp_substep") > 0) {
54  amrex::Abort("The input rayleigh_damp_substep is deprecated. Set rayleigh_damping_type instead.");
55  }
56 
57  // Include vertical-velocity damping to improve robustness
58  pp.query("w_damping", w_damping);
59  pp.query("w_damping_cfl", w_damping_cfl);
60  pp.query("w_damping_const", w_damping_const);
61  pp.query("w_damping_coeff", w_damping_coeff);
62 
63  if (w_damping && (w_damping_const < 0 && w_damping_coeff < 0)) {
64  amrex::Abort("Need to specify vertical damping coefficient w_damping_const (like WRF) or w_damping_coeff (~ dz/dt**2)");
65  }
66  }
ParmParse pp("prob")
RayleighDampingType rayleigh_damping_type
Selected Rayleigh damping time-integration treatment.
Definition: ERF_DampingStruct.H:111
amrex::Real w_damping_cfl
CFL threshold used by vertical-velocity damping.
Definition: ERF_DampingStruct.H:103

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(), and make_mom_sources().

◆ 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

DampingChoice::rayleigh_damping_type = RayleighDampingType::SlowExplicit

Selected Rayleigh damping time-integration treatment.

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

◆ 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: