Skip to content

fix(fuelModels): correct isDynamic for static standard fuel models#66

Open
jimmynotjim wants to merge 1 commit into
firelab:masterfrom
jimmynotjim:bugfix/65-hardcoded-dynnamic-values
Open

fix(fuelModels): correct isDynamic for static standard fuel models#66
jimmynotjim wants to merge 1 commit into
firelab:masterfrom
jimmynotjim:bugfix/65-hardcoded-dynnamic-values

Conversation

@jimmynotjim

@jimmynotjim jimmynotjim commented Jun 16, 2026

Copy link
Copy Markdown

Disclosure: I typically work in JS/TS rather than C++ so I'm not personally familiar with the workings of this library. I utilized Claude Code to discover and assist in writing, running, and confirming these fixes. I know a lot of OSS repos are receiving a lot of AI Slop these days, but I tried to be discriminating in my use here to just this issue and to confirm the bug and the fix via tests.

Purpose

FuelModels::populateFuelModels() in src/behave/fuelModels.cpp passed isDynamic = true to setFuelModelRecord(...) for every standard Scott & Burgan (2005) model (101–204), regardless of whether the model is actually dynamic. This PR flips isDynamic to false for the 23 static models that have no transferable live herbaceous load, and adds a unit test that locks in the correct behavior.

The 23 corrected records: SH2–SH8 (142–148), TU2/TU4/TU5 (162, 164, 165), TL1–TL9 (181–189), SB1–SB4 (201–204). The genuinely dynamic models (GR1–9, GS1–4, SH1, SH9, TU1, TU3) were already correct and are unchanged.

Impact

The values are utilized as metadata only. isDynamic only does work when there's live herbaceous load to transfer; since all 23 records have fuelLoadLiveHerbaceous = 0, the load-transfer step was already a no-op for them. Fire-behavior outputs (rate of spread, flame length, etc.) are unaffected. The defect was purely in the reported getIsDynamic() attribute, which is why it went unnoticed. It only happened to surface downstream where the flag is read as metadata.

Related Issues

Closes #65

Submission Checklist

  • Code compiles are passing (make compile)
  • Tests are passing (make test)

Testing

Adds testFuelModelDynamicFlags() to src/testBehave/testBehave.cpp, asserting the invariant for the 40 standard models:

getIsDynamic(n) == (getFuelLoadLiveHerbaceous(n) > 0)

The extended SCAL/V-/M-/F- models are deliberately excluded — their static/dynamic designation doesn't follow this rule.

  • Before the fix: the new test fails for exactly the 23 static models → 188 passed / 23 failed.
  • After the fix: full suite 211 passed / 0 failed. No existing test regressed.

populateFuelModels() hardcoded isDynamic=true for the entire 101-204
Scott & Burgan block, including the 23 models with no live herbaceous
load (SH2-8, TU2/4/5, TL1-9, SB1-4). Updated those to false and added a
test asserting isDynamic == (fuelLoadLiveHerbaceous > 0) across the
standard set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

All 40 standard Scott & Burgan fuel models are hardcoded isDynamic = true, including the 23 static ones

1 participant