Skip to content

Commit

Permalink
Merge pull request #44 from firelab/kc-BHP1-1150-update-doCrownRunRot…
Browse files Browse the repository at this point in the history
…hermel

[BHP1-1150] Remove setWindAdjustmentFactorCalculationMethod in Crown::doCrownRunRothermel()
  • Loading branch information
rjsheperd authored Jan 11, 2025
2 parents ef4424a + be8f62e commit dc3a05f
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/behave/crown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,14 @@ void Crown::doCrownRunRothermel()
double canopyHeight = surfaceFuel_.getCanopyHeight(LengthUnits::Feet);
double canopyBaseHeight = crownInputs_.getCanopyBaseHeight(LengthUnits::Feet);
double crownRatio = 0;
if(canopyHeight > 0)
{
if (canopyHeight > 0) {
crownRatio = (canopyHeight - canopyBaseHeight) / canopyHeight;
}

surfaceFuel_.setCrownRatio(crownRatio, FractionUnits::Fraction);

// Step 1: Do surface run and store values needed for further calculations
surfaceFuel_.setWindAdjustmentFactorCalculationMethod(WindAdjustmentFactorCalculationMethod::UseCrownRatio);
if (surfaceFuel_.getWindAdjustmentFactorCalculationMethod() == WindAdjustmentFactorCalculationMethod::UseCrownRatio) {
surfaceFuel_.setCrownRatio(crownRatio, FractionUnits::Fraction);
}
surfaceFuel_.doSurfaceRunInDirectionOfMaxSpread(); // Crown ROS output given in direction of max spread
surfaceFireHeatPerUnitArea_ = surfaceFuel_.getHeatPerUnitArea(HeatPerUnitAreaUnits::BtusPerSquareFoot);
surfaceFirelineIntensity_ = surfaceFuel_.getFirelineIntensity(FirelineIntensityUnits::BtusPerFootPerSecond);
Expand Down Expand Up @@ -172,11 +171,15 @@ void Crown::doCrownRunScottAndReinhardt()
// Scott and Reinhardt (2001) linked models method for crown fire
double canopyHeight = surfaceFuel_.getCanopyHeight(LengthUnits::Feet);
double canopyBaseHeight = crownInputs_.getCanopyBaseHeight(LengthUnits::Feet);
double crownRatio = (canopyHeight - canopyBaseHeight) / canopyHeight;

surfaceFuel_.setCrownRatio(crownRatio, FractionUnits::Fraction);
double crownRatio = 0;
if (canopyHeight > 0) {
crownRatio = (canopyHeight - canopyBaseHeight) / canopyHeight;
}

// Step 1: Do surface run and store values needed for further calculations
if (surfaceFuel_.getWindAdjustmentFactorCalculationMethod() == WindAdjustmentFactorCalculationMethod::UseCrownRatio) {
surfaceFuel_.setCrownRatio(crownRatio, FractionUnits::Fraction);
}
const double windSpeed = surfaceFuel_.getWindSpeed(SpeedUnits::FeetPerMinute, WindHeightInputMode::TwentyFoot);
surfaceFuel_.setWindSpeed(windSpeed, SpeedUnits::FeetPerMinute, WindHeightInputMode::TwentyFoot);
surfaceFuel_.doSurfaceRunInDirectionOfMaxSpread();
Expand Down

0 comments on commit dc3a05f

Please sign in to comment.