diff --git a/src/fvModels/general/semiImplicitSource/semiImplicitSource.C b/src/fvModels/general/semiImplicitSource/semiImplicitSource.C index d764c7d336..263e50e377 100644 --- a/src/fvModels/general/semiImplicitSource/semiImplicitSource.C +++ b/src/fvModels/general/semiImplicitSource/semiImplicitSource.C @@ -160,7 +160,7 @@ void Foam::fv::semiImplicitSource::addSupType UIndirectList(Sp, set_.cells()) = fieldSp_[fieldName]->value(t)/VDash; - eqn += Su + fvm::SuSp(Sp, psi); + eqn += Su - fvm::SuSp(-Sp, psi); } diff --git a/src/lagrangian/basic/Cloud/Cloud.C b/src/lagrangian/basic/Cloud/Cloud.C index f3a3f5fc17..28ca7f2fd5 100644 --- a/src/lagrangian/basic/Cloud/Cloud.C +++ b/src/lagrangian/basic/Cloud/Cloud.C @@ -418,6 +418,8 @@ void Foam::Cloud::move template void Foam::Cloud::topoChange(const polyTopoChangeMap& map) { + if (!map.mesh().topoChanged()) return; + // Ask for the tetBasePtIs to trigger all processors to build // them, otherwise, if some processors have no particles then // there is a comms mismatch. diff --git a/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloudI.H b/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloudI.H index 280c3dbcd1..538dd8df7b 100644 --- a/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloudI.H +++ b/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloudI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -118,7 +118,7 @@ inline Foam::tmp Foam::ReactingCloud::SYi sourceField.primitiveFieldRef() = rhoTrans_[i]/(this->db().time().deltaTValue()*this->mesh().V()); - const dimensionedScalar Yismall("Yismall", dimless, small); + const dimensionedScalar Yismall(dimless, small); return fvm::Sp(neg(sourceField)*sourceField/(Yi + Yismall), Yi) @@ -178,40 +178,48 @@ Foam::ReactingCloud::Srho(const volScalarField& rho) const { if (this->solution().coupled()) { - tmp trhoTrans - ( - volScalarField::New - ( - this->name() + ":rhoTrans", - this->mesh(), - dimensionedScalar(dimMass/dimTime/dimVolume, 0) - ) - ); - - scalarField& sourceField = trhoTrans.ref(); - if (this->solution().semiImplicit("rho")) { + tmp trhoTrans = + volScalarField::New + ( + this->name() + ":rhoTrans", + this->mesh(), + dimensionedScalar(dimMass/dimTime/dimVolume, 0) + ); + scalarField& sourceField = trhoTrans.ref(); forAll(rhoTrans_, i) { sourceField += rhoTrans_[i]; } sourceField /= this->db().time().deltaTValue()*this->mesh().V(); - return fvm::SuSp(trhoTrans()/rho, rho); + return + fvm::Sp(neg(trhoTrans())*trhoTrans()/rho, rho) + + pos0(trhoTrans())*trhoTrans(); } else { tmp tfvm(new fvScalarMatrix(rho, dimMass/dimTime)); fvScalarMatrix& fvm = tfvm.ref(); + tmp trhoTransV = + volScalarField::New + ( + this->name() + ":rhoTransV", + this->mesh(), + dimensionedScalar(dimMass/dimTime, 0) + ); + + scalarField& sourceField = trhoTransV.ref(); forAll(rhoTrans_, i) { sourceField += rhoTrans_[i]; } + sourceField /= this->db().time().deltaTValue(); - fvm.source() = -trhoTrans()/this->db().time().deltaT(); + fvm.source() = -trhoTransV(); return tfvm; }