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 const auto curing = (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 return max(0, min(100, curing));
42}
43[[nodiscard]] static MathSize
44 calculate_surface_fuel_consumption_mixed_or_c2(const MathSize bui) noexcept
45{
46 return 5.0 * (1.0 - exp(-0.0115 * bui));
47}
48static const util::LookupTable<&calculate_surface_fuel_consumption_mixed_or_c2>
49 SURFACE_FUEL_CONSUMPTION_MIXED_OR_C2{};
50[[nodiscard]] static MathSize
51 calculate_surface_fuel_consumption_d1(const MathSize bui) noexcept
52{
53 return 1.5 * (1.0 - exp(-0.0183 * bui));
54}
55static util::LookupTable<&calculate_surface_fuel_consumption_d1>
56 SURFACE_FUEL_CONSUMPTION_D1{};
69template <int A, int B, int C, int Bui0, int Cbh, int Cfl, int BulkDensity, int InorganicPercent, int DuffDepth>
71 : public StandardFuel<A, B, C, Bui0, Cbh, Cfl, BulkDensity, InorganicPercent, DuffDepth>
72{
73public:
74 FuelNonMixed() = delete;
75 ~FuelNonMixed() override = default;
76 FuelNonMixed(const FuelNonMixed& rhs) noexcept = delete;
77 FuelNonMixed(FuelNonMixed&& rhs) noexcept = delete;
78 FuelNonMixed& operator=(const FuelNonMixed& rhs) noexcept = delete;
79 FuelNonMixed& operator=(FuelNonMixed&& rhs) noexcept = delete;
80protected:
81 using StandardFuel<A, B, C, Bui0, Cbh, Cfl, BulkDensity, InorganicPercent, DuffDepth>::
89 [[nodiscard]] MathSize calculateIsf(const SpreadInfo& spread,
90 const MathSize isi) const noexcept override
91 {
92 return this->limitIsf(1.0,
93 calculateRos(spread.nd(),
94 *spread.weather(),
95 isi)
96 * spread.slopeFactor());
97 }
98 virtual
103 MathSize
104 calculateRos(const int,
105 const wx::FwiWeather&,
106 const MathSize isi) const noexcept override
107 {
108 return this->rosBasic(isi);
109 }
110};
123template <int A, int B, int C, int Bui0, int Cbh, int Cfl, int BulkDensity, int InorganicPercent, int DuffDepth>
125 : public FuelNonMixed<A, B, C, Bui0, Cbh, Cfl, BulkDensity, InorganicPercent, DuffDepth>
126{
127public:
128 FuelConifer() = delete;
129 ~FuelConifer() override = default;
130 FuelConifer(const FuelConifer& rhs) noexcept = delete;
131 FuelConifer(FuelConifer&& rhs) noexcept = delete;
132 FuelConifer& operator=(const FuelConifer& rhs) noexcept = delete;
133 FuelConifer& operator=(FuelConifer&& rhs) noexcept = delete;
134protected:
143 constexpr FuelConifer(const FuelCodeSize& code,
144 const char* name,
145 const LogValue log_q,
146 const Duff* duff_ffmc,
147 const Duff* duff_dmc)
148 : FuelNonMixed<A, B, C, Bui0, Cbh, Cfl, BulkDensity, InorganicPercent, DuffDepth>(code,
149 name,
150 true,
151 log_q,
152 duff_ffmc,
153 duff_dmc)
154 {
155 }
163 constexpr FuelConifer(const FuelCodeSize& code,
164 const char* name,
165 const LogValue log_q,
166 const Duff* duff)
168 name,
169 log_q,
170 duff,
171 duff)
172 {
173 }
174};
180[[nodiscard]] static MathSize
181 calculate_surface_fuel_consumption_jackpine(
182 const MathSize bui) noexcept
183{
184 return 5.0 * pow(1.0 - exp(-0.0164 * bui), 2.24);
185}
190static util::LookupTable<&calculate_surface_fuel_consumption_jackpine>
191 SURFACE_FUEL_CONSUMPTION_JACKPINE{};
203template <int A, int B, int C, int Bui0, int Cbh, int Cfl, int BulkDensity, int DuffDepth>
205 : public FuelConifer<A, B, C, Bui0, Cbh, Cfl, BulkDensity, 15, DuffDepth>
206{
207public:
208 FuelJackpine() = delete;
209 ~FuelJackpine() override = default;
210 FuelJackpine(const FuelJackpine& rhs) noexcept = delete;
211 FuelJackpine(FuelJackpine&& rhs) noexcept = delete;
212 FuelJackpine& operator=(const FuelJackpine& rhs) noexcept = delete;
213 FuelJackpine& operator=(FuelJackpine&& rhs) noexcept = delete;
214 using FuelConifer<A, B, C, Bui0, Cbh, Cfl, BulkDensity, 15, DuffDepth>::FuelConifer;
220 [[nodiscard]] MathSize surfaceFuelConsumption(
221 const SpreadInfo& spread) const noexcept override
222 {
223 return SURFACE_FUEL_CONSUMPTION_JACKPINE(spread.bui().asValue());
224 }
225};
231[[nodiscard]] static MathSize
232 calculate_surface_fuel_consumption_pine(const MathSize bui) noexcept
233{
234 return 5.0 * pow(1.0 - exp(-0.0149 * bui), 2.48);
235}
241static util::LookupTable<&calculate_surface_fuel_consumption_pine>
242 SURFACE_FUEL_CONSUMPTION_PINE{};
254template <int A, int B, int C, int Bui0, int Cbh, int Cfl, int BulkDensity, int DuffDepth>
255class FuelPine : public FuelConifer<A, B, C, Bui0, Cbh, Cfl, BulkDensity, 15, DuffDepth>
256{
257public:
258 FuelPine() = delete;
259 ~FuelPine() override = default;
260 FuelPine(const FuelPine& rhs) noexcept = delete;
261 FuelPine(FuelPine&& rhs) noexcept = delete;
262 FuelPine& operator=(const FuelPine& rhs) noexcept = delete;
263 FuelPine& operator=(FuelPine&& rhs) noexcept = delete;
264 using FuelConifer<A, B, C, Bui0, Cbh, Cfl, BulkDensity, 15, DuffDepth>::FuelConifer;
270 [[nodiscard]] MathSize surfaceFuelConsumption(
271 const SpreadInfo& spread) const noexcept override
272 {
273 return SURFACE_FUEL_CONSUMPTION_PINE(spread.bui().asValue());
274 }
275};
276namespace fbp
277{
281class FuelD1 : public FuelNonMixed<30, 232, 160, 32, 0, 0, 61, 59, 24>
282{
283public:
284 FuelD1() = delete;
285 ~FuelD1() override = default;
286 FuelD1(const FuelD1& rhs) noexcept = delete;
287 FuelD1(FuelD1&& rhs) noexcept = delete;
288 FuelD1& operator=(const FuelD1& rhs) noexcept = delete;
289 FuelD1& operator=(FuelD1&& rhs) noexcept = delete;
294 explicit constexpr FuelD1(const FuelCodeSize& code) noexcept
296 "D-1",
297 false,
298 data::LOG_0_90,
299 &Duff::Peat)
300 {
301 }
307 [[nodiscard]] MathSize surfaceFuelConsumption(
308 const SpreadInfo& spread) const noexcept override
309 {
310 return SURFACE_FUEL_CONSUMPTION_D1(spread.bui().asValue());
311 }
319 [[nodiscard]] MathSize isfD1(const SpreadInfo& spread,
320 MathSize ros_multiplier,
321 MathSize isi) const noexcept;
322};
323}
336template <int A, int B, int C, int Bui0, int RosMultiplier, int PercentMixed, int BulkDensity, int InorganicPercent, int DuffDepth>
338 : public StandardFuel<A, B, C, Bui0, 6, 80, BulkDensity, InorganicPercent, DuffDepth>
339{
340public:
341 FuelMixed() = delete;
342 ~FuelMixed() = default;
343 FuelMixed(const FuelMixed& rhs) noexcept = delete;
344 FuelMixed(FuelMixed&& rhs) noexcept = delete;
345 FuelMixed& operator=(const FuelMixed& rhs) noexcept = delete;
346 FuelMixed& operator=(FuelMixed&& rhs) noexcept = delete;
353 constexpr FuelMixed(const FuelCodeSize& code,
354 const char* name,
355 const LogValue log_q)
356 : StandardFuel<A, B, C, Bui0, 6, 80, BulkDensity, InorganicPercent, DuffDepth>(code,
357 name,
358 true,
359 log_q,
360 &Duff::Peat,
361 &Duff::Peat)
362 {
363 }
369 [[nodiscard]] MathSize surfaceFuelConsumption(
370 const SpreadInfo& spread) const noexcept override
371 {
372 return SURFACE_FUEL_CONSUMPTION_MIXED_OR_C2(spread.bui().asValue());
373 }
379 [[nodiscard]] MathSize crownConsumption(const MathSize cfb) const noexcept override
380 {
382 }
388 [[nodiscard]] MathSize calculateRos(const int,
389 const wx::FwiWeather&,
390 const MathSize isi) const noexcept override
391 {
392 static const fbp::FuelD1 F{14};
393 return ratioConifer() * this->rosBasic(isi) + rosMultiplier() * ratioDeciduous() * F.rosBasic(isi);
394 }
401 [[nodiscard]] MathSize calculateIsf(const SpreadInfo& spread,
402 const MathSize isi) const noexcept override
403 {
404 return ratioConifer() * this->limitIsf(1.0, spread.slopeFactor() * this->rosBasic(isi))
405 + ratioDeciduous() * isfD1(spread, isi);
406 }
411 [[nodiscard]] static constexpr MathSize ratioConifer()
412 {
413 return PercentMixed / 100.0;
414 }
419 [[nodiscard]] static constexpr MathSize ratioDeciduous()
420 {
421 return 1.0 - (PercentMixed / 100.0);
422 }
423protected:
428 [[nodiscard]] static constexpr MathSize rosMultiplier()
429 {
430 return RosMultiplier / 10.0;
431 }
438 [[nodiscard]] static MathSize
439 isfD1(const SpreadInfo& spread,
440 const MathSize isi) noexcept
441 {
442 static const fbp::FuelD1 F{14};
443 return F.isfD1(spread, rosMultiplier(), isi);
444 }
445};
455template <int A, int B, int C, int Bui0, int RosMultiplier, int PercentDeadFir>
457 : public FuelMixed<A, B, C, Bui0, RosMultiplier, PercentDeadFir, 61, 15, 75>
458{
459public:
460 FuelMixedDead() = delete;
461 ~FuelMixedDead() = default;
462 FuelMixedDead(const FuelMixedDead& rhs) noexcept = delete;
463 FuelMixedDead(FuelMixedDead&& rhs) noexcept = delete;
464 FuelMixedDead& operator=(const FuelMixedDead& rhs) noexcept = delete;
465 FuelMixedDead& operator=(FuelMixedDead&& rhs) noexcept = delete;
472 constexpr FuelMixedDead(const FuelCodeSize& code,
473 const char* name,
474 const LogValue log_q)
475 : FuelMixed<A, B, C, Bui0, RosMultiplier, PercentDeadFir, 61, 15, 75>(code,
476 name,
477 log_q)
478 {
479 }
480};
486template <int RosMultiplier, int RatioMixed>
488 : public FuelMixed<110, 282, 150, 50, RosMultiplier, RatioMixed, 108, 25, 50>
489{
490public:
491 FuelMixedWood() = delete;
492 ~FuelMixedWood() = default;
493 FuelMixedWood(const FuelMixedWood& rhs) noexcept = delete;
494 FuelMixedWood(FuelMixedWood&& rhs) noexcept = delete;
495 FuelMixedWood& operator=(const FuelMixedWood& rhs) noexcept = delete;
496 FuelMixedWood& operator=(FuelMixedWood&& rhs) noexcept = delete;
502 constexpr FuelMixedWood(const FuelCodeSize& code,
503 const char* name)
504 : FuelMixed<110, 282, 150, 50, RosMultiplier, RatioMixed, 108, 25, 50>(code,
505 name,
506 data::LOG_0_80)
507 {
508 }
514 [[nodiscard]] MathSize surfaceFuelConsumption(
515 const SpreadInfo& spread) const noexcept override
516 {
518 + this->ratioDeciduous() * SURFACE_FUEL_CONSUMPTION_D1(spread.bui().asValue());
519 }
520};
524[[nodiscard]] static constexpr MathSize
525 calculate_length_to_breadth_grass(const MathSize ws) noexcept
526{
527 return ws < 1.0 ? 1.0 : (1.1 * pow(ws, 0.464));
528}
532static util::LookupTable<calculate_length_to_breadth_grass> LENGTH_TO_BREADTH_GRASS{};
538[[nodiscard]] static constexpr MathSize
539 calculate_base_multiplier_curing(const MathSize curing) noexcept
540{
541 return (curing >= 58.8)
542 ? (0.176 + 0.02 * (curing - 58.8))
543 : (0.005 * expm1(0.061 * curing));
544}
549static util::LookupTable<&calculate_base_multiplier_curing> BASE_MULTIPLIER_CURING{};
556template <int A, int B, int C>
558 : public StandardFuel<A, B, C, 1, 0, 0, 0, 0, static_cast<int>(DUFF_FFMC_DEPTH * 10.0)>
559{
560public:
561 FuelGrass() = delete;
562 ~FuelGrass() override = default;
563 FuelGrass(const FuelGrass& rhs) noexcept = delete;
564 FuelGrass(FuelGrass&& rhs) noexcept = delete;
565 FuelGrass& operator=(const FuelGrass& rhs) noexcept = delete;
566 FuelGrass& operator=(FuelGrass&& rhs) noexcept = delete;
573 constexpr FuelGrass(const FuelCodeSize& code,
574 const char* name,
575 const LogValue log_q)
576 // HACK: grass assumes no duff (total duff depth == ffmc depth => dmc depth is 0)
577 : StandardFuel<A, B, C, 1, 0, 0, 0, 0, static_cast<int>(DUFF_FFMC_DEPTH * 10.0)>(code,
578 name,
579 false,
580 log_q,
581 &Duff::PeatMuck,
582 &Duff::PeatMuck)
583 {
584 }
589 [[nodiscard]] MathSize surfaceFuelConsumption(
590 const SpreadInfo&) const noexcept override
591 {
592 return DEFAULT_GRASS_FUEL_LOAD;
593 }
598 [[nodiscard]] MathSize grass_curing(const int nd, const wx::FwiWeather& wx) const override
599 {
600 return wx.dc().asValue() > 500
601 ? // we're in drought conditions
602 100
603 : calculate_grass_curing(nd);
604 }
611 [[nodiscard]] MathSize baseMultiplier(const int nd,
612 const wx::FwiWeather& wx) const noexcept
613 {
614 return BASE_MULTIPLIER_CURING(grass_curing(nd, wx));
615 }
622 [[nodiscard]] MathSize calculateIsf(const SpreadInfo& spread,
623 const MathSize isi) const noexcept override
624 {
625 const auto mu = baseMultiplier(spread.nd(), *spread.weather());
626 // prevent divide by 0
627 const auto mu_not_zero = max(0.001, mu);
628 return this->limitIsf(mu_not_zero, calculateRos(mu, isi) * spread.slopeFactor());
629 }
637 [[nodiscard]] MathSize calculateRos(const int nd,
638 const wx::FwiWeather& wx,
639 const MathSize isi) const noexcept override
640 {
641 return calculateRos(baseMultiplier(nd, wx), isi);
642 }
643protected:
649 [[nodiscard]] MathSize lengthToBreadth(const MathSize ws) const noexcept override
650 {
651 return LENGTH_TO_BREADTH_GRASS(ws);
652 }
653private:
660 [[nodiscard]] MathSize calculateRos(const MathSize multiplier,
661 const MathSize isi) const noexcept
662 {
663 return multiplier * this->rosBasic(isi);
664 }
665};
666namespace fbp
667{
671class FuelC1 : public FuelConifer<90, 649, 450, 72, 2, 75, 45, 5, 34>
672{
673public:
674 FuelC1() = delete;
675 ~FuelC1() override = default;
676 FuelC1(const FuelC1& rhs) noexcept = delete;
677 FuelC1(FuelC1&& rhs) noexcept = delete;
678 FuelC1& operator=(const FuelC1& rhs) noexcept = delete;
679 FuelC1& operator=(FuelC1&& rhs) noexcept = delete;
684 explicit constexpr FuelC1(const FuelCodeSize& code) noexcept
686 "C-1",
687 data::LOG_0_90,
689 &Duff::Peat)
690 {
691 }
697 [[nodiscard]] MathSize surfaceFuelConsumption(
698 const SpreadInfo& spread) const noexcept override;
699};
703class FuelC2 : public FuelConifer<110, 282, 150, 64, 3, 80, 34, 0, 100>
704{
705public:
706 FuelC2() = delete;
707 ~FuelC2() override = default;
708 FuelC2(const FuelC2& rhs) noexcept = delete;
709 FuelC2(FuelC2&& rhs) noexcept = delete;
710 FuelC2& operator=(const FuelC2& rhs) noexcept = delete;
711 FuelC2& operator=(FuelC2&& rhs) noexcept = delete;
716 explicit constexpr FuelC2(const FuelCodeSize& code) noexcept
718 "C-2",
719 data::LOG_0_70,
721 {
722 }
728 [[nodiscard]] MathSize surfaceFuelConsumption(
729 const SpreadInfo& spread) const noexcept override;
730};
734class FuelC3 : public FuelJackpine<110, 444, 300, 62, 8, 115, 20, 65>
735{
736public:
737 FuelC3() = delete;
738 ~FuelC3() override = default;
739 FuelC3(const FuelC3& rhs) noexcept = delete;
740 FuelC3(FuelC3&& rhs) noexcept = delete;
741 FuelC3& operator=(const FuelC3& rhs) noexcept = delete;
742 FuelC3& operator=(FuelC3&& rhs) noexcept = delete;
747 explicit constexpr FuelC3(const FuelCodeSize& code) noexcept
749 "C-3",
750 data::LOG_0_75,
753 {
754 }
755};
759class FuelC4 : public FuelJackpine<110, 293, 150, 66, 4, 120, 31, 62>
760{
761public:
762 FuelC4() = delete;
763 ~FuelC4() override = default;
764 FuelC4(const FuelC4& rhs) noexcept = delete;
765 FuelC4(FuelC4&& rhs) noexcept = delete;
766 FuelC4& operator=(const FuelC4& rhs) noexcept = delete;
767 FuelC4& operator=(FuelC4&& rhs) noexcept = delete;
772 explicit constexpr FuelC4(const FuelCodeSize& code) noexcept
774 "C-4",
775 data::LOG_0_80,
777 {
778 }
779};
783class FuelC5 : public FuelPine<30, 697, 400, 56, 18, 120, 93, 46>
784{
785public:
786 FuelC5() = delete;
787 ~FuelC5() override = default;
788 FuelC5(const FuelC5& rhs) noexcept = delete;
789 FuelC5(FuelC5&& rhs) noexcept = delete;
790 FuelC5& operator=(const FuelC5& rhs) noexcept = delete;
791 FuelC5& operator=(FuelC5&& rhs) noexcept = delete;
796 explicit constexpr FuelC5(const FuelCodeSize& code) noexcept
797 : FuelPine(code,
798 "C-5",
799 data::LOG_0_80,
801 {
802 }
803};
807class FuelC6 : public FuelPine<30, 800, 300, 62, 7, 180, 50, 50>
808{
809public:
810 FuelC6() = delete;
811 ~FuelC6() override = default;
812 FuelC6(const FuelC6& rhs) noexcept = delete;
813 FuelC6(FuelC6&& rhs) noexcept = delete;
814 FuelC6& operator=(const FuelC6& rhs) noexcept = delete;
815 FuelC6& operator=(FuelC6&& rhs) noexcept = delete;
820 explicit constexpr FuelC6(const FuelCodeSize& code) noexcept
821 : FuelPine(code,
822 "C-6",
823 data::LOG_0_80,
825 {
826 }
827protected:
836 [[nodiscard]] MathSize finalRos(const SpreadInfo& spread,
837 MathSize isi,
838 MathSize cfb,
839 MathSize rss) const noexcept override;
840};
844class FuelC7 : public FuelConifer<45, 305, 200, 106, 10, 50, 20, 15, 50>
845{
846public:
847 FuelC7() = delete;
848 ~FuelC7() override = default;
849 FuelC7(const FuelC7& rhs) noexcept = delete;
850 FuelC7(FuelC7&& rhs) noexcept = delete;
851 FuelC7& operator=(const FuelC7& rhs) noexcept = delete;
852 FuelC7& operator=(FuelC7&& rhs) noexcept = delete;
857 explicit constexpr FuelC7(const FuelCodeSize& code) noexcept
859 "C-7",
860 data::LOG_0_85,
862 {
863 }
869 [[nodiscard]] MathSize surfaceFuelConsumption(
870 const SpreadInfo& spread) const noexcept override;
871};
875class FuelD2 : public FuelNonMixed<6, 232, 160, 32, 0, 0, 61, 59, 24>
876{
877public:
878 FuelD2() = delete;
879 ~FuelD2() override = default;
880 FuelD2(const FuelD2& rhs) noexcept = delete;
881 FuelD2(FuelD2&& rhs) noexcept = delete;
882 FuelD2& operator=(const FuelD2& rhs) noexcept = delete;
883 FuelD2& operator=(FuelD2&& rhs) noexcept = delete;
884 // HACK: assume same bulk_density and inorganicContent as D1
889 explicit constexpr FuelD2(const FuelCodeSize& code) noexcept
891 "D-2",
892 false,
893 data::LOG_0_90,
894 &Duff::Peat)
895 {
896 }
902 [[nodiscard]] MathSize surfaceFuelConsumption(
903 const SpreadInfo& spread) const noexcept override;
911 [[nodiscard]] MathSize calculateRos(int nd,
912 const wx::FwiWeather& wx,
913 MathSize isi) const noexcept override;
914};
919template <int PercentConifer>
920class FuelM1 : public FuelMixedWood<10, PercentConifer>
921{
922public:
923 FuelM1() = delete;
924 ~FuelM1() = default;
925 FuelM1(const FuelM1& rhs) noexcept = delete;
926 FuelM1(FuelM1&& rhs) noexcept = delete;
927 FuelM1& operator=(const FuelM1& rhs) noexcept = delete;
928 FuelM1& operator=(FuelM1&& rhs) noexcept = delete;
934 constexpr FuelM1(const FuelCodeSize& code, const char* name)
935 : FuelMixedWood<10, PercentConifer>(code, name)
936 {
937 }
938};
943template <int PercentConifer>
944class FuelM2 : public FuelMixedWood<2, PercentConifer>
945{
946public:
947 FuelM2() = delete;
948 ~FuelM2() = default;
949 FuelM2(const FuelM2& rhs) noexcept = delete;
950 FuelM2(FuelM2&& rhs) noexcept = delete;
951 FuelM2& operator=(const FuelM2& rhs) noexcept = delete;
952 FuelM2& operator=(FuelM2&& rhs) noexcept = delete;
958 constexpr FuelM2(const FuelCodeSize& code, const char* name)
959 : FuelMixedWood<2, PercentConifer>(code, name)
960 {
961 }
962};
967template <int PercentDeadFir>
968class FuelM3 : public FuelMixedDead<120, 572, 140, 50, 10, PercentDeadFir>
969{
970public:
971 FuelM3() = delete;
972 ~FuelM3() = default;
973 FuelM3(const FuelM3& rhs) noexcept = delete;
974 FuelM3(FuelM3&& rhs) noexcept = delete;
975 FuelM3& operator=(const FuelM3& rhs) noexcept = delete;
976 FuelM3& operator=(FuelM3&& rhs) noexcept = delete;
982 constexpr FuelM3(const FuelCodeSize& code, const char* name)
983 : FuelMixedDead<120, 572, 140, 50, 10, PercentDeadFir>(code,
984 name,
985 data::LOG_0_80)
986 {
987 }
988};
993template <int PercentDeadFir>
994class FuelM4 : public FuelMixedDead<100, 404, 148, 50, 2, PercentDeadFir>
995{
996public:
997 FuelM4() = delete;
998 ~FuelM4() = default;
999 FuelM4(const FuelM4& rhs) noexcept = delete;
1000 FuelM4(FuelM4&& rhs) noexcept = delete;
1001 FuelM4& operator=(const FuelM4& rhs) noexcept = delete;
1002 FuelM4& operator=(FuelM4&& rhs) noexcept = delete;
1008 constexpr FuelM4(const FuelCodeSize& code, const char* name)
1009 : FuelMixedDead<100, 404, 148, 50, 2, PercentDeadFir>(code,
1010 name,
1011 data::LOG_0_80)
1012 {
1013 }
1014};
1018class FuelO1A : public FuelGrass<190, 310, 140>
1019{
1020public:
1021 FuelO1A() = delete;
1022 ~FuelO1A() override = default;
1023 FuelO1A(const FuelO1A& rhs) noexcept = delete;
1024 FuelO1A(FuelO1A&& rhs) noexcept = delete;
1025 FuelO1A& operator=(const FuelO1A& rhs) noexcept = delete;
1026 FuelO1A& operator=(FuelO1A&& rhs) noexcept = delete;
1031 explicit constexpr FuelO1A(const FuelCodeSize& code) noexcept
1032 : FuelGrass(code, "O-1a", data::LOG_1_00)
1033 {
1034 }
1035};
1039class FuelO1B : public FuelGrass<250, 350, 170>
1040{
1041public:
1042 FuelO1B() = delete;
1043 ~FuelO1B() override = default;
1044 FuelO1B(const FuelO1B& rhs) noexcept = delete;
1045 FuelO1B(FuelO1B&& rhs) noexcept = delete;
1046 FuelO1B& operator=(const FuelO1B& rhs) noexcept = delete;
1047 FuelO1B& operator=(FuelO1B&& rhs) noexcept = delete;
1052 explicit constexpr FuelO1B(const FuelCodeSize& code) noexcept
1053 : FuelGrass(code, "O-1b", data::LOG_1_00)
1054 {
1055 }
1056};
1057}
1070template <int A, int B, int C, int Bui0, int FfcA, int FfcB, int WfcA, int WfcB, int BulkDensity>
1071class FuelSlash : public FuelConifer<A, B, C, Bui0, 0, 0, BulkDensity, 15, 74>
1072{
1073public:
1074 FuelSlash() = delete;
1075 ~FuelSlash() override = default;
1076 FuelSlash(const FuelSlash& rhs) noexcept = delete;
1077 FuelSlash(FuelSlash&& rhs) noexcept = delete;
1078 FuelSlash& operator=(const FuelSlash& rhs) noexcept = delete;
1079 FuelSlash& operator=(FuelSlash&& rhs) noexcept = delete;
1088 constexpr FuelSlash(const FuelCodeSize& code,
1089 const char* name,
1090 const LogValue log_q,
1091 const Duff* duff_ffmc,
1092 const Duff* duff_dmc)
1093 : FuelConifer<A, B, C, Bui0, 0, 0, BulkDensity, 15, 74>(code,
1094 name,
1095 log_q,
1096 duff_ffmc,
1097 duff_dmc)
1098 {
1099 }
1105 [[nodiscard]] MathSize surfaceFuelConsumption(
1106 const SpreadInfo& spread) const noexcept override
1107 {
1108 return ffcA() * (1.0 - exp(ffcB() * spread.bui().asValue()))
1109 + wfcA() * (1.0 - exp(wfcB() * spread.bui().asValue()));
1110 }
1111private:
1116 [[nodiscard]] static constexpr MathSize ffcA()
1117 {
1118 return FfcA;
1119 }
1124 [[nodiscard]] static constexpr MathSize ffcB()
1125 {
1126 return FfcB / 10000.0;
1127 }
1132 [[nodiscard]] static constexpr MathSize wfcA()
1133 {
1134 return WfcA;
1135 }
1140 [[nodiscard]] static constexpr MathSize wfcB()
1141 {
1142 return WfcB / 10000.0;
1143 }
1144};
1145namespace fbp
1146{
1150class FuelS1 : public FuelSlash<75, 297, 130, 38, 4, -250, 4, -340, 78>
1151{
1152public:
1153 FuelS1() = delete;
1154 ~FuelS1() override = default;
1155 FuelS1(const FuelS1& rhs) noexcept = delete;
1156 FuelS1(FuelS1&& rhs) noexcept = delete;
1157 FuelS1& operator=(const FuelS1& rhs) noexcept = delete;
1158 FuelS1& operator=(FuelS1&& rhs) noexcept = delete;
1163 explicit constexpr FuelS1(const FuelCodeSize& code) noexcept
1164 : FuelSlash(code,
1165 "S-1",
1166 data::LOG_0_75,
1169 {
1170 }
1171};
1175class FuelS2 : public FuelSlash<40, 438, 170, 63, 10, -130, 6, -600, 132>
1176{
1177public:
1178 FuelS2() = delete;
1179 ~FuelS2() override = default;
1180 FuelS2(const FuelS2& rhs) noexcept = delete;
1181 FuelS2(FuelS2&& rhs) noexcept = delete;
1182 FuelS2& operator=(const FuelS2& rhs) noexcept = delete;
1183 FuelS2& operator=(FuelS2&& rhs) noexcept = delete;
1188 explicit constexpr FuelS2(const FuelCodeSize& code) noexcept
1189 : FuelSlash(code,
1190 "S-2",
1191 data::LOG_0_75,
1194 {
1195 }
1196};
1200class FuelS3 : public FuelSlash<55, 829, 320, 31, 12, -166, 20, -210, 100>
1201{
1202public:
1203 FuelS3() = delete;
1204 ~FuelS3() override = default;
1205 FuelS3(const FuelS3& rhs) noexcept = delete;
1206 FuelS3(FuelS3&& rhs) noexcept = delete;
1207 FuelS3& operator=(const FuelS3& rhs) noexcept = delete;
1208 FuelS3& operator=(FuelS3&& rhs) noexcept = delete;
1213 explicit constexpr FuelS3(const FuelCodeSize& code) noexcept
1214 : FuelSlash(code,
1215 "S-3",
1216 data::LOG_0_75,
1219 {
1220 }
1221};
1222}
1223template <class FuelSpring, class FuelSummer>
1224class FuelVariable;
1225template <class FuelSpring, class FuelSummer>
1226[[nodiscard]] const FuelType& find_fuel_by_season(const int nd,
1227 const FuelVariable<
1228 FuelSpring,
1229 FuelSummer>& fuel) noexcept
1230{
1231 // if not green yet, then still in spring conditions
1232 return calculate_is_green(nd)
1233 ? fuel.summer()
1234 : fuel.spring();
1235}
1236template <class FuelSpring, class FuelSummer>
1237[[nodiscard]] MathSize compare_by_season(const FuelVariable<FuelSpring, FuelSummer>& fuel,
1238 const function<MathSize(const FuelType&)>& fct)
1239{
1240 // HACK: no way to tell which is which, so let's assume they have to be the same??
1241 // HACK: use a function so that DEBUG section doesn't get out of sync
1242 const auto for_spring = fct(fuel.spring());
1243#ifdef DEBUG_FUEL_VARIABLE
1244 const auto for_summer = fct(fuel.summer());
1245 logging::check_fatal(for_spring != for_summer, "Expected spring and summer cfb to be identical");
1246#endif
1247 return for_spring;
1248}
1254template <class FuelSpring, class FuelSummer>
1256{
1257public:
1258 // don't delete pointers since they're handled elsewhere
1259 ~FuelVariable() override = default;
1268 constexpr FuelVariable(const FuelCodeSize& code,
1269 const char* name,
1270 const bool can_crown,
1271 const FuelSpring* const spring,
1272 const FuelSummer* const summer)
1273 : FuelType(code, name, can_crown),
1274 spring_(spring),
1276 {
1277 }
1278 FuelVariable(FuelVariable&& rhs) noexcept = delete;
1279 FuelVariable(const FuelVariable& rhs) = delete;
1280 FuelVariable& operator=(FuelVariable&& rhs) noexcept = delete;
1281 FuelVariable& operator=(const FuelVariable& rhs) = delete;
1287 [[nodiscard]] MathSize buiEffect(MathSize bui) const override
1288 {
1289 return compare_by_season(*this, [bui](const FuelType& fuel) { return fuel.buiEffect(bui); });
1290 }
1295 [[nodiscard]] MathSize grass_curing(const int nd, const wx::FwiWeather& wx) const override
1296 {
1297 return compare_by_season(*this, [&nd, &wx](const FuelType& fuel) { return fuel.grass_curing(nd, wx); });
1298 }
1303 [[nodiscard]] MathSize cbh() const override
1304 {
1305 return compare_by_season(*this, [](const FuelType& fuel) { return fuel.cbh(); });
1306 }
1311 [[nodiscard]] MathSize cfl() const override
1312 {
1313 return compare_by_season(*this, [](const FuelType& fuel) { return fuel.cfl(); });
1314 }
1320 [[nodiscard]] MathSize crownConsumption(const MathSize cfb) const override
1321 {
1322 return compare_by_season(*this, [cfb](const FuelType& fuel) { return fuel.crownConsumption(cfb); });
1323 }
1331 [[nodiscard]] MathSize calculateRos(const int nd,
1332 const wx::FwiWeather& wx,
1333 const MathSize isi) const override
1334 {
1335 return find_fuel_by_season(nd, *this).calculateRos(nd, wx, isi);
1336 }
1343 [[nodiscard]] MathSize calculateIsf(const SpreadInfo& spread,
1344 const MathSize isi) const override
1345 {
1346 return find_fuel_by_season(spread.nd(), *this).calculateIsf(spread, isi);
1347 }
1353 [[nodiscard]] MathSize surfaceFuelConsumption(
1354 const SpreadInfo& spread) const override
1355 {
1356 return find_fuel_by_season(spread.nd(), *this).surfaceFuelConsumption(spread);
1357 }
1363 [[nodiscard]] MathSize lengthToBreadth(const MathSize ws) const override
1364 {
1365 return compare_by_season(*this, [ws](const FuelType& fuel) { return fuel.lengthToBreadth(ws); });
1366 }
1375 [[nodiscard]] MathSize finalRos(const SpreadInfo& spread,
1376 const MathSize isi,
1377 const MathSize cfb,
1378 const MathSize rss) const override
1379 {
1380 return find_fuel_by_season(spread.nd(), *this).finalRos(spread, isi, cfb, rss);
1381 }
1387 [[nodiscard]] MathSize criticalSurfaceIntensity(
1388 const SpreadInfo& spread) const override
1389 {
1390 return find_fuel_by_season(spread.nd(), *this).criticalSurfaceIntensity(spread);
1391 }
1398 [[nodiscard]] MathSize crownFractionBurned(const MathSize rss,
1399 const MathSize rso) const noexcept override
1400 {
1401 return spring().crownFractionBurned(rss, rso);
1402 }
1408 [[nodiscard]] MathSize probabilityPeat(const MathSize mc_fraction) const noexcept override
1409 {
1410 return spring().probabilityPeat(mc_fraction);
1411 }
1417 [[nodiscard]] MathSize survivalProbability(const wx::FwiWeather& wx) const noexcept
1418 override
1419 {
1420 return spring().survivalProbability(wx);
1421 }
1426 [[nodiscard]] constexpr const FuelType& spring() const
1427 {
1428 return *spring_;
1429 }
1434 [[nodiscard]] constexpr const FuelType& summer() const
1435 {
1436 return *summer_;
1437 }
1438private:
1442 const FuelSpring* const spring_;
1446 const FuelSummer* const summer_;
1447};
1448namespace fbp
1449{
1453class FuelD1D2 : public FuelVariable<FuelD1, FuelD2>
1454{
1455public:
1456 FuelD1D2() = delete;
1457 ~FuelD1D2() override = default;
1458 FuelD1D2(const FuelD1D2& rhs) noexcept = delete;
1459 FuelD1D2(FuelD1D2&& rhs) noexcept = delete;
1460 FuelD1D2& operator=(const FuelD1D2& rhs) noexcept = delete;
1461 FuelD1D2& operator=(FuelD1D2&& rhs) noexcept = delete;
1468 constexpr FuelD1D2(const FuelCodeSize& code,
1469 const FuelD1* d1,
1470 const FuelD2* d2) noexcept
1471 : FuelVariable(code, "D-1/D-2", false, d1, d2)
1472 {
1473 }
1474};
1479template <int PercentConifer>
1480class FuelM1M2 : public FuelVariable<FuelM1<PercentConifer>, FuelM2<PercentConifer>>
1481{
1482public:
1483 FuelM1M2() = delete;
1484 ~FuelM1M2() = default;
1485 FuelM1M2(const FuelM1M2& rhs) noexcept = delete;
1486 FuelM1M2(FuelM1M2&& rhs) noexcept = delete;
1487 FuelM1M2& operator=(const FuelM1M2& rhs) noexcept = delete;
1488 FuelM1M2& operator=(FuelM1M2&& rhs) noexcept = delete;
1489 // HACK: it's up to you to make sure these match
1497 constexpr FuelM1M2(const FuelCodeSize& code,
1498 const char* name,
1499 const FuelM1<PercentConifer>* m1,
1500 const FuelM2<PercentConifer>* m2)
1501 : FuelVariable<FuelM1<PercentConifer>, FuelM2<PercentConifer>>(code, name, true, m1, m2)
1502 {
1503 }
1504};
1509template <int PercentDeadFir>
1510class FuelM3M4 : public FuelVariable<FuelM3<PercentDeadFir>, FuelM4<PercentDeadFir>>
1511{
1512public:
1513 FuelM3M4() = delete;
1514 ~FuelM3M4() = default;
1515 FuelM3M4(const FuelM3M4& rhs) noexcept = delete;
1516 FuelM3M4(FuelM3M4&& rhs) noexcept = delete;
1517 FuelM3M4& operator=(const FuelM3M4& rhs) noexcept = delete;
1518 FuelM3M4& operator=(FuelM3M4&& rhs) noexcept = delete;
1526 constexpr FuelM3M4(const FuelCodeSize& code,
1527 const char* name,
1528 const FuelM3<PercentDeadFir>* m3,
1529 const FuelM4<PercentDeadFir>* m4)
1530 : FuelVariable<FuelM3<PercentDeadFir>, FuelM4<PercentDeadFir>>(code, name, true, m3, m4)
1531 {
1532 }
1533};
1537class FuelO1 : public FuelVariable<FuelO1A, FuelO1B>
1538{
1539public:
1540 FuelO1() = delete;
1541 ~FuelO1() = default;
1542 FuelO1(const FuelO1& rhs) noexcept = delete;
1543 FuelO1(FuelO1&& rhs) noexcept = delete;
1544 FuelO1& operator=(const FuelO1& rhs) noexcept = delete;
1545 FuelO1& operator=(FuelO1&& rhs) noexcept = delete;
1553 constexpr FuelO1(const FuelCodeSize& code,
1554 const char* name,
1555 const FuelO1A* o1a,
1556 const FuelO1B* o1b)
1557 : FuelVariable<FuelO1A, FuelO1B>(code, name, true, o1a, o1b)
1558 {
1559 }
1560};
1561}
1562}
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:126
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:143
constexpr FuelConifer(const FuelCodeSize &code, const char *name, const LogValue log_q, const Duff *duff)
A conifer FBP fuel type.
Definition FBP45.h:163
A grass fuel type.
Definition FBP45.h:559
MathSize lengthToBreadth(const MathSize ws) const noexcept override
Length to Breadth ratio [ST-X-3 eq 80/81].
Definition FBP45.h:649
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:622
MathSize surfaceFuelConsumption(const SpreadInfo &) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 pg 21].
Definition FBP45.h:589
MathSize calculateRos(const MathSize multiplier, const MathSize isi) const noexcept
Calculate rate of spread (m/min)
Definition FBP45.h:660
constexpr FuelGrass(const FuelCodeSize &code, const char *name, const LogValue log_q)
A grass fuel type.
Definition FBP45.h:573
MathSize calculateRos(const int nd, const wx::FwiWeather &wx, const MathSize isi) const noexcept override
Calculate rate of spread (m/min)
Definition FBP45.h:637
MathSize grass_curing(const int nd, const wx::FwiWeather &wx) const override
Grass curing.
Definition FBP45.h:598
MathSize baseMultiplier(const int nd, const wx::FwiWeather &wx) const noexcept
Calculate base rate of spread multiplier.
Definition FBP45.h:611
A fuel with jackpine as base fuel type.
Definition FBP45.h:206
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface fuel consumption (SFC) (kg/m^2) [ST-X-3 eq 11].
Definition FBP45.h:220
A fuel made of dead fir and D1.
Definition FBP45.h:458
constexpr FuelMixedDead(const FuelCodeSize &code, const char *name, const LogValue log_q)
A mixed dead FBP fuel type.
Definition FBP45.h:472
A fuel composed of C2 and D1 mixed.
Definition FBP45.h:489
constexpr FuelMixedWood(const FuelCodeSize &code, const char *name)
A mixedwood FBP fuel type.
Definition FBP45.h:502
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 eq 17].
Definition FBP45.h:514
A mixedwood fuel type.
Definition FBP45.h:339
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 eq 10].
Definition FBP45.h:369
constexpr FuelMixed(const FuelCodeSize &code, const char *name, const LogValue log_q)
A mixed FBP fuel type.
Definition FBP45.h:353
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:401
static constexpr MathSize ratioDeciduous()
Percent Deciduous (% / 100)
Definition FBP45.h:419
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:379
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:439
static constexpr MathSize ratioConifer()
Percent Conifer (% / 100)
Definition FBP45.h:411
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:388
static constexpr MathSize rosMultiplier()
Rate of spread multiplier [ST-X-3 eq 27/28, GLC-X-10 eq 29/30].
Definition FBP45.h:428
A StandardFuel that is not made of multiple fuels.
Definition FBP45.h:72
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:104
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:89
A fuel with pine as the base fuel type.
Definition FBP45.h:256
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface fuel consumption (SFC) (kg/m^2) [ST-X-3 eq 12].
Definition FBP45.h:270
A slash fuel type.
Definition FBP45.h:1072
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:1088
static constexpr MathSize wfcB()
Woody Fuel Consumption parameter b [ST-X-3 eq 20/22/24].
Definition FBP45.h:1140
static constexpr MathSize ffcA()
Forest Floor Consumption parameter a [ST-X-3 eq 19/21/23].
Definition FBP45.h:1116
static constexpr MathSize wfcA()
Woody Fuel Consumption parameter a [ST-X-3 eq 20/22/24].
Definition FBP45.h:1132
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 eq 25].
Definition FBP45.h:1105
static constexpr MathSize ffcB()
Forest Floor Consumption parameter b [ST-X-3 eq 19/21/23].
Definition FBP45.h:1124
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:1256
MathSize probabilityPeat(const MathSize mc_fraction) const noexcept override
Calculate probability of burning [Anderson eq 1].
Definition FBP45.h:1408
MathSize grass_curing(const int nd, const wx::FwiWeather &wx) const override
Grass curing.
Definition FBP45.h:1295
constexpr const FuelType & spring() const
Fuel to use before green-up.
Definition FBP45.h:1426
const FuelSummer *const summer_
Fuel to use after green-up.
Definition FBP45.h:1446
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:1375
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 eq 9-25].
Definition FBP45.h:1353
MathSize crownFractionBurned(const MathSize rss, const MathSize rso) const noexcept override
Crown Fraction Burned (CFB) [ST-X-3 eq 58].
Definition FBP45.h:1398
MathSize crownConsumption(const MathSize cfb) const override
Crown Fuel Consumption (CFC) (kg/m^2) [ST-X-3 eq 66].
Definition FBP45.h:1320
const FuelSpring *const spring_
Fuel to use before green-up.
Definition FBP45.h:1442
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:1268
constexpr const FuelType & summer() const
Fuel to use after green-up.
Definition FBP45.h:1434
MathSize cfl() const override
Crown fuel load (kg/m^2) [ST-X-3 table 8].
Definition FBP45.h:1311
MathSize lengthToBreadth(const MathSize ws) const override
Length to Breadth ratio [ST-X-3 eq 79].
Definition FBP45.h:1363
MathSize survivalProbability(const wx::FwiWeather &wx) const noexcept override
Survival probability calculated using probability of ony survival based on multiple formulae.
Definition FBP45.h:1417
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:1331
MathSize criticalSurfaceIntensity(const SpreadInfo &spread) const override
Critical Surface Fire Intensity (CSI) [ST-X-3 eq 56].
Definition FBP45.h:1387
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:1343
MathSize buiEffect(MathSize bui) const override
BUI Effect on surface fire rate of spread [ST-X-3 eq 54].
Definition FBP45.h:1287
MathSize cbh() const override
Crown base height (m) [ST-X-3 table 8].
Definition FBP45.h:1303
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:672
constexpr FuelC1(const FuelCodeSize &code) noexcept
FBP fuel type C-1.
Definition FBP45.h:684
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:704
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:716
FBP fuel type C-3.
Definition FBP45.h:735
constexpr FuelC3(const FuelCodeSize &code) noexcept
FBP fuel type C-3.
Definition FBP45.h:747
FBP fuel type C-4.
Definition FBP45.h:760
constexpr FuelC4(const FuelCodeSize &code) noexcept
FBP fuel type C-4.
Definition FBP45.h:772
FBP fuel type C-5.
Definition FBP45.h:784
constexpr FuelC5(const FuelCodeSize &code) noexcept
FBP fuel type C-5.
Definition FBP45.h:796
FBP fuel type C-6.
Definition FBP45.h:808
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:820
FBP fuel type C-7.
Definition FBP45.h:845
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:857
FBP fuel type D-1/D-2.
Definition FBP45.h:1454
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:1468
FBP fuel type D-1.
Definition FBP45.h:282
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:294
MathSize surfaceFuelConsumption(const SpreadInfo &spread) const noexcept override
Surface Fuel Consumption (SFC) (kg/m^2) [ST-X-3 eq 25].
Definition FBP45.h:307
FBP fuel type D-2.
Definition FBP45.h:876
constexpr FuelD2(const FuelCodeSize &code) noexcept
FBP fuel type D-2.
Definition FBP45.h:889
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:1481
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:1497
FBP fuel type M-1.
Definition FBP45.h:921
constexpr FuelM1(const FuelCodeSize &code, const char *name)
FBP fuel type M-1.
Definition FBP45.h:934
FBP fuel type M-2.
Definition FBP45.h:945
constexpr FuelM2(const FuelCodeSize &code, const char *name)
FBP fuel type M-2.
Definition FBP45.h:958
FBP fuel type M-3/M-4.
Definition FBP45.h:1511
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:1526
FBP fuel type M-3.
Definition FBP45.h:969
constexpr FuelM3(const FuelCodeSize &code, const char *name)
FBP fuel type M-3.
Definition FBP45.h:982
FBP fuel type M-4.
Definition FBP45.h:995
constexpr FuelM4(const FuelCodeSize &code, const char *name)
FBP fuel type M-4.
Definition FBP45.h:1008
FBP fuel type O-1a.
Definition FBP45.h:1019
constexpr FuelO1A(const FuelCodeSize &code) noexcept
FBP fuel type O-1a.
Definition FBP45.h:1031
FBP fuel type O-1b.
Definition FBP45.h:1040
constexpr FuelO1B(const FuelCodeSize &code) noexcept
FBP fuel type O-1b.
Definition FBP45.h:1052
FBP fuel type O-1.
Definition FBP45.h:1538
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:1553
FBP fuel type S-1.
Definition FBP45.h:1151
constexpr FuelS1(const FuelCodeSize &code) noexcept
FBP fuel type S-1.
Definition FBP45.h:1163
FBP fuel type S-2.
Definition FBP45.h:1176
constexpr FuelS2(const FuelCodeSize &code) noexcept
FBP fuel type S-2.
Definition FBP45.h:1188
FBP fuel type S-3.
Definition FBP45.h:1201
constexpr FuelS3(const FuelCodeSize &code) noexcept
FBP fuel type S-3.
Definition FBP45.h:1213
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