FireSTARR
Loading...
Searching...
No Matches
SimpleFBP.h
1/* SPDX-License-Identifier: AGPL-3.0-or-later */
2#ifndef FS_SIMPLE_FBP_H
3#define FS_SIMPLE_FBP_H
4#include "stdafx.h"
5#include "Duff.h"
6#include "LookupTable.h"
7#include "Settings.h"
8#include "SimpleStandardFuel.h"
9#ifdef DEBUG_FUEL_VARIABLE
10#include "Log.h"
11#endif
12namespace fs::simplefbp
13{
14using settings::Settings;
20[[nodiscard]] constexpr bool calculate_is_green(const int nd) { return nd >= 30; }
25static constexpr int START_GREENING = -43;
26[[nodiscard]] constexpr int calculate_grass_curing(const int nd)
27{
28 const auto curing = (nd < START_GREENING)
29 ? // we're before foliar moisture dip has started
30 100
31 : (nd >= 50)
32 ? 0 // foliar moisture is at 120.0, so grass should be totally uncured
33 // HACK: invent a formula that has 50% curing at the bottom of the foliar
34 // moisture dip foliar moisture above ranges between 120 and 85, with 85
35 // being at the point where we want 50% cured Curing:
36 // -43 => 100, 0 => 50, 50 => 0 least-squares best fit:
37 : static_cast<int>(52.5042 - 1.07324 * nd);
38 return max(0, min(100, curing));
39}
40[[nodiscard]] static MathSize calculate_surface_fuel_consumption_mixed_or_c2(const MathSize bui
41) noexcept
42{
43 return 5.0 * (1.0 - exp(-0.0115 * bui));
44}
45static const LookupTable<&calculate_surface_fuel_consumption_mixed_or_c2>
46 SURFACE_FUEL_CONSUMPTION_MIXED_OR_C2{};
47[[nodiscard]] static MathSize calculate_surface_fuel_consumption_d1(const MathSize bui) noexcept
48{
49 return 1.5 * (1.0 - exp(-0.0183 * bui));
50}
51static LookupTable<&calculate_surface_fuel_consumption_d1> SURFACE_FUEL_CONSUMPTION_D1{};
64template <
65 int A,
66 int B,
67 int C,
68 int Bui0,
69 int Cbh,
70 int Cfl,
71 int BulkDensity,
72 int InorganicPercent,
73 int DuffDepth>
75 : public SimpleStandardFuel<A, B, C, Bui0, Cbh, Cfl, BulkDensity, InorganicPercent, DuffDepth>
76{
77public:
78 SimpleFuelNonMixed() = delete;
79 ~SimpleFuelNonMixed() override = default;
80 SimpleFuelNonMixed(const SimpleFuelNonMixed& rhs) noexcept = delete;
81 SimpleFuelNonMixed(SimpleFuelNonMixed&& rhs) noexcept = delete;
82 SimpleFuelNonMixed& operator=(const SimpleFuelNonMixed& rhs) noexcept = delete;
83 SimpleFuelNonMixed& operator=(SimpleFuelNonMixed&& rhs) noexcept = delete;
84
85protected:
86 using SimpleStandardFuel<A, B, C, Bui0, Cbh, Cfl, BulkDensity, InorganicPercent, DuffDepth>::
88
89public:
96 [[nodiscard]] MathSize calculateIsf(const SpreadInfo& spread, const MathSize isi)
97 const noexcept override
98 {
99 return this->limitIsf(
100 1.0, calculateRos(spread.nd(), *spread.weather, isi) * spread.slopeFactor()
101 );
102 }
108 MathSize calculateRos(const int, const FwiWeather&, const MathSize isi) const noexcept override
109 {
110 return this->rosBasic(isi);
111 }
112};
125template <
126 int A,
127 int B,
128 int C,
129 int Bui0,
130 int Cbh,
131 int Cfl,
132 int BulkDensity,
133 int InorganicPercent,
134 int DuffDepth>
136 : public SimpleFuelNonMixed<A, B, C, Bui0, Cbh, Cfl, BulkDensity, InorganicPercent, DuffDepth>
137{
138public:
139 SimpleFuelConifer() = delete;
140 ~SimpleFuelConifer() override = default;
141 SimpleFuelConifer(const SimpleFuelConifer& rhs) noexcept = delete;
142 SimpleFuelConifer(SimpleFuelConifer&& rhs) noexcept = delete;
143 SimpleFuelConifer& operator=(const SimpleFuelConifer& rhs) noexcept = delete;
144 SimpleFuelConifer& operator=(SimpleFuelConifer&& rhs) noexcept = delete;
145
146protected:
156 const FuelCodeSize& code,
157 const char* name,
158 const LogValue log_q,
159 const Duff* duff_ffmc,
160 const Duff* duff_dmc
161 )
162 : SimpleFuelNonMixed<A, B, C, Bui0, Cbh, Cfl, BulkDensity, InorganicPercent, DuffDepth>(
163 code,
164 name,
165 true,
166 log_q,
167 duff_ffmc,
168 duff_dmc
169 )
170 { }
179 const FuelCodeSize& code,
180 const char* name,
181 const LogValue log_q,
182 const Duff* duff
183 )
184 : SimpleFuelConifer(code, name, log_q, duff, duff)
185 { }
186};
192[[nodiscard]] static MathSize calculate_surface_fuel_consumption_jackpine(const MathSize bui
193) noexcept
194{
195 return 5.0 * pow(1.0 - exp(-0.0164 * bui), 2.24);
196}
201static LookupTable<&calculate_surface_fuel_consumption_jackpine> SURFACE_FUEL_CONSUMPTION_JACKPINE{
202};
214template <int A, int B, int C, int Bui0, int Cbh, int Cfl, int BulkDensity, int DuffDepth>
216 : public SimpleFuelConifer<A, B, C, Bui0, Cbh, Cfl, BulkDensity, 15, DuffDepth>
217{
218public:
219 SimpleFuelJackpine() = delete;
220 ~SimpleFuelJackpine() override = default;
221 SimpleFuelJackpine(const SimpleFuelJackpine& rhs) noexcept = delete;
222 SimpleFuelJackpine(SimpleFuelJackpine&& rhs) noexcept = delete;
223 SimpleFuelJackpine& operator=(const SimpleFuelJackpine& rhs) noexcept = delete;
224 SimpleFuelJackpine& operator=(SimpleFuelJackpine&& rhs) noexcept = delete;
225 using SimpleFuelConifer<A, B, C, Bui0, Cbh, Cfl, BulkDensity, 15, DuffDepth>::SimpleFuelConifer;
231 [[nodiscard]] MathSize surfaceFuelConsumption(const SpreadInfo& spread) const noexcept override
232 {
233 return SURFACE_FUEL_CONSUMPTION_JACKPINE(spread.weather->bui.value);
234 }
235};
241[[nodiscard]] static MathSize calculate_surface_fuel_consumption_pine(const MathSize bui) noexcept
242{
243 return 5.0 * pow(1.0 - exp(-0.0149 * bui), 2.48);
244}
250static LookupTable<&calculate_surface_fuel_consumption_pine> SURFACE_FUEL_CONSUMPTION_PINE{};
262template <int A, int B, int C, int Bui0, int Cbh, int Cfl, int BulkDensity, int DuffDepth>
263class FuelPine : public SimpleFuelConifer<A, B, C, Bui0, Cbh, Cfl, BulkDensity, 15, DuffDepth>
264{
265public:
266 FuelPine() = delete;
267 ~FuelPine() override = default;
268 FuelPine(const FuelPine& rhs) noexcept = delete;
269 FuelPine(FuelPine&& rhs) noexcept = delete;
270 FuelPine& operator=(const FuelPine& rhs) noexcept = delete;
271 FuelPine& operator=(FuelPine&& rhs) noexcept = delete;
272 using SimpleFuelConifer<A, B, C, Bui0, Cbh, Cfl, BulkDensity, 15, DuffDepth>::SimpleFuelConifer;
278 [[nodiscard]] MathSize surfaceFuelConsumption(const SpreadInfo& spread) const noexcept override
279 {
280 return SURFACE_FUEL_CONSUMPTION_PINE(spread.weather->bui.value);
281 }
282};
286class SimpleFuelD1 : public SimpleFuelNonMixed<30, 232, 160, 32, 0, 0, 61, 59, 24>
287{
288public:
289 SimpleFuelD1() = delete;
290 ~SimpleFuelD1() override = default;
291 SimpleFuelD1(const SimpleFuelD1& rhs) noexcept = delete;
292 SimpleFuelD1(SimpleFuelD1&& rhs) noexcept = delete;
293 SimpleFuelD1& operator=(const SimpleFuelD1& rhs) noexcept = delete;
294 SimpleFuelD1& operator=(SimpleFuelD1&& rhs) noexcept = delete;
299 explicit constexpr SimpleFuelD1(const FuelCodeSize& code) noexcept
300 : SimpleFuelNonMixed(code, "D-1", false, LOG_0_90, &duff::Peat)
301 { }
307 [[nodiscard]] MathSize surfaceFuelConsumption(const SpreadInfo& spread) const noexcept override
308 {
309 return SURFACE_FUEL_CONSUMPTION_D1(spread.weather->bui.value);
310 }
318 [[nodiscard]] MathSize isfD1(const SpreadInfo& spread, MathSize ros_multiplier, MathSize isi)
319 const noexcept;
320};
333template <
334 int A,
335 int B,
336 int C,
337 int Bui0,
338 int RosMultiplier,
339 int PercentMixed,
340 int BulkDensity,
341 int InorganicPercent,
342 int DuffDepth>
344 : public SimpleStandardFuel<A, B, C, Bui0, 6, 80, BulkDensity, InorganicPercent, DuffDepth>
345{
346public:
347 SimpleFuelMixed() = delete;
348 ~SimpleFuelMixed() override = default;
349 SimpleFuelMixed(const SimpleFuelMixed& rhs) noexcept = delete;
350 SimpleFuelMixed(SimpleFuelMixed&& rhs) noexcept = delete;
351 SimpleFuelMixed& operator=(const SimpleFuelMixed& rhs) noexcept = delete;
352 SimpleFuelMixed& operator=(SimpleFuelMixed&& rhs) noexcept = delete;
359 constexpr SimpleFuelMixed(const FuelCodeSize& code, const char* name, const LogValue log_q)
360 : SimpleStandardFuel<A, B, C, Bui0, 6, 80, BulkDensity, InorganicPercent, DuffDepth>(
361 code,
362 name,
363 true,
364 log_q,
365 &duff::Peat,
366 &duff::Peat
367 )
368 { }
374 [[nodiscard]] MathSize surfaceFuelConsumption(const SpreadInfo& spread) const noexcept override
375 {
376 return SURFACE_FUEL_CONSUMPTION_MIXED_OR_C2(spread.weather->bui.value);
377 }
383 [[nodiscard]] MathSize crownConsumption(const MathSize cfb) const noexcept override
384 {
385 return ratioConifer()
388 }
394 [[nodiscard]] MathSize calculateRos(const int, const FwiWeather&, const MathSize isi)
395 const noexcept override
396 {
397 static const SimpleFuelD1 F{14};
398 return ratioConifer() * this->rosBasic(isi)
399 + rosMultiplier() * ratioDeciduous() * F.rosBasic(isi);
400 }
407 [[nodiscard]] MathSize calculateIsf(const SpreadInfo& spread, const MathSize isi)
408 const noexcept override
409 {
410 return ratioConifer() * this->limitIsf(1.0, spread.slopeFactor() * this->rosBasic(isi))
411 + ratioDeciduous() * isfD1(spread, isi);
412 }
417 [[nodiscard]] static constexpr MathSize ratioConifer() { return PercentMixed / 100.0; }
422 [[nodiscard]] static constexpr MathSize ratioDeciduous() { return 1.0 - (PercentMixed / 100.0); }
423
424protected:
429 [[nodiscard]] static constexpr MathSize rosMultiplier() { return RosMultiplier / 10.0; }
436 [[nodiscard]] static MathSize isfD1(const SpreadInfo& spread, const MathSize isi) noexcept
437 {
438 static const SimpleFuelD1 F{14};
439 return F.isfD1(spread, rosMultiplier(), isi);
440 }
441};
451template <int A, int B, int C, int Bui0, int RosMultiplier, int PercentDeadFir>
453 : public SimpleFuelMixed<A, B, C, Bui0, RosMultiplier, PercentDeadFir, 61, 15, 75>
454{
455public:
456 SimpleFuelMixedDead() = delete;
457 ~SimpleFuelMixedDead() override = default;
458 SimpleFuelMixedDead(const SimpleFuelMixedDead& rhs) noexcept = delete;
459 SimpleFuelMixedDead(SimpleFuelMixedDead&& rhs) noexcept = delete;
460 SimpleFuelMixedDead& operator=(const SimpleFuelMixedDead& rhs) noexcept = delete;
461 SimpleFuelMixedDead& operator=(SimpleFuelMixedDead&& rhs) noexcept = delete;
468 constexpr SimpleFuelMixedDead(const FuelCodeSize& code, const char* name, const LogValue log_q)
469 : SimpleFuelMixed<A, B, C, Bui0, RosMultiplier, PercentDeadFir, 61, 15, 75>(code, name, log_q)
470 { }
471};
477template <int RosMultiplier, int RatioMixed>
479 : public SimpleFuelMixed<110, 282, 150, 50, RosMultiplier, RatioMixed, 108, 25, 50>
480{
481public:
482 SimpleFuelMixedWood() = delete;
483 ~SimpleFuelMixedWood() override = default;
484 SimpleFuelMixedWood(const SimpleFuelMixedWood& rhs) noexcept = delete;
485 SimpleFuelMixedWood(SimpleFuelMixedWood&& rhs) noexcept = delete;
486 SimpleFuelMixedWood& operator=(const SimpleFuelMixedWood& rhs) noexcept = delete;
487 SimpleFuelMixedWood& operator=(SimpleFuelMixedWood&& rhs) noexcept = delete;
493 constexpr SimpleFuelMixedWood(const FuelCodeSize& code, const char* name)
494 : SimpleFuelMixed<110, 282, 150, 50, RosMultiplier, RatioMixed, 108, 25, 50>(
495 code,
496 name,
497 LOG_0_80
498 )
499 { }
505 [[nodiscard]] MathSize surfaceFuelConsumption(const SpreadInfo& spread) const noexcept override
506 {
507 return this->ratioConifer()
510 + this->ratioDeciduous() * SURFACE_FUEL_CONSUMPTION_D1(spread.weather->bui.value);
511 }
512};
516[[nodiscard]] static MathSize calculate_length_to_breadth_grass(const MathSize ws) noexcept
517{
518 return ws < 1.0 ? 1.0 : (1.1 * pow(ws, 0.464));
519}
523static LookupTable<calculate_length_to_breadth_grass> LENGTH_TO_BREADTH_GRASS{};
529[[nodiscard]] static MathSize calculate_base_multiplier_curing(const MathSize curing) noexcept
530{
531 return (curing >= 58.8) ? (0.176 + 0.02 * (curing - 58.8)) : (0.005 * expm1(0.061 * curing));
532}
537static LookupTable<&calculate_base_multiplier_curing> BASE_MULTIPLIER_CURING{};
544template <int A, int B, int C>
546 : public SimpleStandardFuel<A, B, C, 1, 0, 0, 0, 0, static_cast<int>(DUFF_FFMC_DEPTH * 10.0)>
547{
548public:
549 SimpleFuelGrass() = delete;
550 ~SimpleFuelGrass() override = default;
551 SimpleFuelGrass(const SimpleFuelGrass& rhs) noexcept = delete;
552 SimpleFuelGrass(SimpleFuelGrass&& rhs) noexcept = delete;
553 SimpleFuelGrass& operator=(const SimpleFuelGrass& rhs) noexcept = delete;
554 SimpleFuelGrass& operator=(SimpleFuelGrass&& rhs) noexcept = delete;
561 constexpr SimpleFuelGrass(const FuelCodeSize& code, const char* name, const LogValue log_q)
562 // HACK: grass assumes no duff (total duff depth == ffmc depth => dmc depth is 0)
563 : SimpleStandardFuel<A, B, C, 1, 0, 0, 0, 0, static_cast<int>(DUFF_FFMC_DEPTH * 10.0)>(
564 code,
565 name,
566 false,
567 log_q,
568 &duff::PeatMuck,
569 &duff::PeatMuck
570 )
571 { }
576 [[nodiscard]] MathSize surfaceFuelConsumption(const SpreadInfo&) const noexcept override
577 {
578 return DEFAULT_GRASS_FUEL_LOAD;
579 }
584 [[nodiscard]] MathSize grass_curing(const int nd, const FwiWeather& wx) const override
585 {
586 // HACK: resolve once and fail if not set already
587 static const auto& settings = fs::settings::instance();
588 if (settings.static_curing.has_value())
589 {
590 return settings.static_curing.value();
591 }
592 const auto is_drought = wx.dc.value > 500;
593 return is_drought ? 100 : calculate_grass_curing(nd);
594 }
601 [[nodiscard]] MathSize baseMultiplier(const int nd, const FwiWeather& wx) const noexcept
602 {
603 return BASE_MULTIPLIER_CURING(grass_curing(nd, wx));
604 }
611 [[nodiscard]] MathSize calculateIsf(const SpreadInfo& spread, const MathSize isi)
612 const noexcept override
613 {
614 const auto mu = baseMultiplier(spread.nd(), *spread.weather);
615 // prevent divide by 0
616 const auto mu_not_zero = max(0.001, mu);
617 return this->limitIsf(mu_not_zero, calculateRos(mu, isi) * spread.slopeFactor());
618 }
626 [[nodiscard]] MathSize calculateRos(const int nd, const FwiWeather& wx, const MathSize isi)
627 const noexcept override
628 {
629 return calculateRos(baseMultiplier(nd, wx), isi);
630 }
631
632public:
638 [[nodiscard]] MathSize lengthToBreadth(const MathSize ws) const noexcept override
639 {
640 return LENGTH_TO_BREADTH_GRASS(ws);
641 }
642
643public:
650 [[nodiscard]] MathSize calculateRos(const MathSize multiplier, const MathSize isi) const noexcept
651 {
652 return multiplier * this->rosBasic(isi);
653 }
654};
658class SimpleFuelC1 : public SimpleFuelConifer<90, 649, 450, 72, 2, 75, 45, 5, 34>
659{
660public:
661 SimpleFuelC1() = delete;
662 ~SimpleFuelC1() override = default;
663 SimpleFuelC1(const SimpleFuelC1& rhs) noexcept = delete;
664 SimpleFuelC1(SimpleFuelC1&& rhs) noexcept = delete;
665 SimpleFuelC1& operator=(const SimpleFuelC1& rhs) noexcept = delete;
666 SimpleFuelC1& operator=(SimpleFuelC1&& rhs) noexcept = delete;
671 explicit constexpr SimpleFuelC1(const FuelCodeSize& code) noexcept
672 : SimpleFuelConifer(code, "C-1", LOG_0_90, &duff::Reindeer, &duff::Peat)
673 { }
679 [[nodiscard]] MathSize surfaceFuelConsumption(const SpreadInfo& spread) const noexcept override;
680};
684class SimpleFuelC2 : public SimpleFuelConifer<110, 282, 150, 64, 3, 80, 34, 0, 100>
685{
686public:
687 SimpleFuelC2() = delete;
688 ~SimpleFuelC2() override = default;
689 SimpleFuelC2(const SimpleFuelC2& rhs) noexcept = delete;
690 SimpleFuelC2(SimpleFuelC2&& rhs) noexcept = delete;
691 SimpleFuelC2& operator=(const SimpleFuelC2& rhs) noexcept = delete;
692 SimpleFuelC2& operator=(SimpleFuelC2&& rhs) noexcept = delete;
697 explicit constexpr SimpleFuelC2(const FuelCodeSize& code) noexcept
698 : SimpleFuelConifer(code, "C-2", LOG_0_70, &duff::SphagnumUpper)
699 { }
705 [[nodiscard]] MathSize surfaceFuelConsumption(const SpreadInfo& spread) const noexcept override;
706};
710class SimpleFuelC3 : public SimpleFuelJackpine<110, 444, 300, 62, 8, 115, 20, 65>
711{
712public:
713 SimpleFuelC3() = delete;
714 ~SimpleFuelC3() override = default;
715 SimpleFuelC3(const SimpleFuelC3& rhs) noexcept = delete;
716 SimpleFuelC3(SimpleFuelC3&& rhs) noexcept = delete;
717 SimpleFuelC3& operator=(const SimpleFuelC3& rhs) noexcept = delete;
718 SimpleFuelC3& operator=(SimpleFuelC3&& rhs) noexcept = delete;
723 explicit constexpr SimpleFuelC3(const FuelCodeSize& code) noexcept
724 : SimpleFuelJackpine(code, "C-3", LOG_0_75, &duff::FeatherMoss, &duff::PineSeney)
725 { }
726};
730class SimpleFuelC4 : public SimpleFuelJackpine<110, 293, 150, 66, 4, 120, 31, 62>
731{
732public:
733 SimpleFuelC4() = delete;
734 ~SimpleFuelC4() override = default;
735 SimpleFuelC4(const SimpleFuelC4& rhs) noexcept = delete;
736 SimpleFuelC4(SimpleFuelC4&& rhs) noexcept = delete;
737 SimpleFuelC4& operator=(const SimpleFuelC4& rhs) noexcept = delete;
738 SimpleFuelC4& operator=(SimpleFuelC4&& rhs) noexcept = delete;
743 explicit constexpr SimpleFuelC4(const FuelCodeSize& code) noexcept
744 : SimpleFuelJackpine(code, "C-4", LOG_0_80, &duff::PineSeney)
745 { }
746};
750class SimpleFuelC5 : public FuelPine<30, 697, 400, 56, 18, 120, 93, 46>
751{
752public:
753 SimpleFuelC5() = delete;
754 ~SimpleFuelC5() override = default;
755 SimpleFuelC5(const SimpleFuelC5& rhs) noexcept = delete;
756 SimpleFuelC5(SimpleFuelC5&& rhs) noexcept = delete;
757 SimpleFuelC5& operator=(const SimpleFuelC5& rhs) noexcept = delete;
758 SimpleFuelC5& operator=(SimpleFuelC5&& rhs) noexcept = delete;
763 explicit constexpr SimpleFuelC5(const FuelCodeSize& code) noexcept
764 : FuelPine(code, "C-5", LOG_0_80, &duff::PineSeney)
765 { }
766};
770class SimpleFuelC6 : public FuelPine<30, 800, 300, 62, 7, 180, 50, 50>
771{
772public:
773 SimpleFuelC6() = delete;
774 ~SimpleFuelC6() override = default;
775 SimpleFuelC6(const SimpleFuelC6& rhs) noexcept = delete;
776 SimpleFuelC6(SimpleFuelC6&& rhs) noexcept = delete;
777 SimpleFuelC6& operator=(const SimpleFuelC6& rhs) noexcept = delete;
778 SimpleFuelC6& operator=(SimpleFuelC6&& rhs) noexcept = delete;
783 explicit constexpr SimpleFuelC6(const FuelCodeSize& code) noexcept
784 : FuelPine(code, "C-6", LOG_0_80, &duff::PineSeney)
785 { }
786
787protected:
796 [[nodiscard]] MathSize finalRos(
797 const SpreadInfo& spread,
798 MathSize isi,
799 MathSize cfb,
800 MathSize rss
801 ) const noexcept override;
802};
806class SimpleFuelC7 : public SimpleFuelConifer<45, 305, 200, 106, 10, 50, 20, 15, 50>
807{
808public:
809 SimpleFuelC7() = delete;
810 ~SimpleFuelC7() override = default;
811 SimpleFuelC7(const SimpleFuelC7& rhs) noexcept = delete;
812 SimpleFuelC7(SimpleFuelC7&& rhs) noexcept = delete;
813 SimpleFuelC7& operator=(const SimpleFuelC7& rhs) noexcept = delete;
814 SimpleFuelC7& operator=(SimpleFuelC7&& rhs) noexcept = delete;
819 explicit constexpr SimpleFuelC7(const FuelCodeSize& code) noexcept
820 : SimpleFuelConifer(code, "C-7", LOG_0_85, &duff::SprucePine)
821 { }
827 [[nodiscard]] MathSize surfaceFuelConsumption(const SpreadInfo& spread) const noexcept override;
828};
832class SimpleFuelD2 : public SimpleFuelNonMixed<6, 232, 160, 32, 0, 0, 61, 59, 24>
833{
834public:
835 SimpleFuelD2() = delete;
836 ~SimpleFuelD2() override = default;
837 SimpleFuelD2(const SimpleFuelD2& rhs) noexcept = delete;
838 SimpleFuelD2(SimpleFuelD2&& rhs) noexcept = delete;
839 SimpleFuelD2& operator=(const SimpleFuelD2& rhs) noexcept = delete;
840 SimpleFuelD2& operator=(SimpleFuelD2&& rhs) noexcept = delete;
841 // HACK: assume same bulk_density and inorganicContent as D1
846 explicit constexpr SimpleFuelD2(const FuelCodeSize& code) noexcept
847 : SimpleFuelNonMixed(code, "D-2", false, LOG_0_90, &duff::Peat)
848 { }
854 [[nodiscard]] MathSize surfaceFuelConsumption(const SpreadInfo& spread) const noexcept override;
862 [[nodiscard]] MathSize calculateRos(int nd, const FwiWeather& wx, MathSize isi)
863 const noexcept override;
864};
869template <int PercentConifer>
870class SimpleFuelM1 : public SimpleFuelMixedWood<10, PercentConifer>
871{
872public:
873 SimpleFuelM1() = delete;
874 ~SimpleFuelM1() override = default;
875 SimpleFuelM1(const SimpleFuelM1& rhs) noexcept = delete;
876 SimpleFuelM1(SimpleFuelM1&& rhs) noexcept = delete;
877 SimpleFuelM1& operator=(const SimpleFuelM1& rhs) noexcept = delete;
878 SimpleFuelM1& operator=(SimpleFuelM1&& rhs) noexcept = delete;
884 constexpr SimpleFuelM1(const FuelCodeSize& code, const char* name)
885 : SimpleFuelMixedWood<10, PercentConifer>(code, name)
886 { }
887};
892template <int PercentConifer>
893class SimpleFuelM2 : public SimpleFuelMixedWood<2, PercentConifer>
894{
895public:
896 SimpleFuelM2() = delete;
897 ~SimpleFuelM2() override = default;
898 SimpleFuelM2(const SimpleFuelM2& rhs) noexcept = delete;
899 SimpleFuelM2(SimpleFuelM2&& rhs) noexcept = delete;
900 SimpleFuelM2& operator=(const SimpleFuelM2& rhs) noexcept = delete;
901 SimpleFuelM2& operator=(SimpleFuelM2&& rhs) noexcept = delete;
907 constexpr SimpleFuelM2(const FuelCodeSize& code, const char* name)
908 : SimpleFuelMixedWood<2, PercentConifer>(code, name)
909 { }
910};
915template <int PercentDeadFir>
916class SimpleFuelM3 : public SimpleFuelMixedDead<120, 572, 140, 50, 10, PercentDeadFir>
917{
918public:
919 SimpleFuelM3() = delete;
920 ~SimpleFuelM3() override = default;
921 SimpleFuelM3(const SimpleFuelM3& rhs) noexcept = delete;
922 SimpleFuelM3(SimpleFuelM3&& rhs) noexcept = delete;
923 SimpleFuelM3& operator=(const SimpleFuelM3& rhs) noexcept = delete;
924 SimpleFuelM3& operator=(SimpleFuelM3&& rhs) noexcept = delete;
930 constexpr SimpleFuelM3(const FuelCodeSize& code, const char* name)
931 : SimpleFuelMixedDead<120, 572, 140, 50, 10, PercentDeadFir>(code, name, LOG_0_80)
932 { }
933};
938template <int PercentDeadFir>
939class SimpleFuelM4 : public SimpleFuelMixedDead<100, 404, 148, 50, 2, PercentDeadFir>
940{
941public:
942 SimpleFuelM4() = delete;
943 ~SimpleFuelM4() override = default;
944 SimpleFuelM4(const SimpleFuelM4& rhs) noexcept = delete;
945 SimpleFuelM4(SimpleFuelM4&& rhs) noexcept = delete;
946 SimpleFuelM4& operator=(const SimpleFuelM4& rhs) noexcept = delete;
947 SimpleFuelM4& operator=(SimpleFuelM4&& rhs) noexcept = delete;
953 constexpr SimpleFuelM4(const FuelCodeSize& code, const char* name)
954 : SimpleFuelMixedDead<100, 404, 148, 50, 2, PercentDeadFir>(code, name, LOG_0_80)
955 { }
956};
960class SimpleFuelO1A : public SimpleFuelGrass<190, 310, 140>
961{
962public:
963 SimpleFuelO1A() = delete;
964 ~SimpleFuelO1A() override = default;
965 SimpleFuelO1A(const SimpleFuelO1A& rhs) noexcept = delete;
966 SimpleFuelO1A(SimpleFuelO1A&& rhs) noexcept = delete;
967 SimpleFuelO1A& operator=(const SimpleFuelO1A& rhs) noexcept = delete;
968 SimpleFuelO1A& operator=(SimpleFuelO1A&& rhs) noexcept = delete;
973 explicit constexpr SimpleFuelO1A(const FuelCodeSize& code) noexcept
974 : SimpleFuelGrass(code, "O-1a", LOG_1_00)
975 { }
976};
980class SimpleFuelO1B : public SimpleFuelGrass<250, 350, 170>
981{
982public:
983 SimpleFuelO1B() = delete;
984 ~SimpleFuelO1B() override = default;
985 SimpleFuelO1B(const SimpleFuelO1B& rhs) noexcept = delete;
986 SimpleFuelO1B(SimpleFuelO1B&& rhs) noexcept = delete;
987 SimpleFuelO1B& operator=(const SimpleFuelO1B& rhs) noexcept = delete;
988 SimpleFuelO1B& operator=(SimpleFuelO1B&& rhs) noexcept = delete;
993 explicit constexpr SimpleFuelO1B(const FuelCodeSize& code) noexcept
994 : SimpleFuelGrass(code, "O-1b", LOG_1_00)
995 { }
996};
1009template <int A, int B, int C, int Bui0, int FfcA, int FfcB, int WfcA, int WfcB, int BulkDensity>
1010class SimpleFuelSlash : public SimpleFuelConifer<A, B, C, Bui0, 0, 0, BulkDensity, 15, 74>
1011{
1012public:
1013 SimpleFuelSlash() = delete;
1014 ~SimpleFuelSlash() override = default;
1015 SimpleFuelSlash(const SimpleFuelSlash& rhs) noexcept = delete;
1016 SimpleFuelSlash(SimpleFuelSlash&& rhs) noexcept = delete;
1017 SimpleFuelSlash& operator=(const SimpleFuelSlash& rhs) noexcept = delete;
1018 SimpleFuelSlash& operator=(SimpleFuelSlash&& rhs) noexcept = delete;
1028 const FuelCodeSize& code,
1029 const char* name,
1030 const LogValue log_q,
1031 const Duff* duff_ffmc,
1032 const Duff* duff_dmc
1033 )
1034 : SimpleFuelConifer<A, B, C, Bui0, 0, 0, BulkDensity, 15, 74>(
1035 code,
1036 name,
1037 log_q,
1038 duff_ffmc,
1039 duff_dmc
1040 )
1041 { }
1047 [[nodiscard]] MathSize surfaceFuelConsumption(const SpreadInfo& spread) const noexcept override
1048 {
1049 return ffcA() * (1.0 - exp(ffcB() * spread.weather->bui.value))
1050 + wfcA() * (1.0 - exp(wfcB() * spread.weather->bui.value));
1051 }
1052
1053private:
1058 [[nodiscard]] static constexpr MathSize ffcA() { return FfcA; }
1063 [[nodiscard]] static constexpr MathSize ffcB() { return FfcB / 10000.0; }
1068 [[nodiscard]] static constexpr MathSize wfcA() { return WfcA; }
1073 [[nodiscard]] static constexpr MathSize wfcB() { return WfcB / 10000.0; }
1074};
1078class SimpleFuelS1 : public SimpleFuelSlash<75, 297, 130, 38, 4, -250, 4, -340, 78>
1079{
1080public:
1081 SimpleFuelS1() = delete;
1082 ~SimpleFuelS1() override = default;
1083 SimpleFuelS1(const SimpleFuelS1& rhs) noexcept = delete;
1084 SimpleFuelS1(SimpleFuelS1&& rhs) noexcept = delete;
1085 SimpleFuelS1& operator=(const SimpleFuelS1& rhs) noexcept = delete;
1086 SimpleFuelS1& operator=(SimpleFuelS1&& rhs) noexcept = delete;
1091 explicit constexpr SimpleFuelS1(const FuelCodeSize& code) noexcept
1092 : SimpleFuelSlash(code, "S-1", LOG_0_75, &duff::FeatherMoss, &duff::PineSeney)
1093 { }
1094};
1098class SimpleFuelS2 : public SimpleFuelSlash<40, 438, 170, 63, 10, -130, 6, -600, 132>
1099{
1100public:
1101 SimpleFuelS2() = delete;
1102 ~SimpleFuelS2() override = default;
1103 SimpleFuelS2(const SimpleFuelS2& rhs) noexcept = delete;
1104 SimpleFuelS2(SimpleFuelS2&& rhs) noexcept = delete;
1105 SimpleFuelS2& operator=(const SimpleFuelS2& rhs) noexcept = delete;
1106 SimpleFuelS2& operator=(SimpleFuelS2&& rhs) noexcept = delete;
1111 explicit constexpr SimpleFuelS2(const FuelCodeSize& code) noexcept
1112 : SimpleFuelSlash(code, "S-2", LOG_0_75, &duff::FeatherMoss, &duff::WhiteSpruce)
1113 { }
1114};
1118class SimpleFuelS3 : public SimpleFuelSlash<55, 829, 320, 31, 12, -166, 20, -210, 100>
1119{
1120public:
1121 SimpleFuelS3() = delete;
1122 ~SimpleFuelS3() override = default;
1123 SimpleFuelS3(const SimpleFuelS3& rhs) noexcept = delete;
1124 SimpleFuelS3(SimpleFuelS3&& rhs) noexcept = delete;
1125 SimpleFuelS3& operator=(const SimpleFuelS3& rhs) noexcept = delete;
1126 SimpleFuelS3& operator=(SimpleFuelS3&& rhs) noexcept = delete;
1131 explicit constexpr SimpleFuelS3(const FuelCodeSize& code) noexcept
1132 : SimpleFuelSlash(code, "S-3", LOG_0_75, &duff::FeatherMoss, &duff::PineSeney)
1133 { }
1134};
1135template <class FuelSpring, class FuelSummer>
1136class SimpleFuelVariable;
1137template <class FuelSpring, class FuelSummer>
1138[[nodiscard]] const SimpleFuelType& find_fuel_by_season(
1139 const int nd,
1140 const SimpleFuelVariable<FuelSpring, FuelSummer>& fuel
1141) noexcept
1142{
1143 // HACK: resolve once and fail if not set already
1144 static const auto& settings = fs::settings::instance();
1145 // if not green yet, then still in spring conditions
1146 return settings.force_greenup ? fuel.summer()
1147 : settings.force_no_greenup ? fuel.spring()
1148 : calculate_is_green(nd) ? fuel.summer()
1149 : fuel.spring();
1150}
1151template <class FuelSpring, class FuelSummer>
1152[[nodiscard]] MathSize compare_by_season(
1153 const SimpleFuelVariable<FuelSpring, FuelSummer>& fuel,
1154 const function<MathSize(const SimpleFuelType&)>& fct
1155)
1156{
1157 // HACK: no way to tell which is which, so let's assume they have to be the same??
1158 // HACK: use a function so that DEBUG section doesn't get out of sync
1159 const auto for_spring = fct(fuel.spring());
1160#ifdef DEBUG_FUEL_VARIABLE
1161 const auto for_summer = fct(fuel.summer());
1162 logging::check_fatal(for_spring != for_summer, "Expected spring and summer cfb to be identical");
1163#endif
1164 return for_spring;
1165}
1171template <class FuelSpring, class FuelSummer>
1173{
1174public:
1175 // don't delete pointers since they're handled elsewhere
1176 ~SimpleFuelVariable() override = default;
1186 const FuelCodeSize& code,
1187 const char* name,
1188 const bool can_crown,
1189 const FuelSpring* const spring,
1190 const FuelSummer* const summer
1191 )
1193 { }
1194 SimpleFuelVariable(SimpleFuelVariable&& rhs) noexcept = delete;
1195 SimpleFuelVariable(const SimpleFuelVariable& rhs) = delete;
1196 SimpleFuelVariable& operator=(SimpleFuelVariable&& rhs) noexcept = delete;
1197 SimpleFuelVariable& operator=(const SimpleFuelVariable& rhs) = delete;
1201 [[nodiscard]] bool isValid() const override { return true; }
1207 [[nodiscard]] MathSize buiEffect(MathSize bui) const override
1208 {
1209 return compare_by_season(*this, [bui](const SimpleFuelType& fuel) {
1210 return fuel.buiEffect(bui);
1211 });
1212 }
1217 [[nodiscard]] MathSize grass_curing(const int nd, const FwiWeather& wx) const override
1218 {
1219 return compare_by_season(*this, [&](const SimpleFuelType& fuel) {
1220 return fuel.grass_curing(nd, wx);
1221 });
1222 }
1227 [[nodiscard]] MathSize cbh() const override
1228 {
1229 return compare_by_season(*this, [](const SimpleFuelType& fuel) { return fuel.cbh(); });
1230 }
1235 [[nodiscard]] MathSize cfl() const override
1236 {
1237 return compare_by_season(*this, [](const SimpleFuelType& fuel) { return fuel.cfl(); });
1238 }
1244 [[nodiscard]] MathSize crownConsumption(const MathSize cfb) const override
1245 {
1246 return compare_by_season(*this, [cfb](const SimpleFuelType& fuel) {
1247 return fuel.crownConsumption(cfb);
1248 });
1249 }
1257 [[nodiscard]] MathSize calculateRos(const int nd, const FwiWeather& wx, const MathSize isi)
1258 const override
1259 {
1260 return find_fuel_by_season(nd, *this).calculateRos(nd, wx, isi);
1261 }
1268 [[nodiscard]] MathSize calculateIsf(const SpreadInfo& spread, const MathSize isi) const override
1269 {
1270 return find_fuel_by_season(spread.nd(), *this).calculateIsf(spread, isi);
1271 }
1277 [[nodiscard]] MathSize surfaceFuelConsumption(const SpreadInfo& spread) const override
1278 {
1279 return find_fuel_by_season(spread.nd(), *this).surfaceFuelConsumption(spread);
1280 }
1286 [[nodiscard]] MathSize lengthToBreadth(const MathSize ws) const override
1287 {
1288 return compare_by_season(*this, [ws](const SimpleFuelType& fuel) {
1289 return fuel.lengthToBreadth(ws);
1290 });
1291 }
1300 [[nodiscard]] MathSize finalRos(
1301 const SpreadInfo& spread,
1302 const MathSize isi,
1303 const MathSize cfb,
1304 const MathSize rss
1305 ) const override
1306 {
1307 return find_fuel_by_season(spread.nd(), *this).finalRos(spread, isi, cfb, rss);
1308 }
1314 [[nodiscard]] MathSize criticalSurfaceIntensity(const SpreadInfo& spread) const override
1315 {
1316 return find_fuel_by_season(spread.nd(), *this).criticalSurfaceIntensity(spread);
1317 }
1324 [[nodiscard]] MathSize crownFractionBurned(const MathSize rss, const MathSize rso)
1325 const noexcept override
1326 {
1327 return spring().crownFractionBurned(rss, rso);
1328 }
1334 [[nodiscard]] MathSize probabilityPeat(const MathSize mc_fraction) const noexcept override
1335 {
1336 return spring().probabilityPeat(mc_fraction);
1337 }
1344 [[nodiscard]] MathSize survivalProbability(const FwiWeather& wx) const noexcept override
1345 {
1346 return spring().survivalProbability(wx);
1347 }
1352 [[nodiscard]] constexpr const SimpleFuelType& spring() const { return *spring_; }
1357 [[nodiscard]] constexpr const SimpleFuelType& summer() const { return *summer_; }
1358
1359private:
1363 const FuelSpring* const spring_{nullptr};
1367 const FuelSummer* const summer_{nullptr};
1368};
1372class SimpleFuelD1D2 : public SimpleFuelVariable<SimpleFuelD1, SimpleFuelD2>
1373{
1374public:
1375 SimpleFuelD1D2() = delete;
1376 ~SimpleFuelD1D2() override = default;
1377 SimpleFuelD1D2(const SimpleFuelD1D2& rhs) noexcept = delete;
1378 SimpleFuelD1D2(SimpleFuelD1D2&& rhs) noexcept = delete;
1379 SimpleFuelD1D2& operator=(const SimpleFuelD1D2& rhs) noexcept = delete;
1380 SimpleFuelD1D2& operator=(SimpleFuelD1D2&& rhs) noexcept = delete;
1388 const FuelCodeSize& code,
1389 const SimpleFuelD1* d1,
1390 const SimpleFuelD2* d2
1391 ) noexcept
1392 : SimpleFuelVariable(code, "D-1/D-2", false, d1, d2)
1393 { }
1394};
1399template <int PercentConifer>
1401 : public SimpleFuelVariable<SimpleFuelM1<PercentConifer>, SimpleFuelM2<PercentConifer>>
1402{
1403public:
1404 SimpleFuelM1M2() = delete;
1405 ~SimpleFuelM1M2() override = default;
1406 SimpleFuelM1M2(const SimpleFuelM1M2& rhs) noexcept = delete;
1407 SimpleFuelM1M2(SimpleFuelM1M2&& rhs) noexcept = delete;
1408 SimpleFuelM1M2& operator=(const SimpleFuelM1M2& rhs) noexcept = delete;
1409 SimpleFuelM1M2& operator=(SimpleFuelM1M2&& rhs) noexcept = delete;
1410 // HACK: it's up to you to make sure these match
1419 const FuelCodeSize& code,
1420 const char* name,
1423 )
1424 : SimpleFuelVariable<SimpleFuelM1<PercentConifer>, SimpleFuelM2<PercentConifer>>(
1425 code,
1426 name,
1427 true,
1428 m1,
1429 m2
1430 )
1431 { }
1432};
1437template <int PercentDeadFir>
1439 : public SimpleFuelVariable<SimpleFuelM3<PercentDeadFir>, SimpleFuelM4<PercentDeadFir>>
1440{
1441public:
1442 SimpleFuelM3M4() = delete;
1443 ~SimpleFuelM3M4() override = default;
1444 SimpleFuelM3M4(const SimpleFuelM3M4& rhs) noexcept = delete;
1445 SimpleFuelM3M4(SimpleFuelM3M4&& rhs) noexcept = delete;
1446 SimpleFuelM3M4& operator=(const SimpleFuelM3M4& rhs) noexcept = delete;
1447 SimpleFuelM3M4& operator=(SimpleFuelM3M4&& rhs) noexcept = delete;
1456 const FuelCodeSize& code,
1457 const char* name,
1460 )
1461 : SimpleFuelVariable<SimpleFuelM3<PercentDeadFir>, SimpleFuelM4<PercentDeadFir>>(
1462 code,
1463 name,
1464 true,
1465 m3,
1466 m4
1467 )
1468 { }
1469};
1473class SimpleFuelO1 : public SimpleFuelVariable<SimpleFuelO1A, SimpleFuelO1B>
1474{
1475public:
1476 SimpleFuelO1() = delete;
1477 ~SimpleFuelO1() override = default;
1478 SimpleFuelO1(const SimpleFuelO1& rhs) noexcept = delete;
1479 SimpleFuelO1(SimpleFuelO1&& rhs) noexcept = delete;
1480 SimpleFuelO1& operator=(const SimpleFuelO1& rhs) noexcept = delete;
1481 SimpleFuelO1& operator=(SimpleFuelO1&& rhs) noexcept = delete;
1489 constexpr SimpleFuelO1(
1490 const FuelCodeSize& code,
1491 const char* name,
1492 const SimpleFuelO1A* o1a,
1493 const SimpleFuelO1B* o1b
1494 )
1496 { }
1497};
1498}
1499namespace fs::testing
1500{
1501using settings::Settings;
1502int test_fbp(const int argc, const char* const argv[]);
1503}
1504#endif
An FBP fuel type.
Definition FuelType.h:42
virtual MathSize lengthToBreadth(MathSize ws) const =0
Length to Breadth ratio [ST-X-3 eq 79].
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].
virtual MathSize criticalSurfaceIntensity(const SpreadInfo &spread) const =0
Critical Surface Fire Intensity (CSI) [ST-X-3 eq 56].
virtual MathSize surfaceFuelConsumption(const SpreadInfo &spread) const =0
Surface fuel consumption (SFC) (kg/m^2) [ST-X-3 eq 9-25].
virtual MathSize crownFractionBurned(MathSize rss, MathSize rso) const noexcept=0
Crown Fraction Burned (CFB) [ST-X-3 eq 58].
virtual MathSize crownConsumption(MathSize cfb) const =0
Crown Fuel Consumption (CFC) (kg/m^2) [ST-X-3 eq 66].
constexpr const char * name() const
Name of the fuel.
Definition FuelType.h:207
virtual MathSize buiEffect(MathSize bui) const =0
BUI Effect on surface fire rate of spread [ST-X-3 eq 54].
virtual MathSize finalRos(const SpreadInfo &spread, MathSize isi, MathSize cfb, MathSize rss) const =0
Final rate of spread (m/min)
virtual MathSize grass_curing(const int, const FwiWeather &) const
Grass curing.
Definition FuelType.h:114
virtual MathSize calculateRos(int nd, const FwiWeather &wx, MathSize isi) const =0
Calculate rate of spread (m/min)
virtual ThresholdSize survivalProbability(const FwiWeather &wx) const noexcept=0
Survival probability calculated using probability of ony survival based on multiple formulae.
virtual MathSize cbh() const =0
Crown base height (m) [ST-X-3 table 8].
virtual MathSize probabilityPeat(MathSize mc_fraction) const noexcept=0
Calculate probability of burning [Anderson eq 1].
virtual MathSize calculateIsf(const SpreadInfo &spread, MathSize isi) const =0
Calculate ISI with slope influence and zero wind (ISF) [ST-X-3 eq 41/42].
Information regarding spread within a Cell for a specific Scenario and time.
Definition FireSpread.h:40
constexpr int nd() const
Difference between date and the date of minimum foliar moisture content.
Definition FireSpread.h:123
A fuel with pine as the base fuel type.
Definition SimpleFBP.h:264
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface fuel consumption (SFC) (kg/m^2) [ST-X-3 eq 12].
Definition SimpleFBP.h:278
FBP fuel type C-1.
Definition SimpleFBP.h:659
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [GLC-X-10 eq 9a/9b].
Definition SimpleFBP.cpp:41
constexpr SimpleFuelC1(const FuelCodeSize &code) noexcept
FBP fuel type C-1.
Definition SimpleFBP.h:671
FBP fuel type C-2.
Definition SimpleFBP.h:685
constexpr SimpleFuelC2(const FuelCodeSize &code) noexcept
FBP fuel type C-2.
Definition SimpleFBP.h:697
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 eq 10].
Definition SimpleFBP.cpp:45
FBP fuel type C-3.
Definition SimpleFBP.h:711
constexpr SimpleFuelC3(const FuelCodeSize &code) noexcept
FBP fuel type C-3.
Definition SimpleFBP.h:723
FBP fuel type C-4.
Definition SimpleFBP.h:731
constexpr SimpleFuelC4(const FuelCodeSize &code) noexcept
FBP fuel type C-4.
Definition SimpleFBP.h:743
FBP fuel type C-5.
Definition SimpleFBP.h:751
constexpr SimpleFuelC5(const FuelCodeSize &code) noexcept
FBP fuel type C-5.
Definition SimpleFBP.h:763
FBP fuel type C-6.
Definition SimpleFBP.h:771
MathSize finalRos(const SpreadInfo &spread, MathSize isi, MathSize cfb, MathSize rss) const noexcept override
Final rate of spread (m/min)
Definition SimpleFBP.cpp:49
constexpr SimpleFuelC6(const FuelCodeSize &code) noexcept
FBP fuel type C-6.
Definition SimpleFBP.h:783
FBP fuel type C-7.
Definition SimpleFBP.h:807
constexpr SimpleFuelC7(const FuelCodeSize &code) noexcept
FBP fuel type C-7.
Definition SimpleFBP.h:819
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 eq 15].
Definition SimpleFBP.cpp:88
A conifer fuel type.
Definition SimpleFBP.h:137
constexpr SimpleFuelConifer(const FuelCodeSize &code, const char *name, const LogValue log_q, const Duff *duff)
A conifer FBP fuel type.
Definition SimpleFBP.h:178
constexpr SimpleFuelConifer(const FuelCodeSize &code, const char *name, const LogValue log_q, const Duff *duff_ffmc, const Duff *duff_dmc)
A conifer FBP fuel type.
Definition SimpleFBP.h:155
FBP fuel type D-1/D-2.
Definition SimpleFBP.h:1373
constexpr SimpleFuelD1D2(const FuelCodeSize &code, const SimpleFuelD1 *d1, const SimpleFuelD2 *d2) noexcept
A fuel that changes between D-1/D-2 depending on green-up.
Definition SimpleFBP.h:1387
FBP fuel type D-1.
Definition SimpleFBP.h:287
MathSize isfD1(const SpreadInfo &spread, MathSize ros_multiplier, MathSize isi) const noexcept
Calculate ISI with slope influence and zero wind (ISF) for D-1 [ST-X-3 eq 41].
Definition SimpleFBP.cpp:16
constexpr SimpleFuelD1(const FuelCodeSize &code) noexcept
FBP fuel type D-1.
Definition SimpleFBP.h:299
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 eq 25].
Definition SimpleFBP.h:307
FBP fuel type D-2.
Definition SimpleFBP.h:833
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2)
Definition SimpleFBP.cpp:98
constexpr SimpleFuelD2(const FuelCodeSize &code) noexcept
FBP fuel type D-2.
Definition SimpleFBP.h:846
MathSize calculateRos(int nd, const FwiWeather &wx, MathSize isi) const noexcept override
Calculate rate of spread (m/min)
Definition SimpleFBP.cpp:102
A grass fuel type.
Definition SimpleFBP.h:547
MathSize calculateIsf(const SpreadInfo &spread, const MathSize isi) const noexcept override
Calculate ISI with slope influence and zero wind (ISF) [ST-X-3 eq 41].
Definition SimpleFBP.h:611
MathSize surfaceFuelConsumption(const SpreadInfo &) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 pg 21].
Definition SimpleFBP.h:576
MathSize baseMultiplier(const int nd, const FwiWeather &wx) const noexcept
Calculate base rate of spread multiplier.
Definition SimpleFBP.h:601
MathSize grass_curing(const int nd, const FwiWeather &wx) const override
Grass curing.
Definition SimpleFBP.h:584
MathSize calculateRos(const int nd, const FwiWeather &wx, const MathSize isi) const noexcept override
Calculate rate of spread (m/min)
Definition SimpleFBP.h:626
MathSize lengthToBreadth(const MathSize ws) const noexcept override
Length to Breadth ratio [ST-X-3 eq 80/81].
Definition SimpleFBP.h:638
constexpr SimpleFuelGrass(const FuelCodeSize &code, const char *name, const LogValue log_q)
A grass fuel type.
Definition SimpleFBP.h:561
MathSize calculateRos(const MathSize multiplier, const MathSize isi) const noexcept
Calculate rate of spread (m/min)
Definition SimpleFBP.h:650
A fuel with jackpine as base fuel type.
Definition SimpleFBP.h:217
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface fuel consumption (SFC) (kg/m^2) [ST-X-3 eq 11].
Definition SimpleFBP.h:231
FBP fuel type M-1/M-2.
Definition SimpleFBP.h:1402
constexpr SimpleFuelM1M2(const FuelCodeSize &code, const char *name, const SimpleFuelM1< PercentConifer > *m1, const SimpleFuelM2< PercentConifer > *m2)
A fuel that changes between M-1/M-2 depending on green-up.
Definition SimpleFBP.h:1418
FBP fuel type M-1.
Definition SimpleFBP.h:871
constexpr SimpleFuelM1(const FuelCodeSize &code, const char *name)
FBP fuel type M-1.
Definition SimpleFBP.h:884
FBP fuel type M-2.
Definition SimpleFBP.h:894
constexpr SimpleFuelM2(const FuelCodeSize &code, const char *name)
FBP fuel type M-2.
Definition SimpleFBP.h:907
FBP fuel type M-3/M-4.
Definition SimpleFBP.h:1440
constexpr SimpleFuelM3M4(const FuelCodeSize &code, const char *name, const SimpleFuelM3< PercentDeadFir > *m3, const SimpleFuelM4< PercentDeadFir > *m4)
A fuel that changes between M-3/M-4 depending on green-up.
Definition SimpleFBP.h:1455
FBP fuel type M-3.
Definition SimpleFBP.h:917
constexpr SimpleFuelM3(const FuelCodeSize &code, const char *name)
FBP fuel type M-3.
Definition SimpleFBP.h:930
FBP fuel type M-4.
Definition SimpleFBP.h:940
constexpr SimpleFuelM4(const FuelCodeSize &code, const char *name)
FBP fuel type M-4.
Definition SimpleFBP.h:953
A fuel made of dead fir and D1.
Definition SimpleFBP.h:454
constexpr SimpleFuelMixedDead(const FuelCodeSize &code, const char *name, const LogValue log_q)
A mixed dead FBP fuel type.
Definition SimpleFBP.h:468
A fuel composed of C2 and D1 mixed.
Definition SimpleFBP.h:480
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 eq 17].
Definition SimpleFBP.h:505
constexpr SimpleFuelMixedWood(const FuelCodeSize &code, const char *name)
A mixedwood FBP fuel type.
Definition SimpleFBP.h:493
A mixedwood fuel type.
Definition SimpleFBP.h:345
MathSize calculateRos(const int, const FwiWeather &, const MathSize isi) const noexcept override
Calculate rate of spread (m/min) [ST-X-3 27/28, GLC-X-10 29/31].
Definition SimpleFBP.h:394
constexpr SimpleFuelMixed(const FuelCodeSize &code, const char *name, const LogValue log_q)
A mixed FBP fuel type.
Definition SimpleFBP.h:359
static MathSize isfD1(const SpreadInfo &spread, const MathSize isi) noexcept
Calculate ISI with slope influence and zero wind (ISF) for D-1 [ST-X-3 eq 41].
Definition SimpleFBP.h:436
MathSize calculateIsf(const SpreadInfo &spread, const MathSize isi) const noexcept override
Calculate ISI with slope influence and zero wind (ISF) [ST-X-3 eq 42].
Definition SimpleFBP.h:407
static constexpr MathSize ratioDeciduous()
Percent Deciduous (% / 100)
Definition SimpleFBP.h:422
MathSize crownConsumption(const MathSize cfb) const noexcept override
Crown Fuel Consumption (CFC) (kg/m^2) [ST-X-3 eq 66, pg 38].
Definition SimpleFBP.h:383
static constexpr MathSize rosMultiplier()
Rate of spread multiplier [ST-X-3 eq 27/28, GLC-X-10 eq 29/30].
Definition SimpleFBP.h:429
static constexpr MathSize ratioConifer()
Percent Conifer (% / 100)
Definition SimpleFBP.h:417
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 eq 10].
Definition SimpleFBP.h:374
A SimpleStandardFuel that is not made of multiple fuels.
Definition SimpleFBP.h:76
MathSize calculateRos(const int, const FwiWeather &, const MathSize isi) const noexcept override
Initial rate of spread (m/min) [ST-X-3 eq 26].
Definition SimpleFBP.h:108
MathSize calculateIsf(const SpreadInfo &spread, const MathSize isi) const noexcept override
ISI with slope influence and zero wind (ISF) [ST-X-3 eq 41].
Definition SimpleFBP.h:96
FBP fuel type O-1a.
Definition SimpleFBP.h:961
constexpr SimpleFuelO1A(const FuelCodeSize &code) noexcept
FBP fuel type O-1a.
Definition SimpleFBP.h:973
FBP fuel type O-1b.
Definition SimpleFBP.h:981
constexpr SimpleFuelO1B(const FuelCodeSize &code) noexcept
FBP fuel type O-1b.
Definition SimpleFBP.h:993
FBP fuel type O-1.
Definition SimpleFBP.h:1474
constexpr SimpleFuelO1(const FuelCodeSize &code, const char *name, const SimpleFuelO1A *o1a, const SimpleFuelO1B *o1b)
A fuel that changes between O-1a/O-1b depending on green-up.
Definition SimpleFBP.h:1489
FBP fuel type S-1.
Definition SimpleFBP.h:1079
constexpr SimpleFuelS1(const FuelCodeSize &code) noexcept
FBP fuel type S-1.
Definition SimpleFBP.h:1091
FBP fuel type S-2.
Definition SimpleFBP.h:1099
constexpr SimpleFuelS2(const FuelCodeSize &code) noexcept
FBP fuel type S-2.
Definition SimpleFBP.h:1111
FBP fuel type S-3.
Definition SimpleFBP.h:1119
constexpr SimpleFuelS3(const FuelCodeSize &code) noexcept
FBP fuel type S-3.
Definition SimpleFBP.h:1131
A slash fuel type.
Definition SimpleFBP.h:1011
static constexpr MathSize ffcA()
Forest Floor Consumption parameter a [ST-X-3 eq 19/21/23].
Definition SimpleFBP.h:1058
static constexpr MathSize wfcB()
Woody Fuel Consumption parameter b [ST-X-3 eq 20/22/24].
Definition SimpleFBP.h:1073
constexpr SimpleFuelSlash(const FuelCodeSize &code, const char *name, const LogValue log_q, const Duff *duff_ffmc, const Duff *duff_dmc)
A slash fuel type.
Definition SimpleFBP.h:1027
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 eq 25].
Definition SimpleFBP.h:1047
static constexpr MathSize wfcA()
Woody Fuel Consumption parameter a [ST-X-3 eq 20/22/24].
Definition SimpleFBP.h:1068
static constexpr MathSize ffcB()
Forest Floor Consumption parameter b [ST-X-3 eq 19/21/23].
Definition SimpleFBP.h:1063
A fuel type that changes based on the season.
Definition SimpleFBP.h:1173
MathSize calculateRos(const int nd, const FwiWeather &wx, const MathSize isi) const override
Initial rate of spread (m/min) [ST-X-3 eq 26].
Definition SimpleFBP.h:1257
MathSize criticalSurfaceIntensity(const SpreadInfo &spread) const override
Critical Surface Fire Intensity (CSI) [ST-X-3 eq 56].
Definition SimpleFBP.h:1314
MathSize grass_curing(const int nd, const FwiWeather &wx) const override
Grass curing.
Definition SimpleFBP.h:1217
MathSize cfl() const override
Crown fuel load (kg/m^2) [ST-X-3 table 8].
Definition SimpleFBP.h:1235
MathSize finalRos(const SpreadInfo &spread, const MathSize isi, const MathSize cfb, const MathSize rss) const override
Final rate of spread (m/min)
Definition SimpleFBP.h:1300
const FuelSummer *const summer_
Fuel to use after green-up.
Definition SimpleFBP.h:1367
constexpr SimpleFuelVariable(const FuelCodeSize &code, const char *name, const bool can_crown, const FuelSpring *const spring, const FuelSummer *const summer)
A slash fuel type.
Definition SimpleFBP.h:1185
MathSize lengthToBreadth(const MathSize ws) const override
Length to Breadth ratio [ST-X-3 eq 79].
Definition SimpleFBP.h:1286
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 eq 9-25].
Definition SimpleFBP.h:1277
MathSize calculateIsf(const SpreadInfo &spread, const MathSize isi) const override
Calculate ISI with slope influence and zero wind (ISF) [ST-X-3 eq 41].
Definition SimpleFBP.h:1268
MathSize survivalProbability(const FwiWeather &wx) const noexcept override
Survival probability calculated using probability of ony survival based on multiple formulae.
Definition SimpleFBP.h:1344
constexpr const SimpleFuelType & spring() const
Fuel to use before green-up.
Definition SimpleFBP.h:1352
MathSize cbh() const override
Crown base height (m) [ST-X-3 table 8].
Definition SimpleFBP.h:1227
MathSize buiEffect(MathSize bui) const override
BUI Effect on surface fire rate of spread [ST-X-3 eq 54].
Definition SimpleFBP.h:1207
MathSize crownFractionBurned(const MathSize rss, const MathSize rso) const noexcept override
Crown Fraction Burned (CFB) [ST-X-3 eq 58].
Definition SimpleFBP.h:1324
bool isValid() const override
Is fuel a valid fuel type.
Definition SimpleFBP.h:1201
MathSize probabilityPeat(const MathSize mc_fraction) const noexcept override
Calculate probability of burning [Anderson eq 1].
Definition SimpleFBP.h:1334
const FuelSpring *const spring_
Fuel to use before green-up.
Definition SimpleFBP.h:1363
constexpr const SimpleFuelType & summer() const
Fuel to use after green-up.
Definition SimpleFBP.h:1357
MathSize crownConsumption(const MathSize cfb) const override
Crown Fuel Consumption (CFC) (kg/m^2) [ST-X-3 eq 66].
Definition SimpleFBP.h:1244
A SimpleFuelBase made of a standard fuel type.
Definition SimpleStandardFuel.h:80
constexpr SimpleStandardFuel(const FuelCodeSize &code, const char *name, const bool can_crown, const LogValue log_q, const Duff *duff_ffmc, const Duff *duff_dmc) noexcept
Constructor.
Definition SimpleStandardFuel.h:91
MathSize limitIsf(const MathSize mu, const MathSize rsf) const noexcept
ISI with slope influence and zero wind (ISF) [ST-X-3 eq 41].
Definition SimpleStandardFuel.h:150
MathSize crownConsumption(const MathSize cfb) const noexcept override
Crown Fuel Consumption (CFC) (kg/m^2) [ST-X-3 eq 66].
Definition SimpleStandardFuel.h:143
MathSize rosBasic(const MathSize isi) const noexcept
Initial rate of spread (m/min) [ST-X-3 eq 26].
Definition SimpleStandardFuel.h:134
A Weather value with calculated FWI indices.
Definition FWI.h:142
Dc dc
Drought Code.
Definition FWI.h:167
A result of calling log(x) for some value of x, pre-calculated at compile time.
Definition LogValue.h:12
A specific type of Duff layer, and the associated smouldering coefficients.
Definition Duff.h:40