ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_FireCouplingParams.H
Go to the documentation of this file.
1 #ifndef ERF_FIRE_COUPLING_PARAMS_H
2 #define ERF_FIRE_COUPLING_PARAMS_H
3 
4 #include <AMReX_REAL.H>
5 #include <string>
6 
7 /**
8  * @file ERF_FireCouplingParams.H
9  * @brief The inputs of the atmosphere side of the fire coupling
10  *
11  * The erf.fire.* keys that the shared coupling layer (FireCoupler) reads:
12  * whether the fire runs and which engine, where its grid sits, when and how
13  * its fluxes enter the atmosphere, and the smoke tracer. Every fire engine
14  * shares them; each engine reads its own keys besides. read() parses them
15  * with their range checks, aborting with a message that names the key.
16  */
18 {
19  /// erf.fire.enable: run a fire
20  bool enable = false;
21  /// erf.fire.engine: the fire engine behind the coupling (default: the only
22  /// engine compiled in; required when there are several)
23  std::string engine;
24  /// erf.fire.grid_ratio: fire cells per atmospheric cell in x and y
25  int grid_ratio = 5;
26  /// erf.fire.anchor_level: the level the fire grid refines, -1 = the finest
27  int anchor_level = -1;
28  /// erf.fire.coupling_type: passive, lagged or synchronous
29  std::string coupling_type = "lagged";
30  /// erf.fire.heat_flux_alfg: e-folding height of the injected heat [m]
32  /// erf.fire.fire_atm_feedback: multiplier on the injected fluxes
34  /// erf.fire.inject_latent: inject the engine's latent flux as vapour
35  bool inject_latent = true;
36  /// erf.fire.source_mode: overwrite or add to the theta and vapour sources
37  std::string source_mode = "overwrite";
38  /// erf.fire.source_mode was given in the deck (the default overwrite must be chosen explicitly
39  /// when another theta source would be discarded)
40  bool source_mode_given = false;
41  /// erf.fire.heat_open_fraction: place the heat by the engine's open fraction
42  bool heat_open_fraction = false;
43  /// erf.fire.heat_tendency_density: density factor of the theta tendency
44  bool heat_tendency_density = false;
45  /// erf.fire.heat_tendency_exner: Exner factor of the theta tendency
46  bool heat_tendency_exner = true;
47  /// erf.fire.heat_profile: exponential (WRF-SFIRE, e-folding heat_flux_alfg)
48  /// or bottom_cell (all of the flux into the lowest cell)
49  std::string heat_profile = "exponential";
50  /// erf.fire.smoke_enable: inject the smoke tracer
51  bool smoke_enable = false;
52  /// erf.fire.smoke_emission_factor: kg smoke per kg fuel burned [-]
54  /// erf.fire.fire_debug: debug output of the coupling
55  bool fire_debug = false;
56 
57  bool is_passive() const { return coupling_type == "passive"; }
58  bool is_lagged() const { return coupling_type == "lagged"; }
59  bool is_synchronous() const { return coupling_type == "synchronous"; }
60  /// Heat (and vapour) reach the atmosphere: lagged and synchronous coupling.
61  bool injects_flux() const { return is_lagged() || is_synchronous(); }
62  bool heat_in_bottom_cell() const { return heat_profile == "bottom_cell"; }
63 
64  /// Parse and check the keys above from erf.fire.*. With erf.fire.enable,
65  /// erf.fire.engine must name an engine compiled into this executable
66  /// (fire_engine_names(), ERF_FireEngineRegistry.H).
67  static FireCouplingParams read ();
68 };
69 
70 #endif
amrex::Real Real
Definition: ERF_ShocInterface.H:19
Definition: ERF_FireCouplingParams.H:18
bool heat_in_bottom_cell() const
Definition: ERF_FireCouplingParams.H:62
int grid_ratio
erf.fire.grid_ratio: fire cells per atmospheric cell in x and y
Definition: ERF_FireCouplingParams.H:25
bool fire_debug
erf.fire.fire_debug: debug output of the coupling
Definition: ERF_FireCouplingParams.H:55
bool heat_tendency_exner
erf.fire.heat_tendency_exner: Exner factor of the theta tendency
Definition: ERF_FireCouplingParams.H:46
bool inject_latent
erf.fire.inject_latent: inject the engine's latent flux as vapour
Definition: ERF_FireCouplingParams.H:35
static FireCouplingParams read()
Definition: ERF_FireCouplingParams.cpp:10
std::string heat_profile
Definition: ERF_FireCouplingParams.H:49
std::string engine
Definition: ERF_FireCouplingParams.H:23
int anchor_level
erf.fire.anchor_level: the level the fire grid refines, -1 = the finest
Definition: ERF_FireCouplingParams.H:27
bool heat_tendency_density
erf.fire.heat_tendency_density: density factor of the theta tendency
Definition: ERF_FireCouplingParams.H:44
bool heat_open_fraction
erf.fire.heat_open_fraction: place the heat by the engine's open fraction
Definition: ERF_FireCouplingParams.H:42
bool is_lagged() const
Definition: ERF_FireCouplingParams.H:58
bool source_mode_given
Definition: ERF_FireCouplingParams.H:40
bool smoke_enable
erf.fire.smoke_enable: inject the smoke tracer
Definition: ERF_FireCouplingParams.H:51
amrex::Real smoke_emission_factor
erf.fire.smoke_emission_factor: kg smoke per kg fuel burned [-]
Definition: ERF_FireCouplingParams.H:53
bool injects_flux() const
Heat (and vapour) reach the atmosphere: lagged and synchronous coupling.
Definition: ERF_FireCouplingParams.H:61
std::string source_mode
erf.fire.source_mode: overwrite or add to the theta and vapour sources
Definition: ERF_FireCouplingParams.H:37
std::string coupling_type
erf.fire.coupling_type: passive, lagged or synchronous
Definition: ERF_FireCouplingParams.H:29
bool enable
erf.fire.enable: run a fire
Definition: ERF_FireCouplingParams.H:20
bool is_synchronous() const
Definition: ERF_FireCouplingParams.H:59
amrex::Real heat_flux_alfg
erf.fire.heat_flux_alfg: e-folding height of the injected heat [m]
Definition: ERF_FireCouplingParams.H:31
amrex::Real fire_atm_feedback
erf.fire.fire_atm_feedback: multiplier on the injected fluxes
Definition: ERF_FireCouplingParams.H:33
bool is_passive() const
Definition: ERF_FireCouplingParams.H:57