ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_FireEngineTemplate.H File Reference

A starting point for a new fire engine: declarations only. More...

#include <ERF_FireEngine.H>
Include dependency graph for ERF_FireEngineTemplate.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  FireEngineTemplate
 

Detailed Description

A starting point for a new fire engine: declarations only.

This class declares every FireEngine method a new fire model provides and says what ERF hands it and expects back. Nothing here has a body, no input selects it and nothing creates one, so it adds no code to ERF. The stand-in engine of the FireCoupler unit tests (Tests/Unit/Fire/ERF_GTestFireCoupler.cpp) is the smallest engine that works.

To start a new engine:

  1. Copy this file into the new model's engine directory (outside ERF), rename the class and the include guard, and write the bodies in a .cpp file there. Delete the declarations of the optional methods the engine does not provide (their defaults in FireEngine then apply); a declaration left without a body fails to link.
  2. Read the model's inputs under its own prefix (fire.<engine>.* is recommended), so they never mix with the coupling's keys (FireCouplingParams, erf.fire.*) or another engine's.
  3. Register the engine in that .cpp, at namespace scope: ERF_REGISTER_FIRE_ENGINE(MyEngine, "my_fire") (ERF_FireEngineRegistry.H), and give the engine directory a Make.package (GNU make, FIRE_HOME) and an ERFFireEngine.cmake defining erf_fire_engine_add(target) (CMake, ERF_FIRE_ENGINE_DIRS). Tests/FireEngineExample is a complete engine directory to copy.
  4. Run the FireCoupler unit tests with the new engine in place of their stand-in, and a restart of a coupled run against a straight run: the atmosphere and fire plotfiles must agree at zero tolerance.

What the coupling layer already does for every engine: it builds the fire grid over erf.fire.anchor_level, hands the engine the atmosphere's state each step, averages the engine's fluxes onto the atmospheric columns, holds them one step, injects heat, vapour and smoke, and saves those lagged fluxes in the checkpoint. An engine owns only its fire physics and its own state.

The call order is the one documented on FireEngine (ERF_FireEngine.H). ERF_FireCoupler.cpp checks at compile time that this class declares every method FireEngine requires (the pure virtual ones), and override checks the signature of every method declared here. The optional methods are listed by hand: a new optional method in FireEngine is added here too.