From e646218af929db8d8b0c8e27cdd48c92a7ab25b5 Mon Sep 17 00:00:00 2001 From: Sergio Ferraris <s.ferraris@opencfd.co.uk> Date: Fri, 11 Dec 2020 11:50:01 +0000 Subject: [PATCH] BUG: Fixing reading of volumeUpdateMethod Signed-off-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com> --- .../ReactingParcel/ReactingParcelI.H | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H index a3b6e46c772..59ebad3c2b4 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H @@ -61,20 +61,27 @@ inline Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties ParcelType::constantProperties(parentDict), pMin_(this->dict_, "pMin", 1000.0), constantVolume_(this->dict_, "constantVolume", false), - volUpdateType_ - ( - this->dict_, - "volumeUpdateMethod", - volumeUpdateType::mConstRho - ) + volUpdateType_(this->dict_, "volumeUpdateMethod") { // If constantVolume found use it if (this->dict_.found("constantVolume")) { volUpdateType_.setValue(mUndefined); } - else if (this->dict_.found("volumeUpdateMethod")) + else { + if (!this->dict_.found("volumeUpdateMethod")) + { + FatalErrorInFunction + << "Either 'constantVolume' or 'volumeUpdateMethod' " << nl + << " must be provided. " << nl + << " The new keyword is 'volumeUpdateMethod'. " << nl + << " Available methods are : " << nl + << " constantRho, constantVolume or updateRhoAndVol. " << nl + << " 'constantVolume' is either true/false " << nl + << nl << exit(FatalError); + } + const word volumeUpdateMethod ( this->dict_.getWord("volumeUpdateMethod") -- GitLab