FireSTARR
Loading...
Searching...
No Matches
FBP45.h
1/* Copyright (c) Queen's Printer for Ontario, 2020. */
2/* Copyright (c) His Majesty the King in Right of Canada as represented by the Minister of Natural Resources, 2021-2025. */
3
4/* SPDX-License-Identifier: AGPL-3.0-or-later */
5
6#pragma once
7#include "Duff.h"
8#include "FireSpread.h"
9#include "LookupTable.h"
10#include "StandardFuel.h"
11#ifdef DEBUG_FUEL_VARIABLE
12#include "Log.h"
13#endif
14namespace fs::fuel
15{
21[[nodiscard]] constexpr bool calculate_is_green(const int nd)
22{
23 return nd >= 30;
24}
28static constexpr int START_GREENING = -43;
29[[nodiscard]] constexpr int calculate_grass_curing(const int nd)
30{
31 return (nd < START_GREENING)
32 ? // we're before foliar moisture dip has started
33 100
34 : (nd >= 50)
35 ? 0 // foliar moisture is at 120.0, so grass should be totally uncured
36 // HACK: invent a formula that has 50% curing at the bottom of the foliar
37 // moisture dip foliar moisture above ranges between 120 and 85, with 85
38 // being at the point where we want 50% cured Curing:
39 // -43 => 100, 0 => 50, 50 => 0 least-squares best fit:
40 : static_cast<int>(52.5042 - 1.07324 * nd);
41}
42[[nodiscard]] static MathSize
43 calculate_surface_fuel_consumption_mixed_or_c2(const MathSize bui) noexcept
44{
45 return 5.0 * (1.0 - exp(-0.0115 * bui));
46}
47static const util::LookupTable<&calculate_surface_fuel_consumption_mixed_or_c2>
48 SURFACE_FUEL_CONSUMPTION_MIXED_OR_C2{};
49[[nodiscard]] static MathSize
50 calculate_surface_fuel_consumption_d1(const MathSize bui) noexcept
51{
52 return 1.5 * (1.0 - exp(-0.0183 * bui));
53}
54static util::LookupTable<&calculate_surface_fuel_consumption_d1>
55 SURFACE_FUEL_CONSUMPTION_D1{};
68template <int A, int B, int C, int Bui0, int Cbh, int Cfl, int BulkDensity, int InorganicPercent, int DuffDepth>
70 : public StandardFuel<A, B, C, Bui0, Cbh, Cfl, BulkDensity, InorganicPercent, DuffDepth>
71{
72public:
73 FuelNonMixed() = delete;
74 ~FuelNonMixed() override = default;
75 FuelNonMixed(const FuelNonMixed& rhs) noexcept = delete;
76 FuelNonMixed(FuelNonMixed&& rhs) noexcept = delete;
77 FuelNonMixed& operator=(const FuelNonMixed& rhs) noexcept = delete;
78 FuelNonMixed& operator=(FuelNonMixed&& rhs) noexcept = delete;
79protected:
80 using StandardFuel<A, B, C, Bui0, Cbh, Cfl, BulkDensity, InorganicPercent, DuffDepth>::
88 [[nodiscard]] MathSize calculateIsf(const SpreadInfo& spread,
89 const MathSize isi) const noexcept override
90 {
91 return this->limitIsf(1.0,
92 calculateRos(spread.nd(),
93 *spread.weather(),
94 isi)
95 * spread.slopeFactor());
96 }
97 virtual
102 MathSize
103 calculateRos(const int,
104 const wx::FwiWeather&,
105 const MathSize isi) const noexcept override
106 {
107 return this->rosBasic(isi);
108 }
109};
122template <int A, int B, int C, int Bui0, int Cbh, int Cfl, int BulkDensity, int InorganicPercent, int DuffDepth>
124 : public FuelNonMixed<A, B, C, Bui0, Cbh, Cfl, BulkDensity, InorganicPercent, DuffDepth>
125{
126public:
127 FuelConifer() = delete;
128 ~FuelConifer() override = default;
129 FuelConifer(const FuelConifer& rhs) noexcept = delete;
130 FuelConifer(FuelConifer&& rhs) noexcept = delete;
131 FuelConifer& operator=(const FuelConifer& rhs) noexcept = delete;
132 FuelConifer& operator=(FuelConifer&& rhs) noexcept = delete;
133protected:
142 constexpr FuelConifer(const FuelCodeSize& code,
143 const char* name,
144 const LogValue log_q,
145 const Duff* duff_ffmc,
146 const Duff* duff_dmc)
147 : FuelNonMixed<A, B, C, Bui0, Cbh, Cfl, BulkDensity, InorganicPercent, DuffDepth>(code,
148 name,
149 true,
150 log_q,
151 duff_ffmc,
152 duff_dmc)
153 {
154 }
162 constexpr FuelConifer(const FuelCodeSize& code,
163 const char* name,
164 const LogValue log_q,
165 const Duff* duff)
167 name,
168 log_q,
169 duff,
170 duff)
171 {
172 }
173};
179[[nodiscard]] static MathSize
180 calculate_surface_fuel_consumption_jackpine(
181 const MathSize bui) noexcept
182{
183 return 5.0 * pow(1.0 - exp(-0.0164 * bui), 2.24);
184}
189static util::LookupTable<&calculate_surface_fuel_consumption_jackpine>
190 SURFACE_FUEL_CONSUMPTION_JACKPINE{};
202template <int A, int B, int C, int Bui0, int Cbh, int Cfl, int BulkDensity, int DuffDepth>
204 : public FuelConifer<A, B, C, Bui0, Cbh, Cfl, BulkDensity, 15, DuffDepth>
205{
206public:
207 FuelJackpine() = delete;
208 ~FuelJackpine() override = default;
209 FuelJackpine(const FuelJackpine& rhs) noexcept = delete;
210 FuelJackpine(FuelJackpine&& rhs) noexcept = delete;
211 FuelJackpine& operator=(const FuelJackpine& rhs) noexcept = delete;
212 FuelJackpine& operator=(FuelJackpine&& rhs) noexcept = delete;
213 using FuelConifer<A, B, C, Bui0, Cbh, Cfl, BulkDensity, 15, DuffDepth>::FuelConifer;
219 [[nodiscard]] MathSize surfaceFuelConsumption(
220 const SpreadInfo& spread) const noexcept override
221 {
222 return SURFACE_FUEL_CONSUMPTION_JACKPINE(spread.bui().asValue());
223 }
224};
230[[nodiscard]] static MathSize
231 calculate_surface_fuel_consumption_pine(const MathSize bui) noexcept
232{
233 return 5.0 * pow(1.0 - exp(-0.0149 * bui), 2.48);
234}
240static util::LookupTable<&calculate_surface_fuel_consumption_pine>
241 SURFACE_FUEL_CONSUMPTION_PINE{};
253template <int A, int B, int C, int Bui0, int Cbh, int Cfl, int BulkDensity, int DuffDepth>
254class FuelPine : public FuelConifer<A, B, C, Bui0, Cbh, Cfl, BulkDensity, 15, DuffDepth>
255{
256public:
257 FuelPine() = delete;
258 ~FuelPine() override = default;
259 FuelPine(const FuelPine& rhs) noexcept = delete;
260 FuelPine(FuelPine&& rhs) noexcept = delete;
261 FuelPine& operator=(const FuelPine& rhs) noexcept = delete;
262 FuelPine& operator=(FuelPine&& rhs) noexcept = delete;
263 using FuelConifer<A, B, C, Bui0, Cbh, Cfl, BulkDensity, 15, DuffDepth>::FuelConifer;
269 [[nodiscard]] MathSize surfaceFuelConsumption(
270 const SpreadInfo& spread) const noexcept override
271 {
272 return SURFACE_FUEL_CONSUMPTION_PINE(spread.bui().asValue());
273 }
274};
275namespace fbp
276{
280class FuelD1 : public FuelNonMixed<30, 232, 160, 32, 0, 0, 61, 59, 24>
281{
282public:
283 FuelD1() = delete;
284 ~FuelD1() override = default;
285 FuelD1(const FuelD1& rhs) noexcept = delete;
286 FuelD1(FuelD1&& rhs) noexcept = delete;
287 FuelD1& operator=(const FuelD1& rhs) noexcept = delete;
288 FuelD1& operator=(FuelD1&& rhs) noexcept = delete;
293 explicit constexpr FuelD1(const FuelCodeSize& code) noexcept
295 "D-1",
296 false,
297 data::LOG_0_90,
298 &Duff::Peat)
299 {
300 }
306 [[nodiscard]] MathSize surfaceFuelConsumption(
307 const SpreadInfo& spread) const noexcept override
308 {
309 return SURFACE_FUEL_CONSUMPTION_D1(spread.bui().asValue());
310 }
318 [[nodiscard]] MathSize isfD1(const SpreadInfo& spread,
319 MathSize ros_multiplier,
320 MathSize isi) const noexcept;
321};
322}
335template <int A, int B, int C, int Bui0, int RosMultiplier, int PercentMixed, int BulkDensity, int InorganicPercent, int DuffDepth>
337 : public StandardFuel<A, B, C, Bui0, 6, 80, BulkDensity, InorganicPercent, DuffDepth>
338{
339public:
340 FuelMixed() = delete;
341 ~FuelMixed() = default;
342 FuelMixed(const FuelMixed& rhs) noexcept = delete;
343 FuelMixed(FuelMixed&& rhs) noexcept = delete;
344 FuelMixed& operator=(const FuelMixed& rhs) noexcept = delete;
345 FuelMixed& operator=(FuelMixed&& rhs) noexcept = delete;
352 constexpr FuelMixed(const FuelCodeSize& code,
353 const char* name,
354 const LogValue log_q)
355 : StandardFuel<A, B, C, Bui0, 6, 80, BulkDensity, InorganicPercent, DuffDepth>(code,
356 name,
357 true,
358 log_q,
359 &Duff::Peat,
360 &Duff::Peat)
361 {
362 }
368 [[nodiscard]] MathSize surfaceFuelConsumption(
369 const SpreadInfo& spread) const noexcept override
370 {
371 return SURFACE_FUEL_CONSUMPTION_MIXED_OR_C2(spread.bui().asValue());
372 }
378 [[nodiscard]] MathSize crownConsumption(const MathSize cfb) const noexcept override
379 {
381 }
387 [[nodiscard]] MathSize calculateRos(const int,
388 const wx::FwiWeather&,
389 const MathSize isi) const noexcept override
390 {
391 static const fbp::FuelD1 F{14};
392 return ratioConifer() * this->rosBasic(isi) + rosMultiplier() * ratioDeciduous() * F.rosBasic(isi);
393 }
400 [[nodiscard]] MathSize calculateIsf(const SpreadInfo& spread,
401 const MathSize isi) const noexcept override
402 {
403 return ratioConifer() * this->limitIsf(1.0, spread.slopeFactor() * this->rosBasic(isi))
404 + ratioDeciduous() * isfD1(spread, isi);
405 }
410 [[nodiscard]] static constexpr MathSize ratioConifer()
411 {
412 return PercentMixed / 100.0;
413 }
418 [[nodiscard]] static constexpr MathSize ratioDeciduous()
419 {
420 return 1.0 - (PercentMixed / 100.0);
421 }
422protected:
427 [[nodiscard]] static constexpr MathSize rosMultiplier()
428 {
429 return RosMultiplier / 10.0;
430 }
437 [[nodiscard]] static MathSize
438 isfD1(const SpreadInfo& spread,
439 const MathSize isi) noexcept
440 {
441 static const fbp::FuelD1 F{14};
442 return F.isfD1(spread, rosMultiplier(), isi);
443 }
444};
454template <int A, int B, int C, int Bui0, int RosMultiplier, int PercentDeadFir>
456 : public FuelMixed<A, B, C, Bui0, RosMultiplier, PercentDeadFir, 61, 15, 75>
457{
458public:
459 FuelMixedDead() = delete;
460 ~FuelMixedDead() = default;
461 FuelMixedDead(const FuelMixedDead& rhs) noexcept = delete;
462 FuelMixedDead(FuelMixedDead&& rhs) noexcept = delete;
463 FuelMixedDead& operator=(const FuelMixedDead& rhs) noexcept = delete;
464 FuelMixedDead& operator=(FuelMixedDead&& rhs) noexcept = delete;
471 constexpr FuelMixedDead(const FuelCodeSize& code,
472 const char* name,
473 const LogValue log_q)
474 : FuelMixed<A, B, C, Bui0, RosMultiplier, PercentDeadFir, 61, 15, 75>(code,
475 name,
476 log_q)
477 {
478 }
479};
485template <int RosMultiplier, int RatioMixed>
487 : public FuelMixed<110, 282, 150, 50, RosMultiplier, RatioMixed, 108, 25, 50>
488{
489public:
490 FuelMixedWood() = delete;
491 ~FuelMixedWood() = default;
492 FuelMixedWood(const FuelMixedWood& rhs) noexcept = delete;
493 FuelMixedWood(FuelMixedWood&& rhs) noexcept = delete;
494 FuelMixedWood& operator=(const FuelMixedWood& rhs) noexcept = delete;
495 FuelMixedWood& operator=(FuelMixedWood&& rhs) noexcept = delete;
501 constexpr FuelMixedWood(const FuelCodeSize& code,
502 const char* name)
503 : FuelMixed<110, 282, 150, 50, RosMultiplier, RatioMixed, 108, 25, 50>(code,
504 name,
505 data::LOG_0_80)
506 {
507 }
513 [[nodiscard]] MathSize surfaceFuelConsumption(
514 const SpreadInfo& spread) const noexcept override
515 {
517 + this->ratioDeciduous() * SURFACE_FUEL_CONSUMPTION_D1(spread.bui().asValue());
518 }
519};
523[[nodiscard]] static constexpr MathSize
524 calculate_length_to_breadth_grass(const MathSize ws) noexcept
525{
526 return ws < 1.0 ? 1.0 : (1.1 * pow(ws, 0.464));
527}
531static util::LookupTable<calculate_length_to_breadth_grass> LENGTH_TO_BREADTH_GRASS{};
537[[nodiscard]] static constexpr MathSize
538 calculate_base_multiplier_curing(const MathSize curing) noexcept
539{
540 return (curing >= 58.8)
541 ? (0.176 + 0.02 * (curing - 58.8))
542 : (0.005 * expm1(0.061 * curing));
543}
548static util::LookupTable<&calculate_base_multiplier_curing> BASE_MULTIPLIER_CURING{};
555template <int A, int B, int C>
557 : public StandardFuel<A, B, C, 1, 0, 0, 0, 0, static_cast<int>(DUFF_FFMC_DEPTH * 10.0)>
558{
559public:
560 FuelGrass() = delete;
561 ~FuelGrass() override = default;
562 FuelGrass(const FuelGrass& rhs) noexcept = delete;
563 FuelGrass(FuelGrass&& rhs) noexcept = delete;
564 FuelGrass& operator=(const FuelGrass& rhs) noexcept = delete;
565 FuelGrass& operator=(FuelGrass&& rhs) noexcept = delete;
572 constexpr FuelGrass(const FuelCodeSize& code,
573 const char* name,
574 const LogValue log_q)
575 // HACK: grass assumes no duff (total duff depth == ffmc depth => dmc depth is 0)
576 : StandardFuel<A, B, C, 1, 0, 0, 0, 0, static_cast<int>(DUFF_FFMC_DEPTH * 10.0)>(code,
577 name,
578 false,
579 log_q,
580 &Duff::PeatMuck,
581 &Duff::PeatMuck)
582 {
583 }
588 [[nodiscard]] MathSize surfaceFuelConsumption(
589 const SpreadInfo&) const noexcept override
590 {
591 return DEFAULT_GRASS_FUEL_LOAD;
592 }
597 [[nodiscard]] MathSize grass_curing(const int nd, const wx::FwiWeather& wx) const override
598 {
600 ? // forcing curing value
602 : wx.dc().asValue() > 500
603 ? // we're in drought conditions
604 100
605 : calculate_grass_curing(nd);
606 }
613 [[nodiscard]] MathSize baseMultiplier(const int nd,
614 const wx::FwiWeather& wx) const noexcept
615 {
616 return BASE_MULTIPLIER_CURING(grass_curing(nd, wx));
617 }
624 [[nodiscard]] MathSize calculateIsf(const SpreadInfo& spread,
625 const MathSize isi) const noexcept override
626 {
627 const auto mu = baseMultiplier(spread.nd(), *spread.weather());
628 // prevent divide by 0
629 const auto mu_not_zero = max(0.001, mu);
630 return this->limitIsf(mu_not_zero, calculateRos(mu, isi) * spread.slopeFactor());
631 }
639 [[nodiscard]] MathSize calculateRos(const int nd,
640 const wx::FwiWeather& wx,
641 const MathSize isi) const noexcept override
642 {
643 return calculateRos(baseMultiplier(nd, wx), isi);
644 }
645protected:
651 [[nodiscard]] MathSize lengthToBreadth(const MathSize ws) const noexcept override
652 {
653 return LENGTH_TO_BREADTH_GRASS(ws);
654 }
655private:
662 [[nodiscard]] MathSize calculateRos(const MathSize multiplier,
663 const MathSize isi) const noexcept
664 {
665 return multiplier * this->rosBasic(isi);
666 }
667};
668namespace fbp
669{
673class FuelC1 : public FuelConifer<90, 649, 450, 72, 2, 75, 45, 5, 34>
674{
675public:
676 FuelC1() = delete;
677 ~FuelC1() override = default;
678 FuelC1(const FuelC1& rhs) noexcept = delete;
679 FuelC1(FuelC1&& rhs) noexcept = delete;
680 FuelC1& operator=(const FuelC1& rhs) noexcept = delete;
681 FuelC1& operator=(FuelC1&& rhs) noexcept = delete;
686 explicit constexpr FuelC1(const FuelCodeSize& code) noexcept
688 "C-1",
689 data::LOG_0_90,
691 &Duff::Peat)
692 {
693 }
699 [[nodiscard]] MathSize surfaceFuelConsumption(
700 const SpreadInfo& spread) const noexcept override;
701};
705class FuelC2 : public FuelConifer<110, 282, 150, 64, 3, 80, 34, 0, 100>
706{
707public:
708 FuelC2() = delete;
709 ~FuelC2() override = default;
710 FuelC2(const FuelC2& rhs) noexcept = delete;
711 FuelC2(FuelC2&& rhs) noexcept = delete;
712 FuelC2& operator=(const FuelC2& rhs) noexcept = delete;
713 FuelC2& operator=(FuelC2&& rhs) noexcept = delete;
718 explicit constexpr FuelC2(const FuelCodeSize& code) noexcept
720 "C-2",
721 data::LOG_0_70,
723 {
724 }
730 [[nodiscard]] MathSize surfaceFuelConsumption(
731 const SpreadInfo& spread) const noexcept override;
732};
736class FuelC3 : public FuelJackpine<110, 444, 300, 62, 8, 115, 20, 65>
737{
738public:
739 FuelC3() = delete;
740 ~FuelC3() override = default;
741 FuelC3(const FuelC3& rhs) noexcept = delete;
742 FuelC3(FuelC3&& rhs) noexcept = delete;
743 FuelC3& operator=(const FuelC3& rhs) noexcept = delete;
744 FuelC3& operator=(FuelC3&& rhs) noexcept = delete;
749 explicit constexpr FuelC3(const FuelCodeSize& code) noexcept
751 "C-3",
752 data::LOG_0_75,
755 {
756 }
757};
761class FuelC4 : public FuelJackpine<110, 293, 150, 66, 4, 120, 31, 62>
762{
763public:
764 FuelC4() = delete;
765 ~FuelC4() override = default;
766 FuelC4(const FuelC4& rhs) noexcept = delete;
767 FuelC4(FuelC4&& rhs) noexcept = delete;
768 FuelC4& operator=(const FuelC4& rhs) noexcept = delete;
769 FuelC4& operator=(FuelC4&& rhs) noexcept = delete;
774 explicit constexpr FuelC4(const FuelCodeSize& code) noexcept
776 "C-4",
777 data::LOG_0_80,
779 {
780 }
781};
785class FuelC5 : public FuelPine<30, 697, 400, 56, 18, 120, 93, 46>
786{
787public:
788 FuelC5() = delete;
789 ~FuelC5() override = default;
790 FuelC5(const FuelC5& rhs) noexcept = delete;
791 FuelC5(FuelC5&& rhs) noexcept = delete;
792 FuelC5& operator=(const FuelC5& rhs) noexcept = delete;
793 FuelC5& operator=(FuelC5&& rhs) noexcept = delete;
798 explicit constexpr FuelC5(const FuelCodeSize& code) noexcept
799 : FuelPine(code,
800 "C-5",
801 data::LOG_0_80,
803 {
804 }
805};
809class FuelC6 : public FuelPine<30, 800, 300, 62, 7, 180, 50, 50>
810{
811public:
812 FuelC6() = delete;
813 ~FuelC6() override = default;
814 FuelC6(const FuelC6& rhs) noexcept = delete;
815 FuelC6(FuelC6&& rhs) noexcept = delete;
816 FuelC6& operator=(const FuelC6& rhs) noexcept = delete;
817 FuelC6& operator=(FuelC6&& rhs) noexcept = delete;
822 explicit constexpr FuelC6(const FuelCodeSize& code) noexcept
823 : FuelPine(code,
824 "C-6",
825 data::LOG_0_80,
827 {
828 }
829protected:
838 [[nodiscard]] MathSize finalRos(const SpreadInfo& spread,
839 MathSize isi,
840 MathSize cfb,
841 MathSize rss) const noexcept override;
842};
846class FuelC7 : public FuelConifer<45, 305, 200, 106, 10, 50, 20, 15, 50>
847{
848public:
849 FuelC7() = delete;
850 ~FuelC7() override = default;
851 FuelC7(const FuelC7& rhs) noexcept = delete;
852 FuelC7(FuelC7&& rhs) noexcept = delete;
853 FuelC7& operator=(const FuelC7& rhs) noexcept = delete;
854 FuelC7& operator=(FuelC7&& rhs) noexcept = delete;
859 explicit constexpr FuelC7(const FuelCodeSize& code) noexcept
861 "C-7",
862 data::LOG_0_85,
864 {
865 }
871 [[nodiscard]] MathSize surfaceFuelConsumption(
872 const SpreadInfo& spread) const noexcept override;
873};
877class FuelD2 : public FuelNonMixed<6, 232, 160, 32, 0, 0, 61, 59, 24>
878{
879public:
880 FuelD2() = delete;
881 ~FuelD2() override = default;
882 FuelD2(const FuelD2& rhs) noexcept = delete;
883 FuelD2(FuelD2&& rhs) noexcept = delete;
884 FuelD2& operator=(const FuelD2& rhs) noexcept = delete;
885 FuelD2& operator=(FuelD2&& rhs) noexcept = delete;
886 // HACK: assume same bulk_density and inorganicContent as D1
891 explicit constexpr FuelD2(const FuelCodeSize& code) noexcept
893 "D-2",
894 false,
895 data::LOG_0_90,
896 &Duff::Peat)
897 {
898 }
904 [[nodiscard]] MathSize surfaceFuelConsumption(
905 const SpreadInfo& spread) const noexcept override;
913 [[nodiscard]] MathSize calculateRos(int nd,
914 const wx::FwiWeather& wx,
915 MathSize isi) const noexcept override;
916};
921template <int PercentConifer>
922class FuelM1 : public FuelMixedWood<10, PercentConifer>
923{
924public:
925 FuelM1() = delete;
926 ~FuelM1() = default;
927 FuelM1(const FuelM1& rhs) noexcept = delete;
928 FuelM1(FuelM1&& rhs) noexcept = delete;
929 FuelM1& operator=(const FuelM1& rhs) noexcept = delete;
930 FuelM1& operator=(FuelM1&& rhs) noexcept = delete;
936 constexpr FuelM1(const FuelCodeSize& code, const char* name)
937 : FuelMixedWood<10, PercentConifer>(code, name)
938 {
939 }
940};
945template <int PercentConifer>
946class FuelM2 : public FuelMixedWood<2, PercentConifer>
947{
948public:
949 FuelM2() = delete;
950 ~FuelM2() = default;
951 FuelM2(const FuelM2& rhs) noexcept = delete;
952 FuelM2(FuelM2&& rhs) noexcept = delete;
953 FuelM2& operator=(const FuelM2& rhs) noexcept = delete;
954 FuelM2& operator=(FuelM2&& rhs) noexcept = delete;
960 constexpr FuelM2(const FuelCodeSize& code, const char* name)
961 : FuelMixedWood<2, PercentConifer>(code, name)
962 {
963 }
964};
969template <int PercentDeadFir>
970class FuelM3 : public FuelMixedDead<120, 572, 140, 50, 10, PercentDeadFir>
971{
972public:
973 FuelM3() = delete;
974 ~FuelM3() = default;
975 FuelM3(const FuelM3& rhs) noexcept = delete;
976 FuelM3(FuelM3&& rhs) noexcept = delete;
977 FuelM3& operator=(const FuelM3& rhs) noexcept = delete;
978 FuelM3& operator=(FuelM3&& rhs) noexcept = delete;
984 constexpr FuelM3(const FuelCodeSize& code, const char* name)
985 : FuelMixedDead<120, 572, 140, 50, 10, PercentDeadFir>(code,
986 name,
987 data::LOG_0_80)
988 {
989 }
990};
995template <int PercentDeadFir>
996class FuelM4 : public FuelMixedDead<100, 404, 148, 50, 2, PercentDeadFir>
997{
998public:
999 FuelM4() = delete;
1000 ~FuelM4() = default;
1001 FuelM4(const FuelM4& rhs) noexcept = delete;
1002 FuelM4(FuelM4&& rhs) noexcept = delete;
1003 FuelM4& operator=(const FuelM4& rhs) noexcept = delete;
1004 FuelM4& operator=(FuelM4&& rhs) noexcept = delete;
1010 constexpr FuelM4(const FuelCodeSize& code, const char* name)
1011 : FuelMixedDead<100, 404, 148, 50, 2, PercentDeadFir>(code,
1012 name,
1013 data::LOG_0_80)
1014 {
1015 }
1016};
1020class FuelO1A : public FuelGrass<190, 310, 140>
1021{
1022public:
1023 FuelO1A() = delete;
1024 ~FuelO1A() override = default;
1025 FuelO1A(const FuelO1A& rhs) noexcept = delete;
1026 FuelO1A(FuelO1A&& rhs) noexcept = delete;
1027 FuelO1A& operator=(const FuelO1A& rhs) noexcept = delete;
1028 FuelO1A& operator=(FuelO1A&& rhs) noexcept = delete;
1033 explicit constexpr FuelO1A(const FuelCodeSize& code) noexcept
1034 : FuelGrass(code, "O-1a", data::LOG_1_00)
1035 {
1036 }
1037};
1041class FuelO1B : public FuelGrass<250, 350, 170>
1042{
1043public:
1044 FuelO1B() = delete;
1045 ~FuelO1B() override = default;
1046 FuelO1B(const FuelO1B& rhs) noexcept = delete;
1047 FuelO1B(FuelO1B&& rhs) noexcept = delete;
1048 FuelO1B& operator=(const FuelO1B& rhs) noexcept = delete;
1049 FuelO1B& operator=(FuelO1B&& rhs) noexcept = delete;
1054 explicit constexpr FuelO1B(const FuelCodeSize& code) noexcept
1055 : FuelGrass(code, "O-1b", data::LOG_1_00)
1056 {
1057 }
1058};
1059}
1072template <int A, int B, int C, int Bui0, int FfcA, int FfcB, int WfcA, int WfcB, int BulkDensity>
1073class FuelSlash : public FuelConifer<A, B, C, Bui0, 0, 0, BulkDensity, 15, 74>
1074{
1075public:
1076 FuelSlash() = delete;
1077 ~FuelSlash() override = default;
1078 FuelSlash(const FuelSlash& rhs) noexcept = delete;
1079 FuelSlash(FuelSlash&& rhs) noexcept = delete;
1080 FuelSlash& operator=(const FuelSlash& rhs) noexcept = delete;
1081 FuelSlash& operator=(FuelSlash&& rhs) noexcept = delete;
1090 constexpr FuelSlash(const FuelCodeSize& code,
1091 const char* name,
1092 const LogValue log_q,
1093 const Duff* duff_ffmc,
1094 const Duff* duff_dmc)
1095 : FuelConifer<A, B, C, Bui0, 0, 0, BulkDensity, 15, 74>(code,
1096 name,
1097 log_q,
1098 duff_ffmc,
1099 duff_dmc)
1100 {
1101 }
1107 [[nodiscard]] MathSize surfaceFuelConsumption(
1108 const SpreadInfo& spread) const noexcept override
1109 {
1110 return ffcA() * (1.0 - exp(ffcB() * spread.bui().asValue()))
1111 + wfcA() * (1.0 - exp(wfcB() * spread.bui().asValue()));
1112 }
1113private:
1118 [[nodiscard]] static constexpr MathSize ffcA()
1119 {
1120 return FfcA;
1121 }
1126 [[nodiscard]] static constexpr MathSize ffcB()
1127 {
1128 return FfcB / 10000.0;
1129 }
1134 [[nodiscard]] static constexpr MathSize wfcA()
1135 {
1136 return WfcA;
1137 }
1142 [[nodiscard]] static constexpr MathSize wfcB()
1143 {
1144 return WfcB / 10000.0;
1145 }
1146};
1147namespace fbp
1148{
1152class FuelS1 : public FuelSlash<75, 297, 130, 38, 4, -250, 4, -340, 78>
1153{
1154public:
1155 FuelS1() = delete;
1156 ~FuelS1() override = default;
1157 FuelS1(const FuelS1& rhs) noexcept = delete;
1158 FuelS1(FuelS1&& rhs) noexcept = delete;
1159 FuelS1& operator=(const FuelS1& rhs) noexcept = delete;
1160 FuelS1& operator=(FuelS1&& rhs) noexcept = delete;
1165 explicit constexpr FuelS1(const FuelCodeSize& code) noexcept
1166 : FuelSlash(code,
1167 "S-1",
1168 data::LOG_0_75,
1171 {
1172 }
1173};
1177class FuelS2 : public FuelSlash<40, 438, 170, 63, 10, -130, 6, -600, 132>
1178{
1179public:
1180 FuelS2() = delete;
1181 ~FuelS2() override = default;
1182 FuelS2(const FuelS2& rhs) noexcept = delete;
1183 FuelS2(FuelS2&& rhs) noexcept = delete;
1184 FuelS2& operator=(const FuelS2& rhs) noexcept = delete;
1185 FuelS2& operator=(FuelS2&& rhs) noexcept = delete;
1190 explicit constexpr FuelS2(const FuelCodeSize& code) noexcept
1191 : FuelSlash(code,
1192 "S-2",
1193 data::LOG_0_75,
1196 {
1197 }
1198};
1202class FuelS3 : public FuelSlash<55, 829, 320, 31, 12, -166, 20, -210, 100>
1203{
1204public:
1205 FuelS3() = delete;
1206 ~FuelS3() override = default;
1207 FuelS3(const FuelS3& rhs) noexcept = delete;
1208 FuelS3(FuelS3&& rhs) noexcept = delete;
1209 FuelS3& operator=(const FuelS3& rhs) noexcept = delete;
1210 FuelS3& operator=(FuelS3&& rhs) noexcept = delete;
1215 explicit constexpr FuelS3(const FuelCodeSize& code) noexcept
1216 : FuelSlash(code,
1217 "S-3",
1218 data::LOG_0_75,
1221 {
1222 }
1223};
1224}
1225template <class FuelSpring, class FuelSummer>
1226class FuelVariable;
1227template <class FuelSpring, class FuelSummer>
1228[[nodiscard]] const FuelType& find_fuel_by_season(const int nd,
1229 const FuelVariable<
1230 FuelSpring,
1231 FuelSummer>& fuel) noexcept
1232{
1233 // if not green yet, then still in spring conditions
1235 ? fuel.summer()
1237 ? fuel.spring()
1238 : calculate_is_green(nd)
1239 ? fuel.summer()
1240 : fuel.spring();
1241}
1242template <class FuelSpring, class FuelSummer>
1243[[nodiscard]] MathSize compare_by_season(const FuelVariable<FuelSpring, FuelSummer>& fuel,
1244 const function<MathSize(const FuelType&)>& fct)
1245{
1246 // HACK: no way to tell which is which, so let's assume they have to be the same??
1247 // HACK: use a function so that DEBUG section doesn't get out of sync
1248 const auto for_spring = fct(fuel.spring());
1249#ifdef DEBUG_FUEL_VARIABLE
1250 const auto for_summer = fct(fuel.summer());
1251 logging::check_fatal(for_spring != for_summer, "Expected spring and summer cfb to be identical");
1252#endif
1253 return for_spring;
1254}
1260template <class FuelSpring, class FuelSummer>
1262{
1263public:
1264 // don't delete pointers since they're handled elsewhere
1265 ~FuelVariable() override = default;
1274 constexpr FuelVariable(const FuelCodeSize& code,
1275 const char* name,
1276 const bool can_crown,
1277 const FuelSpring* const spring,
1278 const FuelSummer* const summer)
1279 : FuelType(code, name, can_crown),
1280 spring_(spring),
1282 {
1283 }
1284 FuelVariable(FuelVariable&& rhs) noexcept = delete;
1285 FuelVariable(const FuelVariable& rhs) = delete;
1286 FuelVariable& operator=(FuelVariable&& rhs) noexcept = delete;
1287 FuelVariable& operator=(const FuelVariable& rhs) = delete;
1293 [[nodiscard]] MathSize buiEffect(MathSize bui) const override
1294 {
1295 return compare_by_season(*this, [bui](const FuelType& fuel) { return fuel.buiEffect(bui); });
1296 }
1301 [[nodiscard]] MathSize grass_curing(const int nd, const wx::FwiWeather& wx) const override
1302 {
1303 return compare_by_season(*this, [&nd, &wx](const FuelType& fuel) { return fuel.grass_curing(nd, wx); });
1304 }
1309 [[nodiscard]] MathSize cbh() const override
1310 {
1311 return compare_by_season(*this, [](const FuelType& fuel) { return fuel.cbh(); });
1312 }
1317 [[nodiscard]] MathSize cfl() const override
1318 {
1319 return compare_by_season(*this, [](const FuelType& fuel) { return fuel.cfl(); });
1320 }
1326 [[nodiscard]] MathSize crownConsumption(const MathSize cfb) const override
1327 {
1328 return compare_by_season(*this, [cfb](const FuelType& fuel) { return fuel.crownConsumption(cfb); });
1329 }
1337 [[nodiscard]] MathSize calculateRos(const int nd,
1338 const wx::FwiWeather& wx,
1339 const MathSize isi) const override
1340 {
1341 return find_fuel_by_season(nd, *this).calculateRos(nd, wx, isi);
1342 }
1349 [[nodiscard]] MathSize calculateIsf(const SpreadInfo& spread,
1350 const MathSize isi) const override
1351 {
1352 return find_fuel_by_season(spread.nd(), *this).calculateIsf(spread, isi);
1353 }
1359 [[nodiscard]] MathSize surfaceFuelConsumption(
1360 const SpreadInfo& spread) const override
1361 {
1362 return find_fuel_by_season(spread.nd(), *this).surfaceFuelConsumption(spread);
1363 }
1369 [[nodiscard]] MathSize lengthToBreadth(const MathSize ws) const override
1370 {
1371 return compare_by_season(*this, [ws](const FuelType& fuel) { return fuel.lengthToBreadth(ws); });
1372 }
1381 [[nodiscard]] MathSize finalRos(const SpreadInfo& spread,
1382 const MathSize isi,
1383 const MathSize cfb,
1384 const MathSize rss) const override
1385 {
1386 return find_fuel_by_season(spread.nd(), *this).finalRos(spread, isi, cfb, rss);
1387 }
1393 [[nodiscard]] MathSize criticalSurfaceIntensity(
1394 const SpreadInfo& spread) const override
1395 {
1396 return find_fuel_by_season(spread.nd(), *this).criticalSurfaceIntensity(spread);
1397 }
1404 [[nodiscard]] MathSize crownFractionBurned(const MathSize rss,
1405 const MathSize rso) const noexcept override
1406 {
1407 return spring().crownFractionBurned(rss, rso);
1408 }
1414 [[nodiscard]] MathSize probabilityPeat(const MathSize mc_fraction) const noexcept override
1415 {
1416 return spring().probabilityPeat(mc_fraction);
1417 }
1423 [[nodiscard]] MathSize survivalProbability(const wx::FwiWeather& wx) const noexcept
1424 override
1425 {
1426 return spring().survivalProbability(wx);
1427 }
1432 [[nodiscard]] constexpr const FuelType& spring() const
1433 {
1434 return *spring_;
1435 }
1440 [[nodiscard]] constexpr const FuelType& summer() const
1441 {
1442 return *summer_;
1443 }
1444private:
1448 const FuelSpring* const spring_;
1452 const FuelSummer* const summer_;
1453};
1454namespace fbp
1455{
1459class FuelD1D2 : public FuelVariable<FuelD1, FuelD2>
1460{
1461public:
1462 FuelD1D2() = delete;
1463 ~FuelD1D2() override = default;
1464 FuelD1D2(const FuelD1D2& rhs) noexcept = delete;
1465 FuelD1D2(FuelD1D2&& rhs) noexcept = delete;
1466 FuelD1D2& operator=(const FuelD1D2& rhs) noexcept = delete;
1467 FuelD1D2& operator=(FuelD1D2&& rhs) noexcept = delete;
1474 constexpr FuelD1D2(const FuelCodeSize& code,
1475 const FuelD1* d1,
1476 const FuelD2* d2) noexcept
1477 : FuelVariable(code, "D-1/D-2", false, d1, d2)
1478 {
1479 }
1480};
1485template <int PercentConifer>
1486class FuelM1M2 : public FuelVariable<FuelM1<PercentConifer>, FuelM2<PercentConifer>>
1487{
1488public:
1489 FuelM1M2() = delete;
1490 ~FuelM1M2() = default;
1491 FuelM1M2(const FuelM1M2& rhs) noexcept = delete;
1492 FuelM1M2(FuelM1M2&& rhs) noexcept = delete;
1493 FuelM1M2& operator=(const FuelM1M2& rhs) noexcept = delete;
1494 FuelM1M2& operator=(FuelM1M2&& rhs) noexcept = delete;
1495 // HACK: it's up to you to make sure these match
1503 constexpr FuelM1M2(const FuelCodeSize& code,
1504 const char* name,
1505 const FuelM1<PercentConifer>* m1,
1506 const FuelM2<PercentConifer>* m2)
1507 : FuelVariable<FuelM1<PercentConifer>, FuelM2<PercentConifer>>(code, name, true, m1, m2)
1508 {
1509 }
1510};
1515template <int PercentDeadFir>
1516class FuelM3M4 : public FuelVariable<FuelM3<PercentDeadFir>, FuelM4<PercentDeadFir>>
1517{
1518public:
1519 FuelM3M4() = delete;
1520 ~FuelM3M4() = default;
1521 FuelM3M4(const FuelM3M4& rhs) noexcept = delete;
1522 FuelM3M4(FuelM3M4&& rhs) noexcept = delete;
1523 FuelM3M4& operator=(const FuelM3M4& rhs) noexcept = delete;
1524 FuelM3M4& operator=(FuelM3M4&& rhs) noexcept = delete;
1532 constexpr FuelM3M4(const FuelCodeSize& code,
1533 const char* name,
1534 const FuelM3<PercentDeadFir>* m3,
1535 const FuelM4<PercentDeadFir>* m4)
1536 : FuelVariable<FuelM3<PercentDeadFir>, FuelM4<PercentDeadFir>>(code, name, true, m3, m4)
1537 {
1538 }
1539};
1543class FuelO1 : public FuelVariable<FuelO1A, FuelO1B>
1544{
1545public:
1546 FuelO1() = delete;
1547 ~FuelO1() = default;
1548 FuelO1(const FuelO1& rhs) noexcept = delete;
1549 FuelO1(FuelO1&& rhs) noexcept = delete;
1550 FuelO1& operator=(const FuelO1& rhs) noexcept = delete;
1551 FuelO1& operator=(FuelO1&& rhs) noexcept = delete;
1559 constexpr FuelO1(const FuelCodeSize& code,
1560 const char* name,
1561 const FuelO1A* o1a,
1562 const FuelO1B* o1b)
1563 : FuelVariable<FuelO1A, FuelO1B>(code, name, true, o1a, o1b)
1564 {
1565 }
1566};
1567}
1568}
constexpr MathSize asValue() const noexcept
Returns value as a MathSize.
Definition Index.h:84
A result of calling log(x) for some value of x, pre-calculated at compile time.
Definition Index.h:168
Base class for DuffType.
Definition Duff.h:43
static const DuffType< 94, 2220, -198198, -1169, 10414, 782 > Peat
Peat [Frandsen table 2/3].
Definition Duff.h:114
static const DuffType< 359, 1220, 3325604, -12220, -21024, -12619 > WhiteSpruce
Sedge meadow (upper) [Frandsen table 2/3].
Definition Duff.h:110
static const DuffType< 365, 1900, 451778, -3227, -3644, -362 > PineSeney
Sedge meadow (Seney) [Frandsen table 2/3].
Definition Duff.h:126
static const DuffType< 181, 427, 90970, -1040, 1165, -646 > FeatherMoss
Sphagnum (lower) [Frandsen table 2/3].
Definition Duff.h:94
static const DuffType< 307, 1160, 586921, -2737, -5413, -1246 > SprucePine
Spruce/pine duff [Frandsen table 2/3].
Definition Duff.h:130
static const DuffType< 124, 218, -88306, -608, 8095, 2735 > SphagnumUpper
Feather moss (upper) [Frandsen table 2/3].
Definition Duff.h:86
static const DuffType< 261, 563, 80359, -393, -591, -340 > Reindeer
Reindeer/feather [Frandsen table 2/3].
Definition Duff.h:98
A conifer fuel type.
Definition FBP45.h:125
constexpr FuelConifer(const FuelCodeSize &code, const char *name, const LogValue log_q, const Duff *duff_ffmc, const Duff *duff_dmc)
A conifer FBP fuel type.
Definition FBP45.h:142
constexpr FuelConifer(const FuelCodeSize &code, const char *name, const LogValue log_q, const Duff *duff)
A conifer FBP fuel type.
Definition FBP45.h:162
A grass fuel type.
Definition FBP45.h:558
MathSize lengthToBreadth(const MathSize ws) const noexcept override
Length to Breadth ratio [ST-X-3 eq 80/81].
Definition FBP45.h:651
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 FBP45.h:624
MathSize surfaceFuelConsumption(const SpreadInfo &) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 pg 21].
Definition FBP45.h:588
MathSize calculateRos(const MathSize multiplier, const MathSize isi) const noexcept
Calculate rate of spread (m/min)
Definition FBP45.h:662
constexpr FuelGrass(const FuelCodeSize &code, const char *name, const LogValue log_q)
A grass fuel type.
Definition FBP45.h:572
MathSize calculateRos(const int nd, const wx::FwiWeather &wx, const MathSize isi) const noexcept override
Calculate rate of spread (m/min)
Definition FBP45.h:639
MathSize grass_curing(const int nd, const wx::FwiWeather &wx) const override
Grass curing.
Definition FBP45.h:597
MathSize baseMultiplier(const int nd, const wx::FwiWeather &wx) const noexcept
Calculate base rate of spread multiplier.
Definition FBP45.h:613
A fuel with jackpine as base fuel type.
Definition FBP45.h:205
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface fuel consumption (SFC) (kg/m^2) [ST-X-3 eq 11].
Definition FBP45.h:219
A fuel made of dead fir and D1.
Definition FBP45.h:457
constexpr FuelMixedDead(const FuelCodeSize &code, const char *name, const LogValue log_q)
A mixed dead FBP fuel type.
Definition FBP45.h:471
A fuel composed of C2 and D1 mixed.
Definition FBP45.h:488
constexpr FuelMixedWood(const FuelCodeSize &code, const char *name)
A mixedwood FBP fuel type.
Definition FBP45.h:501
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 eq 17].
Definition FBP45.h:513
A mixedwood fuel type.
Definition FBP45.h:338
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 eq 10].
Definition FBP45.h:368
constexpr FuelMixed(const FuelCodeSize &code, const char *name, const LogValue log_q)
A mixed FBP fuel type.
Definition FBP45.h:352
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 FBP45.h:400
static constexpr MathSize ratioDeciduous()
Percent Deciduous (% / 100)
Definition FBP45.h:418
MathSize crownConsumption(const MathSize cfb) const noexcept override
Crown Fuel Consumption (CFC) (kg/m^2) [ST-X-3 eq 66, pg 38].
Definition FBP45.h:378
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 FBP45.h:438
static constexpr MathSize ratioConifer()
Percent Conifer (% / 100)
Definition FBP45.h:410
MathSize calculateRos(const int, const wx::FwiWeather &, const MathSize isi) const noexcept override
Calculate rate of spread (m/min) [ST-X-3 27/28, GLC-X-10 29/31].
Definition FBP45.h:387
static constexpr MathSize rosMultiplier()
Rate of spread multiplier [ST-X-3 eq 27/28, GLC-X-10 eq 29/30].
Definition FBP45.h:427
A StandardFuel that is not made of multiple fuels.
Definition FBP45.h:71
virtual MathSize calculateRos(const int, const wx::FwiWeather &, const MathSize isi) const noexcept override
Initial rate of spread (m/min) [ST-X-3 eq 26].
Definition FBP45.h:103
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 FBP45.h:88
A fuel with pine as the base fuel type.
Definition FBP45.h:255
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface fuel consumption (SFC) (kg/m^2) [ST-X-3 eq 12].
Definition FBP45.h:269
A slash fuel type.
Definition FBP45.h:1074
constexpr FuelSlash(const FuelCodeSize &code, const char *name, const LogValue log_q, const Duff *duff_ffmc, const Duff *duff_dmc)
A slash fuel type.
Definition FBP45.h:1090
static constexpr MathSize wfcB()
Woody Fuel Consumption parameter b [ST-X-3 eq 20/22/24].
Definition FBP45.h:1142
static constexpr MathSize ffcA()
Forest Floor Consumption parameter a [ST-X-3 eq 19/21/23].
Definition FBP45.h:1118
static constexpr MathSize wfcA()
Woody Fuel Consumption parameter a [ST-X-3 eq 20/22/24].
Definition FBP45.h:1134
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 eq 25].
Definition FBP45.h:1107
static constexpr MathSize ffcB()
Forest Floor Consumption parameter b [ST-X-3 eq 19/21/23].
Definition FBP45.h:1126
An FBP fuel type.
Definition FuelType.h:55
virtual MathSize cfl() const =0
Crown fuel load (kg/m^2) [ST-X-3 table 8].
virtual MathSize grass_curing(const int, const wx::FwiWeather &) const
Grass curing.
Definition FuelType.h:129
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].
virtual MathSize crownConsumption(MathSize cfb) const =0
Crown Fuel Consumption (CFC) (kg/m^2) [ST-X-3 eq 66].
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:234
virtual MathSize buiEffect(MathSize bui) const =0
BUI Effect on surface fire rate of spread [ST-X-3 eq 54].
virtual MathSize cbh() const =0
Crown base height (m) [ST-X-3 table 8].
virtual MathSize crownFractionBurned(MathSize rss, MathSize rso) const noexcept=0
Crown Fraction Burned (CFB) [ST-X-3 eq 58].
virtual MathSize criticalSurfaceIntensity(const SpreadInfo &spread) const =0
Critical Surface Fire Intensity (CSI) [ST-X-3 eq 56].
virtual MathSize probabilityPeat(MathSize mc_fraction) const noexcept=0
Calculate probability of burning [Anderson eq 1].
virtual ThresholdSize survivalProbability(const wx::FwiWeather &wx) const noexcept=0
Survival probability calculated using probability of ony survival based on multiple formulae.
virtual MathSize finalRos(const SpreadInfo &spread, MathSize isi, MathSize cfb, MathSize rss) const =0
Final rate of spread (m/min)
virtual MathSize surfaceFuelConsumption(const SpreadInfo &spread) const =0
Surface fuel consumption (SFC) (kg/m^2) [ST-X-3 eq 9-25].
virtual MathSize calculateRos(int nd, const wx::FwiWeather &wx, MathSize isi) const =0
Calculate rate of spread (m/min)
constexpr const char * name() const
Name of the fuel.
Definition FuelType.h:226
A fuel type that changes based on the season.
Definition FBP45.h:1262
MathSize probabilityPeat(const MathSize mc_fraction) const noexcept override
Calculate probability of burning [Anderson eq 1].
Definition FBP45.h:1414
MathSize grass_curing(const int nd, const wx::FwiWeather &wx) const override
Grass curing.
Definition FBP45.h:1301
constexpr const FuelType & spring() const
Fuel to use before green-up.
Definition FBP45.h:1432
const FuelSummer *const summer_
Fuel to use after green-up.
Definition FBP45.h:1452
MathSize finalRos(const SpreadInfo &spread, const MathSize isi, const MathSize cfb, const MathSize rss) const override
Final rate of spread (m/min)
Definition FBP45.h:1381
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 eq 9-25].
Definition FBP45.h:1359
MathSize crownFractionBurned(const MathSize rss, const MathSize rso) const noexcept override
Crown Fraction Burned (CFB) [ST-X-3 eq 58].
Definition FBP45.h:1404
MathSize crownConsumption(const MathSize cfb) const override
Crown Fuel Consumption (CFC) (kg/m^2) [ST-X-3 eq 66].
Definition FBP45.h:1326
const FuelSpring *const spring_
Fuel to use before green-up.
Definition FBP45.h:1448
constexpr FuelVariable(const FuelCodeSize &code, const char *name, const bool can_crown, const FuelSpring *const spring, const FuelSummer *const summer)
A slash fuel type.
Definition FBP45.h:1274
constexpr const FuelType & summer() const
Fuel to use after green-up.
Definition FBP45.h:1440
MathSize cfl() const override
Crown fuel load (kg/m^2) [ST-X-3 table 8].
Definition FBP45.h:1317
MathSize lengthToBreadth(const MathSize ws) const override
Length to Breadth ratio [ST-X-3 eq 79].
Definition FBP45.h:1369
MathSize survivalProbability(const wx::FwiWeather &wx) const noexcept override
Survival probability calculated using probability of ony survival based on multiple formulae.
Definition FBP45.h:1423
MathSize calculateRos(const int nd, const wx::FwiWeather &wx, const MathSize isi) const override
Initial rate of spread (m/min) [ST-X-3 eq 26].
Definition FBP45.h:1337
MathSize criticalSurfaceIntensity(const SpreadInfo &spread) const override
Critical Surface Fire Intensity (CSI) [ST-X-3 eq 56].
Definition FBP45.h:1393
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 FBP45.h:1349
MathSize buiEffect(MathSize bui) const override
BUI Effect on surface fire rate of spread [ST-X-3 eq 54].
Definition FBP45.h:1293
MathSize cbh() const override
Crown base height (m) [ST-X-3 table 8].
Definition FBP45.h:1309
A FuelBase made of a standard fuel type.
Definition StandardFuel.h:83
constexpr StandardFuel(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 StandardFuel.h:94
virtual MathSize crownConsumption(const MathSize cfb) const noexcept override
Crown Fuel Consumption (CFC) (kg/m^2) [ST-X-3 eq 66].
Definition StandardFuel.h:148
MathSize rosBasic(const MathSize isi) const noexcept
Initial rate of spread (m/min) [ST-X-3 eq 26].
Definition StandardFuel.h:138
MathSize limitIsf(const MathSize mu, const MathSize rsf) const noexcept
ISI with slope influence and zero wind (ISF) [ST-X-3 eq 41].
Definition StandardFuel.h:158
FBP fuel type C-1.
Definition FBP45.h:674
constexpr FuelC1(const FuelCodeSize &code) noexcept
FBP fuel type C-1.
Definition FBP45.h:686
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [GLC-X-10 eq 9a/9b].
Definition FBP45.cpp:35
FBP fuel type C-2.
Definition FBP45.h:706
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 eq 10].
Definition FBP45.cpp:39
constexpr FuelC2(const FuelCodeSize &code) noexcept
FBP fuel type C-2.
Definition FBP45.h:718
FBP fuel type C-3.
Definition FBP45.h:737
constexpr FuelC3(const FuelCodeSize &code) noexcept
FBP fuel type C-3.
Definition FBP45.h:749
FBP fuel type C-4.
Definition FBP45.h:762
constexpr FuelC4(const FuelCodeSize &code) noexcept
FBP fuel type C-4.
Definition FBP45.h:774
FBP fuel type C-5.
Definition FBP45.h:786
constexpr FuelC5(const FuelCodeSize &code) noexcept
FBP fuel type C-5.
Definition FBP45.h:798
FBP fuel type C-6.
Definition FBP45.h:810
MathSize finalRos(const SpreadInfo &spread, MathSize isi, MathSize cfb, MathSize rss) const noexcept override
Final rate of spread (m/min)
Definition FBP45.cpp:43
constexpr FuelC6(const FuelCodeSize &code) noexcept
FBP fuel type C-6.
Definition FBP45.h:822
FBP fuel type C-7.
Definition FBP45.h:847
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 eq 15].
Definition FBP45.cpp:85
constexpr FuelC7(const FuelCodeSize &code) noexcept
FBP fuel type C-7.
Definition FBP45.h:859
FBP fuel type D-1/D-2.
Definition FBP45.h:1460
constexpr FuelD1D2(const FuelCodeSize &code, const FuelD1 *d1, const FuelD2 *d2) noexcept
A fuel that changes between D-1/D-2 depending on green-up.
Definition FBP45.h:1474
FBP fuel type D-1.
Definition FBP45.h:281
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 FBP45.cpp:11
constexpr FuelD1(const FuelCodeSize &code) noexcept
FBP fuel type D-1.
Definition FBP45.h:293
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 eq 25].
Definition FBP45.h:306
FBP fuel type D-2.
Definition FBP45.h:878
constexpr FuelD2(const FuelCodeSize &code) noexcept
FBP fuel type D-2.
Definition FBP45.h:891
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2)
Definition FBP45.cpp:95
MathSize calculateRos(int nd, const wx::FwiWeather &wx, MathSize isi) const noexcept override
Calculate rate of spread (m/min)
Definition FBP45.cpp:99
FBP fuel type M-1/M-2.
Definition FBP45.h:1487
constexpr FuelM1M2(const FuelCodeSize &code, const char *name, const FuelM1< PercentConifer > *m1, const FuelM2< PercentConifer > *m2)
A fuel that changes between M-1/M-2 depending on green-up.
Definition FBP45.h:1503
FBP fuel type M-1.
Definition FBP45.h:923
constexpr FuelM1(const FuelCodeSize &code, const char *name)
FBP fuel type M-1.
Definition FBP45.h:936
FBP fuel type M-2.
Definition FBP45.h:947
constexpr FuelM2(const FuelCodeSize &code, const char *name)
FBP fuel type M-2.
Definition FBP45.h:960
FBP fuel type M-3/M-4.
Definition FBP45.h:1517
constexpr FuelM3M4(const FuelCodeSize &code, const char *name, const FuelM3< PercentDeadFir > *m3, const FuelM4< PercentDeadFir > *m4)
A fuel that changes between M-3/M-4 depending on green-up.
Definition FBP45.h:1532
FBP fuel type M-3.
Definition FBP45.h:971
constexpr FuelM3(const FuelCodeSize &code, const char *name)
FBP fuel type M-3.
Definition FBP45.h:984
FBP fuel type M-4.
Definition FBP45.h:997
constexpr FuelM4(const FuelCodeSize &code, const char *name)
FBP fuel type M-4.
Definition FBP45.h:1010
FBP fuel type O-1a.
Definition FBP45.h:1021
constexpr FuelO1A(const FuelCodeSize &code) noexcept
FBP fuel type O-1a.
Definition FBP45.h:1033
FBP fuel type O-1b.
Definition FBP45.h:1042
constexpr FuelO1B(const FuelCodeSize &code) noexcept
FBP fuel type O-1b.
Definition FBP45.h:1054
FBP fuel type O-1.
Definition FBP45.h:1544
constexpr FuelO1(const FuelCodeSize &code, const char *name, const FuelO1A *o1a, const FuelO1B *o1b)
A fuel that changes between O-1a/O-1b depending on green-up.
Definition FBP45.h:1559
FBP fuel type S-1.
Definition FBP45.h:1153
constexpr FuelS1(const FuelCodeSize &code) noexcept
FBP fuel type S-1.
Definition FBP45.h:1165
FBP fuel type S-2.
Definition FBP45.h:1178
constexpr FuelS2(const FuelCodeSize &code) noexcept
FBP fuel type S-2.
Definition FBP45.h:1190
FBP fuel type S-3.
Definition FBP45.h:1203
constexpr FuelS3(const FuelCodeSize &code) noexcept
FBP fuel type S-3.
Definition FBP45.h:1215
static bool forceStaticCuring() noexcept
Whether or not to force static grass curing value for all fires.
Definition Settings.cpp:696
static bool forceNoGreenup() noexcept
Whether or not to force no greenup for all fires.
Definition Settings.cpp:688
static bool forceGreenup() noexcept
Whether or not to force greenup for all fires.
Definition Settings.cpp:680
static int staticCuring() noexcept
Static curing value.
Definition Settings.cpp:700
Information regarding spread within a Cell for a specific Scenario and time.
Definition FireSpread.h:30
constexpr int nd() const
Difference between date and the date of minimum foliar moisture content.
Definition FireSpread.h:109
A Weather value with calculated FWI indices.
Definition FWI.h:209
constexpr const Dc & dc() const
Drought Code.
Definition FWI.h:358