ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
FireEngineTemplate Class Reference

#include <ERF_FireEngineTemplate.H>

Inheritance diagram for FireEngineTemplate:
Collaboration diagram for FireEngineTemplate:

Public Member Functions

const char * name () const override
 The name erf.fire.engine selects this engine by, for example "my_fire". More...
 
void verify_prerequisites (const ERF &erf, int lev) override
 
void initialize (const ERF &erf, int lev, const FireGrid &fg, const SurfaceLayer *surface_layer, const amrex::MultiFab *z_phys_nd_atm) override
 
void start_run (amrex::Real stop_time, int max_step, int steps_per_coarse_step) override
 
void advance (const FireForcing &forcing) override
 
void fill_fluxes (FireFluxes &fluxes) override
 
amrex::Real smoke_heat_per_kg () const override
 
bool wants_surface_precip () const override
 Optional, false unless declared: true if advance() needs forcing.precip_accum_k0. More...
 
bool needs_surface_layer () const override
 
const amrex::MultiFab * heat_open_fraction_atm () const override
 
const amrex::MultiFab * roof_height_atm () const override
 
void write_checkpoint (const std::string &checkpointname) const override
 
void read_checkpoint (const std::string &restart_chkfile, int max_level, int step) override
 
void write_plotfile (const std::string &plotfile_prefix, amrex::Real time, int step) const override
 
std::vector< std::string > plot_var_names () const override
 
const amrex::MultiFab * plot_var (const std::string &name) const override
 The field plot_var_names() lists as name, on the fire grid. More...
 
amrex::Real burned_area () const override
 Optional, -1 unless declared: area burned so far [m2], printed with erf.fire.fire_debug. More...
 
const amrex::MultiFab * level_set () const override
 
const amrex::MultiFab * reference_wind () const override
 Wind (u, v) [m/s] the engine sampled at reference_wind_height() on the fire grid; nullptr if none. More...
 
amrex::Real reference_wind_height () const override
 Height above ground [m] of reference_wind(). More...
 
const amrex::MultiFab * heat_release () const override
 
- Public Member Functions inherited from FireEngine
virtual ~FireEngine ()=default
 

Member Function Documentation

◆ advance()

void FireEngineTemplate::advance ( const FireForcing &  forcing)
overridevirtual

Advance the fire over one step of the fire grid's level (forcing.dt from forcing.time). forcing holds the face velocities, the cell-centre heights, the lowest cell's temperature and humidity, and the surface rain if wants_surface_precip() is true; sample them onto the fire grid here and keep no pointer to them after this call.

Implements FireEngine.

◆ burned_area()

amrex::Real FireEngineTemplate::burned_area ( ) const
overridevirtual

Optional, -1 unless declared: area burned so far [m2], printed with erf.fire.fire_debug.

Reimplemented from FireEngine.

◆ fill_fluxes()

void FireEngineTemplate::fill_fluxes ( FireFluxes &  fluxes)
overridevirtual

Point fluxes.sensible (and fluxes.latent, if the fuel releases water) at the heat flux into the air on the fire grid [W/m2], positive upward, averaged over exactly [forcing.time, forcing.time + forcing.dt] of the last advance() (sum over any substeps, divided by forcing.dt); leave a pointer nullptr for none. A vapour mass flux becomes a latent flux by multiplying by L_v (ERF_Constants.H). The fields must stay valid until the next advance(). Called only when the coupling injects heat or smoke.

Implements FireEngine.

◆ heat_open_fraction_atm()

const amrex::MultiFab* FireEngineTemplate::heat_open_fraction_atm ( ) const
overridevirtual

Optional, nullptr unless declared: for erf.fire.heat_open_fraction, the fraction of each atmospheric column open to the air [0-1] and the mean roof height of the rest [m], on the level's k = 0 slabs with one ghost cell.

Reimplemented from FireEngine.

◆ heat_release()

const amrex::MultiFab* FireEngineTemplate::heat_release ( ) const
overridevirtual

Heat released by the fire on the fire grid [W/m2], before any partition into sensible and latent flux; nullptr if the engine has none.

Reimplemented from FireEngine.

◆ initialize()

void FireEngineTemplate::initialize ( const ERF &  erf,
int  lev,
const FireGrid &  fg,
const SurfaceLayer *  surface_layer,
const amrex::MultiFab *  z_phys_nd_atm 
)
overridevirtual

Allocate the engine's fields on the fire grid fg (fg.ba, fg.dm, fg.geom; fg.atm_lo is the fire region's corner in the level's index space) and set the initial fire: fuels, terrain slope, ignition. surface_layer is never null; ERF passes z_phys_nd_atm too.

Implements FireEngine.

◆ level_set()

const amrex::MultiFab* FireEngineTemplate::level_set ( ) const
overridevirtual

Optional, nullptr (or 0) unless declared: what other surface models read from the fire (a dust or smoke source model, for example). A level set negative where burned; the wind (u, v) the engine sampled at reference_wind_height() above ground; and the heat released before any split into sensible and latent.

Reimplemented from FireEngine.

◆ name()

const char* FireEngineTemplate::name ( ) const
overridevirtual

The name erf.fire.engine selects this engine by, for example "my_fire".

Implements FireEngine.

◆ needs_surface_layer()

bool FireEngineTemplate::needs_surface_layer ( ) const
overridevirtual

Optional, true unless declared: false if the engine reads nothing from the surface layer, so it may run over any bottom boundary.

Reimplemented from FireEngine.

◆ plot_var()

const amrex::MultiFab* FireEngineTemplate::plot_var ( const std::string &  name) const
overridevirtual

The field plot_var_names() lists as name, on the fire grid.

One component, on FireGrid::ba and FireGrid::dm, valid until the next advance(). The coupler averages it over each atmospheric column (the grid_ratio^2 fire cells under it) and writes it into the k = 0 layer of the ERF plotfile, zero elsewhere. nullptr writes zeros.

Reimplemented from FireEngine.

◆ plot_var_names()

std::vector<std::string> FireEngineTemplate::plot_var_names ( ) const
overridevirtual

Optional, none unless declared: the fire fields the ERF plotfile can carry (names starting with "fire_", listed in erf.plot_vars_*), known from the inputs alone (asked before initialize()), and each field on the fire grid; the coupler writes its column means at k = 0.

Reimplemented from FireEngine.

◆ read_checkpoint()

void FireEngineTemplate::read_checkpoint ( const std::string &  restart_chkfile,
int  max_level,
int  step 
)
overridevirtual

Optional (the default stops the run, saying restart is not supported). Read back what write_checkpoint() wrote, on a restart, after start_run() and before the first step; step is the fire grid level's step count at the checkpoint. Abort if the checkpoint's fire grid is not this run's.

Reimplemented from FireEngine.

◆ reference_wind()

const amrex::MultiFab* FireEngineTemplate::reference_wind ( ) const
overridevirtual

Wind (u, v) [m/s] the engine sampled at reference_wind_height() on the fire grid; nullptr if none.

Reimplemented from FireEngine.

◆ reference_wind_height()

amrex::Real FireEngineTemplate::reference_wind_height ( ) const
overridevirtual

Height above ground [m] of reference_wind().

Reimplemented from FireEngine.

◆ roof_height_atm()

const amrex::MultiFab* FireEngineTemplate::roof_height_atm ( ) const
overridevirtual

Reimplemented from FireEngine.

◆ smoke_heat_per_kg()

amrex::Real FireEngineTemplate::smoke_heat_per_kg ( ) const
overridevirtual

Heat released per kilogram of fuel burned [J/kg], matching the sensible flux last handed over; the coupling divides by it to get the fuel burnt that the smoke emission factor applies to.

Implements FireEngine.

◆ start_run()

void FireEngineTemplate::start_run ( amrex::Real  stop_time,
int  max_step,
int  steps_per_coarse_step 
)
overridevirtual

Called after initialize(), once the run's end is known: anything that depends on stop_time or max_step (output schedules, a check that the ignition happens before the run ends). On a restart, read_checkpoint() comes after this.

Reimplemented from FireEngine.

◆ verify_prerequisites()

void FireEngineTemplate::verify_prerequisites ( const ERF &  erf,
int  lev 
)
overridevirtual

Check the engine's own inputs against the ERF configuration, once at start-up, before the fire grid is built. Abort naming the input on anything the engine cannot run (a missing fuel file, a time step its front tracking cannot take, a grid ratio it does not support).

Implements FireEngine.

◆ wants_surface_precip()

bool FireEngineTemplate::wants_surface_precip ( ) const
overridevirtual

Optional, false unless declared: true if advance() needs forcing.precip_accum_k0.

Reimplemented from FireEngine.

◆ write_checkpoint()

void FireEngineTemplate::write_checkpoint ( const std::string &  checkpointname) const
overridevirtual

Optional (the default writes nothing and the engine cannot restart). Write everything the engine carries from one step to the next under checkpointname/Level_<lev>/ (lev the fire grid's level). The coupling writes its lagged fluxes after this; use names that do not start with FireQ.

Reimplemented from FireEngine.

◆ write_plotfile()

void FireEngineTemplate::write_plotfile ( const std::string &  plotfile_prefix,
amrex::Real  time,
int  step 
) const
overridevirtual

Optional (the default writes nothing): the engine's plotfile of the fire grid, named plotfile_prefix plus the step.

Reimplemented from FireEngine.


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