From 59f775af8ba6233ea686897c11896c141cdb9b2b Mon Sep 17 00:00:00 2001 From: xuxi Date: Mon, 12 Dec 2022 09:37:44 +0800 Subject: [PATCH] fix - the last volume segment should be initialized as the first volume segment during intializing a tank's mixing model --- src/Models/tankmixmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/tankmixmodel.cpp b/src/Models/tankmixmodel.cpp index dfd28c1..f873dd6 100644 --- a/src/Models/tankmixmodel.cpp +++ b/src/Models/tankmixmodel.cpp @@ -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 )