diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index 6729cab4c2e9932765ee6bc60bcd9034cd19b160..524b4d00d5d103820851e8ee993c1185fa329935 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -344,7 +344,7 @@ void Foam::ReactingParcel<ParcelType>::calc td.cloud().hcTrans()[cellI] += np0 *dMassPC[i] - *td.cloud().mcCarrierThermo().speciesData()[gid].H(T0); + *td.cloud().mcCarrierThermo().speciesData()[gid].Hc(); } // Update momentum transfer @@ -423,6 +423,11 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange scalarField& Cs ) { + typedef PhaseChangeModel + < + typename ReactingParcel<ParcelType>::trackData::cloudType + > phaseChangeModelType; + if ( !td.cloud().phaseChange().active() @@ -464,17 +469,26 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange td.cloud().composition().localToGlobalCarrierId(idPhase, i); const label idl = td.cloud().composition().globalIds(idPhase)[i]; - const scalar hv = td.cloud().mcCarrierThermo().speciesData()[idc].H(Ts); - const scalar hl = - td.cloud().composition().liquids().properties()[idl].h(pc_, Ts); + if + ( + td.cloud().phaseChange().enthalpyTransfer() + == phaseChangeModelType::etLatentHeat + ) + { + scalar hlp = + td.cloud().composition().liquids().properties()[idl].hl(pc_, T); - // Enthalphy transfer to carrier phase - method 1 using enthalpy diff - Sh += dMassPC[i]*(hl - hv)/dt; + Sh -= dMassPC[i]*hlp/dt; + } + else + { + // Note: enthalpies of both phases must use the same reference + scalar hc = td.cloud().mcCarrierThermo().speciesData()[idc].H(T); + scalar hp = + td.cloud().composition().liquids().properties()[idl].h(pc_, T); - // Enthalphy transfer to carrier phase - method 2 using latent heat -// const scalar hl = -// td.cloud().composition().liquids().properties()[idl].hl(pc_, Ts); -// Sh -= dMassPC[i]*hl/dt; + Sh -= dMassPC[i]*(hc - hp)/dt; + } // Update particle surface thermo properties const scalar Dab = diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H index 8219ec2ac7b8f49495c081074cc1e50cb94730da..41d7c6d30c224fe87011cee76cadb0a583d99eac 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H @@ -136,6 +136,9 @@ public: public: + typedef ReactingCloud<ParcelType> cloudType; + + // Constructors //- Construct from components diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.C index c60f1bf903871b32a9a6602f56e0267334c0ae5d..c88e07ae19622177aacd6dcb2ec3c083cf29f0d4 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.C @@ -26,6 +26,48 @@ License #include "PhaseChangeModel.H" +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +template<class CloudType> +const Foam::wordList Foam::PhaseChangeModel<CloudType>:: +enthalpyTransferTypeNames +( + IStringStream + ( + "(" + "latentHeat " + "enthalpyDifference" + ")" + )() +); + + +// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // + +template<class CloudType> +typename Foam::PhaseChangeModel<CloudType>::enthalpyTransferType +Foam::PhaseChangeModel<CloudType>::wordToEnthalpyTransfer(const word& etName) +const +{ + forAll(enthalpyTransferTypeNames, i) + { + if (etName == enthalpyTransferTypeNames[i]) + { + return enthalpyTransferType(i); + } + } + + FatalErrorIn + ( + "PhaseChangeModel<CloudType>::enthalpyTransferType" + "PhaseChangeModel<CloudType>::wordToEnthalpyTransfer(const word&) const" + ) << "Unknown enthalpyType " << etName << ". Valid selections are:" << nl + << enthalpyTransferTypeNames << exit(FatalError); + + return enthalpyTransferType(0); +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class CloudType> @@ -36,7 +78,8 @@ Foam::PhaseChangeModel<CloudType>::PhaseChangeModel : dict_(dictionary::null), owner_(owner), - coeffDict_(dictionary::null) + coeffDict_(dictionary::null), + enthalpyTransfer_(etLatentHeat) {} @@ -50,7 +93,11 @@ Foam::PhaseChangeModel<CloudType>::PhaseChangeModel : dict_(dict), owner_(owner), - coeffDict_(dict.subDict(type + "Coeffs")) + coeffDict_(dict.subDict(type + "Coeffs")), + enthalpyTransfer_ + ( + wordToEnthalpyTransfer(coeffDict_.lookup("enthalpyTransfer")) + ) {} @@ -83,6 +130,14 @@ const Foam::dictionary& Foam::PhaseChangeModel<CloudType>::coeffDict() const } +template<class CloudType> +const typename Foam::PhaseChangeModel<CloudType>::enthalpyTransferType& +Foam::PhaseChangeModel<CloudType>::enthalpyTransfer() const +{ + return enthalpyTransfer_; +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "NewPhaseChangeModel.C" diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H index e19856a0648c83c7cf70386ad7e3c60f0fd01f4d..27b92e2539119525271223a6dcb5e9ee6f33869d 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H @@ -53,6 +53,21 @@ namespace Foam template<class CloudType> class PhaseChangeModel { +public: + + // Public enumerations + + //- Enthalpy transfer type + enum enthalpyTransferType + { + etLatentHeat, + etEnthalpyDifference + }; + + //- Name representations of enthalpy transfer types + static const Foam::wordList enthalpyTransferTypeNames; + + protected: // Protected data @@ -66,9 +81,15 @@ protected: //- The coefficient dictionary const dictionary coeffDict_; + //- Enthalpy transfer type enumeration + enthalpyTransferType enthalpyTransfer_; + // Protected member functions + //- Convert word to enthalpy transfer type + enthalpyTransferType wordToEnthalpyTransfer(const word& etName) const; + //- Sherwood number scalar Sh() const; @@ -129,6 +150,9 @@ public: //- Return the coefficient dictionary const dictionary& coeffDict() const; + //- Return the enthalpy transfer type enumeration + const enthalpyTransferType& enthalpyTransfer() const; + // Member Functions