Skip to content
Snippets Groups Projects
Commit 88a2b204 authored by Andrew Heather's avatar Andrew Heather Committed by Kutalmış Berçin
Browse files

ENH: lagrangian - added transfer of parcel to carrier source terms

parent 761ae928
No related branches found
No related tags found
No related merge requests found
...@@ -527,6 +527,14 @@ public: ...@@ -527,6 +527,14 @@ public:
// Sources // Sources
//- Transfer the effect of parcel to the carrier phase
inline void transferToCarrier
(
const parcelType& p,
const typename parcelType::trackingData& td
);
// Momentum // Momentum
//- Return reference to mass for kinematic source //- Return reference to mass for kinematic source
......
...@@ -434,6 +434,21 @@ Foam::KinematicCloud<CloudType>::cellLengthScale() const ...@@ -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> template<class CloudType>
inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>& inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
Foam::KinematicCloud<CloudType>::rhokTrans() Foam::KinematicCloud<CloudType>::rhokTrans()
......
...@@ -233,7 +233,15 @@ public: ...@@ -233,7 +233,15 @@ public:
// Sources // 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 //- Return reference to mass source for field i
inline volScalarField::Internal& inline volScalarField::Internal&
......
...@@ -75,6 +75,39 @@ Foam::ReactingCloud<CloudType>::phaseChange() ...@@ -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> template<class CloudType>
inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>& inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
Foam::ReactingCloud<CloudType>::rhoTrans(const label i) Foam::ReactingCloud<CloudType>::rhoTrans(const label i)
......
...@@ -251,6 +251,16 @@ public: ...@@ -251,6 +251,16 @@ public:
surfaceReaction(); 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 // Cloud evolution functions
//- Set parcel thermo properties //- Set parcel thermo properties
......
...@@ -95,4 +95,51 @@ Foam::ReactingMultiphaseCloud<CloudType>::surfaceReaction() ...@@ -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());
}
// ************************************************************************* // // ************************************************************************* //
...@@ -285,6 +285,14 @@ public: ...@@ -285,6 +285,14 @@ public:
// Sources // Sources
//- Transfer the effect of parcel to the carrier phase
inline void transferToCarrier
(
const parcelType& p,
const typename parcelType::trackingData& td
);
// Enthalpy // Enthalpy
//- Sensible enthalpy transfer [J/kg] //- Sensible enthalpy transfer [J/kg]
......
...@@ -190,6 +190,19 @@ Foam::ThermoCloud<CloudType>::radAreaPT4() const ...@@ -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> template<class CloudType>
inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>& inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>&
Foam::ThermoCloud<CloudType>::hsTrans() Foam::ThermoCloud<CloudType>::hsTrans()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment