diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H index 702f35924152589066c460db7c40adbac06f4b3a..7b8b401c6ec1a4441c863946be6dfbaeb0301720 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H @@ -527,6 +527,14 @@ public: // Sources + //- Transfer the effect of parcel to the carrier phase + inline void transferToCarrier + ( + const parcelType& p, + const typename parcelType::trackingData& td + ); + + // Momentum //- Return reference to mass for kinematic source diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H index d4643044317e707fa2d71fd029b635cf4f441d5e..b8f54f964b818e0da31266c9d366c0a8fdc89b88 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H @@ -434,6 +434,21 @@ Foam::KinematicCloud<CloudType>::cellLengthScale() const } +template<class CloudType> +inline void Foam::KinematicCloud<CloudType>::transferToCarrier +( + const parcelType& p, + const typename parcelType::trackingData& td +) +{ + const scalar m = p.nParticle()*p.mass(); + + rhokTrans()[p.cell()] += m; + + UTrans()[p.cell()] += m*p.U(); +} + + template<class CloudType> inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>& Foam::KinematicCloud<CloudType>::rhokTrans() diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H index 4cf53147eb1e3c9eff78c7c7ccfd125b551179d7..33afd881e5127944cf5e1c1d254197b1fda9e4bc 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H @@ -233,7 +233,15 @@ public: // Sources - //- Mass + //- Transfer the effect of parcel to the carrier phase + inline void transferToCarrier + ( + const parcelType& p, + const typename parcelType::trackingData& td + ); + + + // Mass //- Return reference to mass source for field i inline volScalarField::Internal& diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H index ef82d05462e0e3fdefd6bbb81240536b8ccfa286..8f357987e53380e977b9c1d6743a83f81bba6748 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H @@ -75,6 +75,39 @@ Foam::ReactingCloud<CloudType>::phaseChange() } +template<class CloudType> +inline void Foam::ReactingCloud<CloudType>::transferToCarrier +( + const parcelType& p, + const typename parcelType::trackingData& td +) +{ + const auto& comp = this->composition(); + + const label celli = p.cell(); + + const scalar m = p.nParticle()*p.mass(); + + this->rhokTrans()[celli] += m; + + this->UTrans()[celli] += m*p.U(); + + const scalar pc = td.pc(); + const scalar T = p.T(); + const auto& Y = p.Y(); + + forAll(Y, i) + { + const scalar dm = m*p.Y[i]; + const label gid = comp.localToCarrierId(0, i); + const scalar hs = comp.carrier().Hs(gid, pc, T); + + this->rhoTrans(gid)[celli] += dm; + this->hsTrans()[celli] += dm*hs; + } +} + + template<class CloudType> inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>& Foam::ReactingCloud<CloudType>::rhoTrans(const label i) diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H index f8ba3ae23428a13d61b0bc1a777cccb6ea132bdc..2c26b4f545fa208ecd7a8dc4a063fc8336701477 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H @@ -251,6 +251,16 @@ public: surfaceReaction(); + // Sources + + //- Transfer the effect of parcel to the carrier phase + inline void transferToCarrier + ( + const parcelType& p, + const typename parcelType::trackingData& td + ); + + // Cloud evolution functions //- Set parcel thermo properties diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloudI.H index d06d65ea8e1efccf106b983573754b4e33bd1939..d3ff72b3cd2d80fb1ad4d9f92ea23af925549f69 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloudI.H @@ -95,4 +95,51 @@ Foam::ReactingMultiphaseCloud<CloudType>::surfaceReaction() } +template<class CloudType> +inline void Foam::ReactingMultiphaseCloud<CloudType>::transferToCarrier +( + const parcelType& p, + const typename parcelType::trackingData& td +) +{ + const label celli = p.cell(); + + const scalar m = p.nParticle()*p.mass(); + const scalar pc = td.pc(); + const scalar T = p.T(); + + this->rhokTrans()[celli] += m; + + this->UTrans()[celli] += m*p.U(); + + const auto& comp = this->composition(); + const label idG = comp.idGas(); + const label idL = comp.idLiquid(); + // const label idS = composition.idSolid(); + + // Absorb parcel into carrier phase + auto transfer = [&] + ( + const label phaseType, + const label phasei, + const scalarField& Y + ) + { + const scalar YMix = p.Y()[phaseType]; + + forAll(Y, i) + { + const label gid = comp.localToCarrierId(phaseType, i); + this->rhoTrans(gid)[celli] += m*YMix*Y[i]; + this->hsTrans()[celli] += m*YMix*comp.Hs(phasei, Y, pc, T); + } + }; + + transfer(parcelType::GAS, idG, p.YGas()); + transfer(parcelType::LIQ, idL, p.YLiquid()); + // No mapping between solid components and carrier phase + //transfer(parcelType::SLD, idS, p.YSolid()); +} + + // ************************************************************************* // diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H index 47dfcb3949ab41bc38a32cd226062b48d54ffebc..7a9a8d47416ab0624fe5029a3877c88906928e75 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H @@ -285,6 +285,14 @@ public: // Sources + //- Transfer the effect of parcel to the carrier phase + inline void transferToCarrier + ( + const parcelType& p, + const typename parcelType::trackingData& td + ); + + // Enthalpy //- Sensible enthalpy transfer [J/kg] diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H index e0dbbb8b5897329a4d57b40dea05d46c77fadcac..9899a5f0c516ffaad99f6098b8059a984adf5f34 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H @@ -190,6 +190,19 @@ Foam::ThermoCloud<CloudType>::radAreaPT4() const } +template<class CloudType> +inline void Foam::ThermoCloud<CloudType>::transferToCarrier +( + const parcelType& p, + const typename parcelType::trackingData& td +) +{ + CloudType::transferToCarrier(p, td); + + hsTrans()[p.cell()] += p.nParticle()*p.mass()*p.hs(); +} + + template<class CloudType> inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>& Foam::ThermoCloud<CloudType>::hsTrans()