Skip to content

Commit

Permalink
Merge pull request #62 from WaterDesk/xuxi/fix-TankMixModel-init
Browse files Browse the repository at this point in the history
fix - the last volume segment should be initialized as the first volume segment during intializing a tank's mixing model
  • Loading branch information
LRossman authored Dec 31, 2022
2 parents 242a8c1 + 59f775a commit 186744e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Models/tankmixmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ void TankMixModel::init(Tank* tank, SegPool* segPool, double _cTol)
vMixed = fracMixed * tank->maxVolume;

// ... create a volume segment for the entire tank
lastSeg = nullptr;
firstSeg = segPool->getSegment(tank->volume, cTank);
if ( firstSeg == nullptr )
throw SystemError(SystemError::OUT_OF_MEMORY);
lastSeg = firstSeg;

// ... create a second segment for the 2-compartment model
if ( type == MIX2 )
Expand Down

0 comments on commit 186744e

Please sign in to comment.