1 #ifndef ERF_CANOPY_TURB_STRUCT_H_
2 #define ERF_CANOPY_TURB_STRUCT_H_
7 #include <AMReX_ParmParse.H>
8 #include <AMReX_REAL.H>
9 #include <AMReX_Utility.H>
35 const bool has_beta_p =
pp.query(
"forest_canopy_beta_p",
beta_p);
36 const bool has_beta_d =
pp.query(
"forest_canopy_beta_d",
beta_d);
37 const bool has_alpha =
pp.query(
"forest_canopy_length_alpha",
length_alpha);
42 if (!
enabled && (has_beta_p || has_beta_d || has_alpha)) {
43 amrex::Warning(
"erf.forest_canopy_beta_p, erf.forest_canopy_beta_d and "
44 "erf.forest_canopy_length_alpha are not used without "
45 "erf.forest_canopy_tke = true");
48 amrex::Abort(
"erf.forest_canopy_beta_p must be in [0, 1], the fraction of the "
49 "drag work that becomes TKE; got " + std::to_string(
beta_p));
52 amrex::Abort(
"erf.forest_canopy_beta_d must be finite and not negative; got " +
56 amrex::Abort(
"erf.forest_canopy_length_alpha must be in [0, 1] (0 disables the "
57 "length scale cap); got " + std::to_string(
length_alpha));
61 amrex::Abort(
"erf.forest_canopy_tke = true with erf.forest_canopy_beta_p, "
62 "erf.forest_canopy_beta_d and erf.forest_canopy_length_alpha all "
63 "zero would change nothing; set erf.forest_canopy_tke = false");
76 bool implicit_diss_on_every_level)
const
79 if (!do_forest_drag) {
80 amrex::Abort(
"erf.forest_canopy_tke = true needs a forest: set erf.forest_file, "
81 "or the gridded erf.forest_lai_file/forest_height_file inputs");
83 if (!keqn_on_every_level) {
84 amrex::Abort(
"erf.forest_canopy_tke = true needs erf.rans_type = kEqn on every "
93 amrex::Abort(
"erf.forest_canopy_tke = true with erf.forest_canopy_length_alpha > 0 "
94 "needs erf.implicit_tke_dissipation = true on every level: the canopy "
95 "length cap makes the explicit TKE dissipation stiff (see the Forest "
96 "model section of the docs)");
amrex::Real Real
Definition: ERF_ShocInterface.H:19
Definition: ERF_CanopyTurbStruct.H:16
amrex::Real length_alpha
Definition: ERF_CanopyTurbStruct.H:25
amrex::Real beta_d
erf.forest_canopy_beta_d: short-circuit dissipation coefficient
Definition: ERF_CanopyTurbStruct.H:22
void init_params(amrex::ParmParse &pp)
Definition: ERF_CanopyTurbStruct.H:32
amrex::Real beta_p
erf.forest_canopy_beta_p: fraction of the drag work that becomes TKE
Definition: ERF_CanopyTurbStruct.H:20
bool enabled
erf.forest_canopy_tke: add the canopy terms to the k-eqn RANS model
Definition: ERF_CanopyTurbStruct.H:18
void check_config(bool do_forest_drag, bool keqn_on_every_level, bool implicit_diss_on_every_level) const
Definition: ERF_CanopyTurbStruct.H:75