2#ifndef FS_SIMPLE_FUELTYPE_H
3#define FS_SIMPLE_FUELTYPE_H
15template <
int BulkDensity,
int InorganicPercent,
int DuffDepth>
29 const FuelCodeSize&
code,
32 const Duff* duff_ffmc,
44 [[nodiscard]]
bool isValid()
const override {
return true; }
52 const noexcept override
55 return cfl() > 0 ? max(0.0, 1.0 - exp(-0.230 * (rss - rso))) : 0.0;
62 [[nodiscard]] ThresholdSize
probabilityPeat(
const MathSize mc_fraction)
const noexcept override
68 constexpr auto pi = fi * pb;
70 constexpr auto ri = fi / (1 - fi);
71 constexpr auto const_part = -19.329 + 1.7170 * ri + 23.059 * pi;
73 return 1 / (1 + exp(17.047 * mc_fraction / (1 - fi) + const_part));
90 static const auto WFfmc = 0.25;
91 static const auto WDmc = 1.0;
92 static const auto RatioHartford = 0.5;
93 static const auto RatioFrandsen = 1.0 - RatioHartford;
94 static const auto RatioAspen = 0.5;
95 static const auto RatioFuel = 1.0 - RatioAspen;
96 const auto mc_ffmc = wx.mcFfmc() * WFfmc + WDmc;
97 static const auto McFfmcSaturated = 2.5 * WFfmc + WDmc;
98 static const auto McDmc = WDmc;
100 const auto prob_ffmc_peat_saturated =
probabilityPeat(McFfmcSaturated);
102 const auto prob_ffmc_peat_weighted =
103 (prob_ffmc_peat - prob_ffmc_peat_saturated) / prob_ffmc_peat_zero;
107 const auto prob_ffmc_weighted = (prob_ffmc - prob_ffmc_saturated) / prob_ffmc_zero;
108 const auto term_otway = exp(-3.11 + 0.12 * wx.dmc.value);
109 const auto prob_otway = term_otway / (1 + term_otway);
116 const auto tot_prob =
118 - (1 - prob_ffmc_peat_weighted) * (1 - prob_ffmc_weighted)
119 * ((1 - prob_otway) * RatioAspen + ((1 - prob_weight_ffmc_peat) * RatioHartford + (1 - prob_weight_ffmc) * RatioFrandsen) * ((1 - prob_weight_dmc_peat) * RatioHartford + (1 - prob_weight_dmc) * RatioFrandsen) * RatioFuel);
126 [[nodiscard]]
static constexpr MathSize
bulkDensity() {
return BulkDensity / 1000.0; }
131 [[nodiscard]]
static constexpr MathSize
inorganicPercent() {
return InorganicPercent / 100.0; }
136 [[nodiscard]]
static constexpr MathSize
duffDepth() {
return DuffDepth / 10.0; }
194 [[nodiscard]]
bool isValid()
const override {
return false; }
204 [[nodiscard]] MathSize
cbh()
const override;
209 [[nodiscard]] MathSize
cfl()
const override;
214 [[nodiscard]] MathSize
buiEffect(MathSize)
const override;
An FBP fuel type.
Definition FuelType.h:42
constexpr FuelCodeSize code() const
Code for this fuel type.
Definition FuelType.h:212
virtual MathSize cfl() const =0
Crown fuel load (kg/m^2) [ST-X-3 table 8].
constexpr const char * name() const
Name of the fuel.
Definition FuelType.h:207
constexpr FuelType(const FuelCodeSize &code, const char *name, const bool can_crown) noexcept
Fuel type.
Definition FuelType.h:98
Information regarding spread within a Cell for a specific Scenario and time.
Definition FireSpread.h:40
Placeholder fuel that throws exceptions if it ever gets used.
Definition SimpleFuelType.h:175
MathSize calculateRos(int, const FwiWeather &, MathSize) const override
Throw a runtime_error.
MathSize buiEffect(MathSize) const override
Throw a runtime_error.
MathSize crownFractionBurned(MathSize, MathSize) const noexcept override
Throw a runtime_error.
MathSize lengthToBreadth(MathSize) const override
Throw a runtime_error.
constexpr InvalidFuel(const FuelCodeSize &code, const char *name) noexcept
Placeholder fuel that throws exceptions if it ever gets used.
Definition SimpleFuelType.h:183
MathSize grass_curing(const int nd, const FwiWeather &wx) const override
Throw a runtime_error.
MathSize cbh() const override
Throw a runtime_error.
ThresholdSize survivalProbability(const FwiWeather &) const noexcept override
Throw a runtime_error.
MathSize finalRos(const SpreadInfo &, MathSize, MathSize, MathSize) const override
Throw a runtime_error.
MathSize crownConsumption(MathSize) const override
Throw a runtime_error.
MathSize surfaceFuelConsumption(const SpreadInfo &) const override
Throw a runtime_error.
ThresholdSize probabilityPeat(MathSize) const noexcept override
Throw a runtime_error.
MathSize cfl() const override
Throw a runtime_error.
bool isValid() const override
Is fuel a valid fuel type.
Definition SimpleFuelType.h:194
MathSize criticalSurfaceIntensity(const SpreadInfo &) const override
Throw a runtime_error.
MathSize calculateIsf(const SpreadInfo &, MathSize) const override
Throw a runtime_error.
Base class for all FuelTypes.
Definition SimpleFuelType.h:17
static constexpr MathSize ffmcRatio()
What fraction of the duff layer should use FFMC to determine moisture.
Definition SimpleFuelType.h:151
bool isValid() const override
Is fuel a valid fuel type.
Definition SimpleFuelType.h:44
static constexpr MathSize bulkDensity()
Duff Bulk Density (kg/m^3) [Anderson table 1].
Definition SimpleFuelType.h:126
constexpr SimpleFuelBase(const FuelCodeSize &code, const char *name, const bool can_crown, const Duff *duff_ffmc, const Duff *duff_dmc)
Constructor.
Definition SimpleFuelType.h:28
ThresholdSize survivalProbability(const FwiWeather &wx) const noexcept override
Survival probability calculated using probability of ony survival based on multiple formulae.
Definition SimpleFuelType.h:81
static constexpr MathSize dmcRatio()
What fraction of the duff layer should use DMC to determine moisture.
Definition SimpleFuelType.h:156
const Duff * duff_dmc_
Type of duff deeper underground.
Definition SimpleFuelType.h:169
MathSize crownFractionBurned(const MathSize rss, const MathSize rso) const noexcept override
Crown Fraction Burned (CFB) [ST-X-3 eq 58].
Definition SimpleFuelType.h:51
static constexpr MathSize inorganicPercent()
Inorganic Percent (% / 100) [Anderson table 1].
Definition SimpleFuelType.h:131
const Duff * duff_ffmc_
Type of duff near the surface.
Definition SimpleFuelType.h:165
constexpr const Duff * duffFfmcType() const
Type of duff near the surface.
Definition SimpleFuelType.h:146
ThresholdSize probabilityPeat(const MathSize mc_fraction) const noexcept override
Calculate probability of burning [Anderson eq 1].
Definition SimpleFuelType.h:62
static constexpr MathSize duffDepth()
DuffDepth Depth of Duff layer (cm) [Anderson table 1].
Definition SimpleFuelType.h:136
constexpr const Duff * duffDmcType() const
Type of duff deeper underground.
Definition SimpleFuelType.h:141
A Weather value with calculated FWI indices.
Definition FWI.h:142
A specific type of Duff layer, and the associated smouldering coefficients.
Definition Duff.h:40
ThresholdSize probabilityOfSurvival(const MathSize mc_pct) const noexcept
Probability of survival (% / 100) [eq Ig-1].
Definition Duff.h:70