1 #ifndef ERF_STRUCTURE_MODEL_H
2 #define ERF_STRUCTURE_MODEL_H
5 #include <AMReX_FArrayBox.H>
6 #include <AMReX_Geometry.H>
7 #include <AMReX_MultiFab.H>
8 #include <AMReX_REAL.H>
9 #include <AMReX_RealBox.H>
69 const amrex::Geometry&
geom;
70 const amrex::MultiFab&
xvel;
169 virtual const char*
name ()
const = 0;
190 virtual int level (
int finest_level)
const = 0;
203 virtual std::vector<amrex::RealBox>
support ()
const = 0;
225 virtual void fixed_dt_changed (
int lev,
double fixed_dt) { amrex::ignore_unused(lev, fixed_dt); }
262 amrex::MultiFab& xmom_src,
263 amrex::MultiFab& ymom_src,
264 amrex::MultiFab& zmom_src)
const = 0;
275 amrex::ignore_unused(checkpointname);
314 amrex::MultiFab& dst,
int comp)
const
316 amrex::ignore_unused(
name, lev);
317 dst.setVal(amrex::Real(0.0), comp, 1, 0);
A model of structures in the flow, behind ERF's structure coupling.
Definition: ERF_StructureModel.H:164
virtual void write_checkpoint(const std::string &checkpointname) const
Write the model's state under the checkpoint directory.
Definition: ERF_StructureModel.H:273
virtual bool wants_immersed_terrain_surface() const
The model wants StructureInit::immersed_terrain_surface (ERF builds it only on request).
Definition: ERF_StructureModel.H:206
virtual void finalize()
The run has ended normally.
Definition: ERF_StructureModel.H:293
virtual void fixed_dt_changed(int lev, double fixed_dt)
ERF lowered the fixed step after initialize()
Definition: ERF_StructureModel.H:225
virtual void fill_plot_var(const std::string &name, int lev, amrex::MultiFab &dst, int comp) const
Fill the field plot_var_names() lists as name on level lev.
Definition: ERF_StructureModel.H:313
virtual bool supports_restart() const
The model restores its state in initialize() on a restart.
Definition: ERF_StructureModel.H:284
virtual void add_momentum_sources(int lev, amrex::MultiFab &xmom_src, amrex::MultiFab &ymom_src, amrex::MultiFab &zmom_src) const =0
Add the structures' force on the air to the momentum sources.
virtual std::vector< std::string > plot_var_names() const
Fields the ERF plotfile can carry, by name.
Definition: ERF_StructureModel.H:304
virtual void initialize(const StructureInit &init)=0
Set the model up once the mesh and the initial state exist.
virtual ~StructureModel()=default
virtual const char * name() const =0
Name of the model, as erf.structures.model selects it.
virtual void advance(const StructureStep &step)=0
Advance the structures over one step of level()
virtual int level(int finest_level) const =0
The level the model couples to.
virtual std::vector< amrex::RealBox > support() const =0
Where the model's force can be nonzero this step.
What a structure model may read from the fire, when the run has one.
Definition: ERF_StructureModel.H:125
std::function< amrex::Real()> burned_area
Definition: ERF_StructureModel.H:133
int lev
The atmospheric level the fire grid refines.
Definition: ERF_StructureModel.H:127
const amrex::Geometry & geom
Geometry of the fire grid [m] (one cell in z)
Definition: ERF_StructureModel.H:126
const amrex::MultiFab * level_set
Definition: ERF_StructureModel.H:130
double time
The time the fields belong to [s] (see above)
Definition: ERF_StructureModel.H:128
const amrex::MultiFab * heat_release
Heat released [W/m2] on the fire grid (FireEngine::heat_release); nullptr if the engine has none.
Definition: ERF_StructureModel.H:129
What a structure model reads once, at start-up.
Definition: ERF_StructureModel.H:66
bool keqn_rans
Level lev runs the k-equation RANS closure, so cons holds rho k.
Definition: ERF_StructureModel.H:79
const amrex::Geometry & geom
Geometry of level lev.
Definition: ERF_StructureModel.H:69
double fixed_dt
Definition: ERF_StructureModel.H:88
const amrex::MultiFab & xvel
x-velocity on x-faces [m/s]
Definition: ERF_StructureModel.H:70
int lev
The level the model couples to.
Definition: ERF_StructureModel.H:67
const amrex::FArrayBox * immersed_terrain_surface
Definition: ERF_StructureModel.H:77
double stop_time
Definition: ERF_StructureModel.H:93
int max_step
Definition: ERF_StructureModel.H:96
bool fully_compressible
Definition: ERF_StructureModel.H:100
amrex::Real Cmu0
The closure's C_mu^0 on level lev.
Definition: ERF_StructureModel.H:80
const amrex::MultiFab * z_phys_nd
Nodal height [m] of a stretched or terrain-following mesh; nullptr on a uniform-dz mesh (flat ground ...
Definition: ERF_StructureModel.H:71
std::string restart_chkfile
Definition: ERF_StructureModel.H:81
bool unit_map_factors
Every map factor of level lev is 1 (the actuator core assumes so)
Definition: ERF_StructureModel.H:78
double time
Simulation time [s]: 0, or the checkpoint's time on a restart.
Definition: ERF_StructureModel.H:68
const amrex::MultiFab * detJ_cc
Definition: ERF_StructureModel.H:72
The flow a structure model reads at the start of each step of its level.
Definition: ERF_StructureModel.H:144
const amrex::MultiFab & cons
The conserved state (rho, rho theta, the scalars; rho k with the k-equation RANS)
Definition: ERF_StructureModel.H:153
const amrex::Geometry & geom
Geometry of level lev.
Definition: ERF_StructureModel.H:149
const amrex::MultiFab & zvel
z-velocity on z-faces [m/s]
Definition: ERF_StructureModel.H:152
double time
Start of the step [s].
Definition: ERF_StructureModel.H:147
const amrex::MultiFab * detJ_cc
Cell Jacobian; nullptr on a uniform-dz mesh, as in StructureInit.
Definition: ERF_StructureModel.H:155
const amrex::MultiFab & xvel
x-velocity on x-faces [m/s]
Definition: ERF_StructureModel.H:150
const amrex::MultiFab * z_phys_nd
Nodal height [m]; nullptr on a uniform-dz mesh, as in StructureInit.
Definition: ERF_StructureModel.H:154
double dt
Step of level lev [s], in double as ERF keeps it, also in a single-precision build.
Definition: ERF_StructureModel.H:148
int finest_level
ERF's finest level now.
Definition: ERF_StructureModel.H:146
const StructureFire * fire
The fire (see StructureFire) when the run has one; nullptr otherwise.
Definition: ERF_StructureModel.H:157
int lev
The level the model couples to.
Definition: ERF_StructureModel.H:145
bool unit_map_factors
Every map factor of level lev is 1 now (checked each step, so also after a regrid)
Definition: ERF_StructureModel.H:156
const amrex::MultiFab & yvel
y-velocity on y-faces [m/s]
Definition: ERF_StructureModel.H:151