diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C index f60a01f326..2058dde5ea 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C @@ -96,6 +96,10 @@ Foam::KinematicCloud::KinematicCloud constProps_(particleProperties_), parcelTypeId_(readLabel(particleProperties_.lookup("parcelTypeId"))), coupled_(particleProperties_.lookup("coupled")), + cellValueSourceCorrection_ + ( + particleProperties_.lookup("cellValueSourceCorrection") + ), rndGen_(label(0)), rho_(rho), U_(U), diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H index 50280469e2..0a27aede96 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H @@ -105,7 +105,11 @@ class KinematicCloud //- Flag to indicate whether parcels are coupled to the carrier phase // i.e. whether or not to generate source terms for carrier phase - Switch coupled_; + const Switch coupled_; + + //- Flag to correct cell values with latest transfer information + // during the lagrangian timestep + const Switch cellValueSourceCorrection_; //- Random number generator - used by some injection routines Random rndGen_; @@ -224,6 +228,9 @@ public: //- Return coupled flag inline const Switch coupled() const; + //- Return cell value correction flag + inline const Switch cellValueSourceCorrection() const; + //- Return refernce to the random object inline Random& rndGen(); diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H index 8c44470c44..b02b0f0d8f 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H @@ -72,6 +72,14 @@ inline const Foam::Switch Foam::KinematicCloud::coupled() const } +template +inline const Foam::Switch +Foam::KinematicCloud::cellValueSourceCorrection() const +{ + return cellValueSourceCorrection_; +} + + template inline const Foam::volScalarField& Foam::KinematicCloud::rho() const diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C index 62c926f1ea..91d7a2fb7f 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C @@ -102,11 +102,25 @@ Foam::ThermoCloud::ThermoCloud ) ), radiation_(this->particleProperties().lookup("radiation")), - hTrans_ + hsTrans_ ( IOobject ( - this->name() + "hTrans", + this->name() + "hsTrans", + this->db().time().timeName(), + this->db(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + this->mesh(), + dimensionedScalar("zero", dimensionSet(1, 2, -2, 0, 0), 0.0) + ), + hcTrans_ + ( + IOobject + ( + this->name() + "hcTrans", this->db().time().timeName(), this->db(), IOobject::NO_READ, @@ -132,7 +146,8 @@ template void Foam::ThermoCloud::resetSourceTerms() { KinematicCloud::resetSourceTerms(); - hTrans_.field() = 0.0; + hsTrans_.field() = 0.0; + hcTrans_.field() = 0.0; } diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H index 7cdc7b1263..2e3aea4f23 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H @@ -99,8 +99,14 @@ class ThermoCloud // Sources - //- Enthalpy transfer - DimensionedField hTrans_; + //- Sensible enthalpy transfer + DimensionedField hsTrans_; + + //- Chemical enthalpy transfer + // - If solving for total enthalpy, the carrier phase enthalpy will + // receive the full enthalpy of reaction via creation of reaction + // products + DimensionedField hcTrans_; // Private Member Functions @@ -173,10 +179,19 @@ public: // Enthalpy - //- Return reference to enthalpy source - inline DimensionedField& hTrans(); + //- Return reference to sensible enthalpy source + inline DimensionedField& hsTrans(); - //- return tmp enthalpy source term - fully explicit + //- Return tmp total sensible enthalpy source term + inline tmp > Shs() const; + + //- Return reference to chemical enthalpy source + inline DimensionedField& hcTrans(); + + //- Return tmp chemical enthalpy source term + inline tmp > Shc() const; + + //- Return tmp total enthalpy source term inline tmp > Sh() const; diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H index d85d043ec5..ee38bfd453 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H @@ -77,9 +77,85 @@ inline bool Foam::ThermoCloud::radiation() const template inline Foam::DimensionedField& -Foam::ThermoCloud::hTrans() +Foam::ThermoCloud::hsTrans() { - return hTrans_; + return hsTrans_; +} + + +template +inline Foam::tmp > +Foam::ThermoCloud::Shs() const +{ + tmp > tShs + ( + new DimensionedField + ( + IOobject + ( + this->name() + "Shs", + this->db().time().timeName(), + this->mesh(), + IOobject::NO_READ, + IOobject::AUTO_WRITE, + false + ), + this->mesh(), + dimensionedScalar + ( + "zero", + dimMass/dimLength/pow3(dimTime), + 0.0 + ) + ) + ); + + scalarField& Shs = tShs().field(); + Shs = hsTrans_/(this->mesh().V()*this->db().time().deltaT()); + + return tShs; +} + + +template +inline Foam::DimensionedField& +Foam::ThermoCloud::hcTrans() +{ + return hcTrans_; +} + + +template +inline Foam::tmp > +Foam::ThermoCloud::Shc() const +{ + tmp > tShc + ( + new DimensionedField + ( + IOobject + ( + this->name() + "Shc", + this->db().time().timeName(), + this->mesh(), + IOobject::NO_READ, + IOobject::AUTO_WRITE, + false + ), + this->mesh(), + dimensionedScalar + ( + "zero", + dimMass/dimLength/pow3(dimTime), + 0.0 + ) + ) + ); + + scalarField& Shc = tShc().field(); + Shc = hcTrans_/(this->mesh().V()*this->db().time().deltaT()); + + return tShc; } @@ -111,7 +187,7 @@ Foam::ThermoCloud::Sh() const ); scalarField& Sh = tSh().field(); - Sh = hTrans_/(this->mesh().V()*this->db().time().deltaT()); + Sh = (hsTrans_ + hcTrans_)/(this->mesh().V()*this->db().time().deltaT()); return tSh; } diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C index 69cc25869e..cdc7e5e3b0 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C @@ -31,7 +31,7 @@ License template template -void Foam::KinematicParcel::updateCellQuantities +void Foam::KinematicParcel::setCellValues ( TrackData& td, const scalar dt, @@ -43,7 +43,7 @@ void Foam::KinematicParcel::updateCellQuantities { WarningIn ( - "void Foam::KinematicParcel::updateCellQuantities" + "void Foam::KinematicParcel::setCellValues" "(" "TrackData&, " "const scalar, " @@ -57,9 +57,6 @@ void Foam::KinematicParcel::updateCellQuantities Uc_ = td.UInterp().interpolate(this->position(), cellI); - // Apply correction to cell velocity to account for momentum transfer - Uc_ += td.cloud().UTrans()[cellI]/(massCell(cellI)); - muc_ = td.muInterp().interpolate(this->position(), cellI); // Apply dispersion components to carrier phase velocity @@ -75,6 +72,19 @@ void Foam::KinematicParcel::updateCellQuantities } +template +template +void Foam::KinematicParcel::cellValueSourceCorrection +( + TrackData& td, + const scalar dt, + const label cellI +) +{ + Uc_ += td.cloud().UTrans()[cellI]/massCell(cellI); +} + + template template void Foam::KinematicParcel::calc @@ -183,8 +193,8 @@ bool Foam::KinematicParcel::move(TrackData& td) // Set the Lagrangian time-step scalar dt = min(dtMax, tEnd); - // Remember which cell the Parcel is in - // since this will change if a face is hit + // Remember which cell the Parcel is in since this will change if a + // face is hit label cellI = p.cell(); dt *= p.trackToFace(p.position() + dt*U_, td); @@ -192,12 +202,17 @@ bool Foam::KinematicParcel::move(TrackData& td) tEnd -= dt; p.stepFraction() = 1.0 - tEnd/deltaT; - // Update cell based properties - p.updateCellQuantities(td, dt, cellI); - // Avoid problems with extremely small timesteps if (dt > ROOTVSMALL) { + // Update cell based properties + p.setCellValues(td, dt, cellI); + + if (td.cloud().cellValueSourceCorrection()) + { + p.cellValueSourceCorrection(td, dt, cellI); + } + p.calc(td, dt, cellI); } diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H index 7a57dd5fb0..82d7c2ccd9 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H @@ -372,9 +372,18 @@ public: // Main calculation loop - //- Update cell based quantities + //- Set cell values template - void updateCellQuantities + void setCellValues + ( + TrackData& td, + const scalar dt, + const label cellI + ); + + //- Correct cell values using latest transfer information + template + void cellValueSourceCorrection ( TrackData& td, const scalar dt, diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C index 3b576489c7..9948869799 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C @@ -129,14 +129,54 @@ Foam::scalar Foam::ReactingMultiphaseParcel::updateMassFractions template template -void Foam::ReactingMultiphaseParcel::updateCellQuantities +void Foam::ReactingMultiphaseParcel::setCellValues ( TrackData& td, const scalar dt, const label cellI ) { - ReactingParcel::updateCellQuantities(td, dt, cellI); + ReactingParcel::setCellValues(td, dt, cellI); +} + + +template +template +void Foam::ReactingMultiphaseParcel::cellValueSourceCorrection +( + TrackData& td, + const scalar dt, + const label cellI +) +{ + scalar massCell = this->massCell(cellI); + + scalar addedMass = 0.0; + forAll(td.cloud().rhoTrans(), i) + { + addedMass += td.cloud().rhoTrans(i)[cellI]; + } + + this->rhoc_ += addedMass/td.cloud().pMesh().cellVolumes()[cellI]; + + scalar massCellNew = massCell + addedMass; + this->Uc_ += td.cloud().UTrans()[cellI]/massCellNew; + + scalar cpEff = 0; + forAll(td.cloud().rhoTrans(), i) + { + scalar Y = td.cloud().rhoTrans(i)[cellI]/addedMass; + cpEff += Y*td.cloud().gases()[i].Cp(this->Tc_); + } + + const scalar cpc = td.cpInterp().psi()[cellI]; + this->cpc_ = (massCell*cpc + addedMass*cpEff)/massCellNew; + + const scalar fCarrier = -1.0/td.constProps().hRetentionCoeff(); + const scalar dh = + td.cloud().hsTrans()[cellI] + fCarrier*td.cloud().hcTrans[cellI]; + + this->Tc_ += dh/(this->cpc_*massCellNew); } @@ -229,7 +269,7 @@ void Foam::ReactingMultiphaseParcel::calc scalarField dMassSRCarrier(td.cloud().gases().size(), 0.0); // Return enthalpy source and calc mass transfer(s) due to surface reaction - scalar HReaction = + scalar hReaction = calcSurfaceReactions ( td, @@ -250,11 +290,8 @@ void Foam::ReactingMultiphaseParcel::calc dMassSRCarrier ); - // Heat of reaction split between component retained by particle - const scalar ShSR = td.constProps().hRetentionCoeff()*HReaction; - - // ...and component added to the carrier phase - const scalar ShSRc = (1.0 - td.constProps().hRetentionCoeff())*HReaction; + // Heat of reaction retained by particle + const scalar ShSR = td.constProps().hRetentionCoeff()*hReaction; // Update component mass fractions @@ -310,12 +347,14 @@ void Foam::ReactingMultiphaseParcel::calc label id = td.cloud().composition().localToGlobalGasId(LIQ, i); td.cloud().rhoTrans(id)[cellI] += np0*dMassLiquid[i]; } -// // No mapping between solid components and carrier phase -// forAll(YSolid_, i) -// { -// label id = td.cloud().composition().localToGlobalGasId(SLD, i); -// td.cloud().rhoTrans(id)[cellI] += np0*dMassSolid[i]; -// } +/* + // No mapping between solid components and carrier phase + forAll(YSolid_, i) + { + label id = td.cloud().composition().localToGlobalGasId(SLD, i); + td.cloud().rhoTrans(id)[cellI] += np0*dMassSolid[i]; + } +*/ forAll(dMassSRCarrier, i) { td.cloud().rhoTrans(i)[cellI] += np0*dMassSRCarrier[i]; @@ -324,8 +363,11 @@ void Foam::ReactingMultiphaseParcel::calc // Update momentum transfer td.cloud().UTrans()[cellI] += np0*(mass0*U0 - mass1*U1); - // Update enthalpy transfer - td.cloud().hTrans()[cellI] += np0*(mass0*H0 - (mass1*H1 + ShSRc)); + // Update sensible enthalpy transfer + td.cloud().hsTrans()[cellI] += np0*(mass0*H0 - mass1*H1); + + // Update chemical enthalpy transfer + td.cloud().hcTrans()[cellI] -= np0*ShSR; } @@ -346,21 +388,20 @@ void Foam::ReactingMultiphaseParcel::calc } forAll(YLiquid_, i) { - label id = - td.cloud().composition().localToGlobalGasId(LIQ, i); + label id = td.cloud().composition().localToGlobalGasId(LIQ, i); td.cloud().rhoTrans(id)[cellI] += np0*mass1*YMix[LIQ]*YLiquid_[i]; } -// // No mapping between solid components and carrier phase -// forAll(YSolid_, i) -// { -// label id = -// td.cloud().composition().localToGlobalGasId(SLD, i); -// td.cloud().rhoTrans(id)[cellI] += -// np0*mass1*YMix[SLD]*YSolid_[i]; -// } - - td.cloud().hTrans()[cellI] += np0*mass1*H1; +/* + // No mapping between solid components and carrier phase + forAll(YSolid_, i) + { + label id = td.cloud().composition().localToGlobalGasId(SLD, i); + td.cloud().rhoTrans(id)[cellI] += + np0*mass1*YMix[SLD]*YSolid_[i]; + } +*/ + td.cloud().hsTrans()[cellI] += np0*mass1*H1; td.cloud().UTrans()[cellI] += np0*mass1*U1; } } @@ -466,7 +507,7 @@ Foam::scalar Foam::ReactingMultiphaseParcel::calcSurfaceReactions } // Update surface reactions - const scalar HReaction = td.cloud().surfaceReaction().calculate + const scalar hReaction = td.cloud().surfaceReaction().calculate ( dt, cellI, @@ -493,7 +534,7 @@ Foam::scalar Foam::ReactingMultiphaseParcel::calcSurfaceReactions *(sum(dMassSRGas) + sum(dMassSRLiquid) + sum(dMassSRSolid)) ); - return HReaction; + return hReaction; } @@ -502,4 +543,3 @@ Foam::scalar Foam::ReactingMultiphaseParcel::calcSurfaceReactions #include "ReactingMultiphaseParcelIO.C" // ************************************************************************* // - diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H index b5f45310cd..9bf8a5294d 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H @@ -333,9 +333,18 @@ public: // Main calculation loop - //- Update cell based quantities + //- Set cell values template - void updateCellQuantities + void setCellValues + ( + TrackData& td, + const scalar dt, + const label cellI + ); + + //- Correct cell values using latest transfer information + template + void cellValueSourceCorrection ( TrackData& td, const scalar dt, @@ -393,4 +402,3 @@ public: #endif // ************************************************************************* // - diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index cb7e83c267..e1e232f249 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -30,21 +30,21 @@ License template template -void Foam::ReactingParcel::updateCellQuantities +void Foam::ReactingParcel::setCellValues ( TrackData& td, const scalar dt, const label cellI ) { - ThermoParcel::updateCellQuantities(td, dt, cellI); + ThermoParcel::setCellValues(td, dt, cellI); pc_ = td.pInterp().interpolate(this->position(), cellI); if (pc_ < td.constProps().pMin()) { WarningIn ( - "void Foam::ReactingParcel::updateCellQuantities" + "void Foam::ReactingParcel::setCellValues" "(" "TrackData&, " "const scalar, " @@ -55,14 +55,42 @@ void Foam::ReactingParcel::updateCellQuantities pc_ = td.constProps().pMin(); } +} + + +template +template +void Foam::ReactingParcel::cellValueSourceCorrection +( + TrackData& td, + const scalar dt, + const label cellI +) +{ + scalar massCell = this->massCell(cellI); - // Apply correction to cell density to account for mass transfer scalar addedMass = 0.0; forAll(td.cloud().rhoTrans(), i) { addedMass += td.cloud().rhoTrans(i)[cellI]; } + this->rhoc_ += addedMass/td.cloud().pMesh().cellVolumes()[cellI]; + + scalar massCellNew = massCell + addedMass; + this->Uc_ += td.cloud().UTrans()[cellI]/massCellNew; + + scalar cpEff = 0; + forAll(td.cloud().rhoTrans(), i) + { + scalar Y = td.cloud().rhoTrans(i)[cellI]/addedMass; + cpEff += Y*td.cloud().gases()[i].Cp(this->Tc_); + } + + const scalar cpc = td.cpInterp().psi()[cellI]; + this->cpc_ = (massCell*cpc + addedMass*cpEff)/massCellNew; + + this->Tc_ += td.cloud().hsTrans()[cellI]/(this->cpc_*massCellNew); } @@ -164,8 +192,8 @@ void Foam::ReactingParcel::calc // Update momentum transfer td.cloud().UTrans()[cellI] += np0*(mass0*U0 - mass1*U1); - // Update enthalpy transfer - td.cloud().hTrans()[cellI] += np0*(mass0*H0 - mass1*H1); + // Update sensible enthalpy transfer + td.cloud().hsTrans()[cellI] += np0*(mass0*H0 - mass1*H1); } @@ -184,7 +212,7 @@ void Foam::ReactingParcel::calc td.cloud().rhoTrans(id)[cellI] += np0*mass1*Y_[i]; } td.cloud().UTrans()[cellI] += np0*mass1*U1; - td.cloud().hTrans()[cellI] += np0*mass1*H1; + td.cloud().hsTrans()[cellI] += np0*mass1*H1; } } diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H index f7b85d22c2..59e22d7d06 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H @@ -276,9 +276,18 @@ public: // Main calculation loop - //- Update cell based quantities + //- Set cell values template - void updateCellQuantities + void setCellValues + ( + TrackData& td, + const scalar dt, + const label cellI + ); + + //- Correct cell values using latest transfer information + template + void cellValueSourceCorrection ( TrackData& td, const scalar dt, @@ -333,4 +342,3 @@ public: #endif // ************************************************************************* // - diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C index 4d4d469d12..6a476110dd 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C @@ -30,28 +30,24 @@ License template template -void Foam::ThermoParcel::updateCellQuantities +void Foam::ThermoParcel::setCellValues ( TrackData& td, const scalar dt, const label cellI ) { - KinematicParcel::updateCellQuantities(td, dt, cellI); + KinematicParcel::setCellValues(td, dt, cellI); cpc_ = td.cpInterp().interpolate(this->position(), cellI); Tc_ = td.TInterp().interpolate(this->position(), cellI); - // Apply correction to cell temperature to account for enthalpy transfer - scalar cpMean = td.cpInterp().psi()[cellI]; - Tc_ += td.cloud().hTrans()[cellI]/(cpMean*this->massCell(cellI)); - if (Tc_ < td.constProps().TMin()) { WarningIn ( - "void Foam::ThermoParcel::updateCellQuantities" + "void Foam::ThermoParcel::setCellValues" "(" "TrackData&, " "const scalar, " @@ -65,6 +61,22 @@ void Foam::ThermoParcel::updateCellQuantities } +template +template +void Foam::ThermoParcel::cellValueSourceCorrection +( + TrackData& td, + const scalar dt, + const label cellI +) +{ + this->Uc_ += td.cloud().UTrans()[cellI]/this->massCell(cellI); + + scalar cpMean = td.cpInterp().psi()[cellI]; + Tc_ += td.cloud().hsTrans()[cellI]/(cpMean*this->massCell(cellI)); +} + + template template void Foam::ThermoParcel::calc @@ -118,8 +130,8 @@ void Foam::ThermoParcel::calc // Update momentum transfer td.cloud().UTrans()[cellI] += np0*mass0*(U0 - U1); - // Update enthalpy transfer - td.cloud().hTrans()[cellI] += np0*mass0*(H0 - H1); + // Update sensible enthalpy transfer + td.cloud().hsTrans()[cellI] += np0*mass0*(H0 - H1); } // Set new particle properties @@ -198,4 +210,3 @@ Foam::scalar Foam::ThermoParcel::calcHeatTransfer #include "ThermoParcelIO.C" // ************************************************************************* // - diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H index aa2020aa10..1927ca3de6 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H @@ -286,9 +286,18 @@ public: // Main calculation loop - //- Update cell based quantities + //- Set cell values template - void updateCellQuantities + void setCellValues + ( + TrackData& td, + const scalar dt, + const label cellI + ); + + //- Correct cell values using latest transfer information + template + void cellValueSourceCorrection ( TrackData& td, const scalar dt, @@ -343,4 +352,3 @@ public: #endif // ************************************************************************* // -