mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: lagrangian - added transfer of parcel to carrier source terms
This commit is contained in:
committed by
Andrew Heather
parent
0b381897c3
commit
0c8bbfeefd
@ -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
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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&
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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:
|
||||
|
||||
// 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]
|
||||
|
||||
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user