mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Updated enthalpy transfer terms for reacting parcels
This commit is contained in:
@ -205,6 +205,9 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
|
|||||||
const label cellI
|
const label cellI
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
typedef typename ReactingParcel<ParcelType>::trackData::cloudType cloudType;
|
||||||
|
const CompositionModel<cloudType>& composition = td.cloud().composition();
|
||||||
|
|
||||||
// Define local properties at beginning of timestep
|
// Define local properties at beginning of timestep
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
const scalar np0 = this->nParticle_;
|
const scalar np0 = this->nParticle_;
|
||||||
@ -218,9 +221,9 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
|
|||||||
const scalar pc = this->pc_;
|
const scalar pc = this->pc_;
|
||||||
|
|
||||||
const scalarField& YMix = this->Y_;
|
const scalarField& YMix = this->Y_;
|
||||||
const label idG = td.cloud().composition().idGas();
|
const label idG = composition.idGas();
|
||||||
const label idL = td.cloud().composition().idLiquid();
|
const label idL = composition.idLiquid();
|
||||||
const label idS = td.cloud().composition().idSolid();
|
const label idS = composition.idSolid();
|
||||||
|
|
||||||
|
|
||||||
// Calc surface values
|
// Calc surface values
|
||||||
@ -262,7 +265,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
|
|||||||
scalar NCpW = 0.0;
|
scalar NCpW = 0.0;
|
||||||
|
|
||||||
// Surface concentrations of emitted species
|
// Surface concentrations of emitted species
|
||||||
scalarField Cs(td.cloud().composition().carrier().species().size(), 0.0);
|
scalarField Cs(composition.carrier().species().size(), 0.0);
|
||||||
|
|
||||||
// Calc mass and enthalpy transfer due to phase change
|
// Calc mass and enthalpy transfer due to phase change
|
||||||
this->calcPhaseChange
|
this->calcPhaseChange
|
||||||
@ -323,12 +326,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
|
|||||||
scalarField dMassSRGas(YGas_.size(), 0.0);
|
scalarField dMassSRGas(YGas_.size(), 0.0);
|
||||||
scalarField dMassSRLiquid(YLiquid_.size(), 0.0);
|
scalarField dMassSRLiquid(YLiquid_.size(), 0.0);
|
||||||
scalarField dMassSRSolid(YSolid_.size(), 0.0);
|
scalarField dMassSRSolid(YSolid_.size(), 0.0);
|
||||||
scalarField
|
scalarField dMassSRCarrier(composition.carrier().species().size(), 0.0);
|
||||||
dMassSRCarrier
|
|
||||||
(
|
|
||||||
td.cloud().composition().carrier().species().size(),
|
|
||||||
0.0
|
|
||||||
);
|
|
||||||
|
|
||||||
// Clac mass and enthalpy transfer due to surface reactions
|
// Clac mass and enthalpy transfer due to surface reactions
|
||||||
calcSurfaceReactions
|
calcSurfaceReactions
|
||||||
@ -423,25 +421,33 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
|
|||||||
// Transfer mass lost from particle to carrier mass source
|
// Transfer mass lost from particle to carrier mass source
|
||||||
forAll(YGas_, i)
|
forAll(YGas_, i)
|
||||||
{
|
{
|
||||||
label gid = td.cloud().composition().localToGlobalCarrierId(GAS, i);
|
label gid = composition.localToGlobalCarrierId(GAS, i);
|
||||||
td.cloud().rhoTrans(gid)[cellI] += np0*dMassGas[i];
|
td.cloud().rhoTrans(gid)[cellI] += np0*dMassGas[i];
|
||||||
|
td.cloud().hsTrans()[cellI] +=
|
||||||
|
np0*dMassGas[i]*composition.carrier().Hs(gid, T0);
|
||||||
}
|
}
|
||||||
forAll(YLiquid_, i)
|
forAll(YLiquid_, i)
|
||||||
{
|
{
|
||||||
label gid = td.cloud().composition().localToGlobalCarrierId(LIQ, i);
|
label gid = composition.localToGlobalCarrierId(LIQ, i);
|
||||||
td.cloud().rhoTrans(gid)[cellI] += np0*dMassLiquid[i];
|
td.cloud().rhoTrans(gid)[cellI] += np0*dMassLiquid[i];
|
||||||
|
td.cloud().hsTrans()[cellI] +=
|
||||||
|
np0*dMassLiquid[i]*composition.carrier().Hs(gid, T0);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
// No mapping between solid components and carrier phase
|
// No mapping between solid components and carrier phase
|
||||||
forAll(YSolid_, i)
|
forAll(YSolid_, i)
|
||||||
{
|
{
|
||||||
label gid = td.cloud().composition().localToGlobalCarrierId(SLD, i);
|
label gid = composition.localToGlobalCarrierId(SLD, i);
|
||||||
td.cloud().rhoTrans(gid)[cellI] += np0*dMassSolid[i];
|
td.cloud().rhoTrans(gid)[cellI] += np0*dMassSolid[i];
|
||||||
|
td.cloud().hsTrans()[cellI] +=
|
||||||
|
np0*dMassSolid[i]*composition.carrier().Hs(gid, T0);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
forAll(dMassSRCarrier, i)
|
forAll(dMassSRCarrier, i)
|
||||||
{
|
{
|
||||||
td.cloud().rhoTrans(i)[cellI] += np0*dMassSRCarrier[i];
|
td.cloud().rhoTrans(i)[cellI] += np0*dMassSRCarrier[i];
|
||||||
|
td.cloud().hsTrans()[cellI] +=
|
||||||
|
np0*dMassSRCarrier[i]*composition.carrier().Hs(i, T0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update momentum transfer
|
// Update momentum transfer
|
||||||
@ -470,14 +476,12 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
|
|||||||
// Absorb parcel into carrier phase
|
// Absorb parcel into carrier phase
|
||||||
forAll(YGas_, i)
|
forAll(YGas_, i)
|
||||||
{
|
{
|
||||||
label gid =
|
label gid = composition.localToGlobalCarrierId(GAS, i);
|
||||||
td.cloud().composition().localToGlobalCarrierId(GAS, i);
|
|
||||||
td.cloud().rhoTrans(gid)[cellI] += np0*mass1*YMix[GAS]*YGas_[i];
|
td.cloud().rhoTrans(gid)[cellI] += np0*mass1*YMix[GAS]*YGas_[i];
|
||||||
}
|
}
|
||||||
forAll(YLiquid_, i)
|
forAll(YLiquid_, i)
|
||||||
{
|
{
|
||||||
label gid =
|
label gid = composition.localToGlobalCarrierId(LIQ, i);
|
||||||
td.cloud().composition().localToGlobalCarrierId(LIQ, i);
|
|
||||||
td.cloud().rhoTrans(gid)[cellI] +=
|
td.cloud().rhoTrans(gid)[cellI] +=
|
||||||
np0*mass1*YMix[LIQ]*YLiquid_[i];
|
np0*mass1*YMix[LIQ]*YLiquid_[i];
|
||||||
}
|
}
|
||||||
@ -485,8 +489,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
|
|||||||
// No mapping between solid components and carrier phase
|
// No mapping between solid components and carrier phase
|
||||||
forAll(YSolid_, i)
|
forAll(YSolid_, i)
|
||||||
{
|
{
|
||||||
label gid =
|
label gid = composition.localToGlobalCarrierId(SLD, i);
|
||||||
td.cloud().composition().localToGlobalCarrierId(SLD, i);
|
|
||||||
td.cloud().rhoTrans(gid)[cellI] +=
|
td.cloud().rhoTrans(gid)[cellI] +=
|
||||||
np0*mass1*YMix[SLD]*YSolid_[i];
|
np0*mass1*YMix[SLD]*YSolid_[i];
|
||||||
}
|
}
|
||||||
@ -551,6 +554,9 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef typename ReactingParcel<ParcelType>::trackData::cloudType cloudType;
|
||||||
|
const CompositionModel<cloudType>& composition = td.cloud().composition();
|
||||||
|
|
||||||
// Total mass of volatiles evolved
|
// Total mass of volatiles evolved
|
||||||
td.cloud().devolatilisation().calculate
|
td.cloud().devolatilisation().calculate
|
||||||
(
|
(
|
||||||
@ -578,10 +584,9 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
|
|||||||
// Note: hardcoded gaseous diffusivities for now
|
// Note: hardcoded gaseous diffusivities for now
|
||||||
// TODO: add to carrier thermo
|
// TODO: add to carrier thermo
|
||||||
const scalar beta = sqr(cbrt(15.0) + cbrt(15.0));
|
const scalar beta = sqr(cbrt(15.0) + cbrt(15.0));
|
||||||
const label id =
|
const label id = composition.localToGlobalCarrierId(GAS, i);
|
||||||
td.cloud().composition().localToGlobalCarrierId(GAS, i);
|
const scalar Cp = composition.carrier().Cp(id, Ts);
|
||||||
const scalar Cp = td.cloud().thermo().carrier().Cp(id, Ts);
|
const scalar W = composition.carrier().W(id);
|
||||||
const scalar W = td.cloud().thermo().carrier().W(id);
|
|
||||||
const scalar Ni = dMassDV[i]/(this->areaS(d)*dt*W);
|
const scalar Ni = dMassDV[i]/(this->areaS(d)*dt*W);
|
||||||
|
|
||||||
// Dab calc'd using API vapour mass diffusivity function
|
// Dab calc'd using API vapour mass diffusivity function
|
||||||
|
|||||||
@ -236,6 +236,9 @@ void Foam::ReactingParcel<ParcelType>::calc
|
|||||||
const label cellI
|
const label cellI
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
typedef typename ReactingParcel<ParcelType>::trackData::cloudType cloudType;
|
||||||
|
const CompositionModel<cloudType>& composition = td.cloud().composition();
|
||||||
|
|
||||||
// Define local properties at beginning of time step
|
// Define local properties at beginning of time step
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
const scalar np0 = this->nParticle_;
|
const scalar np0 = this->nParticle_;
|
||||||
@ -285,7 +288,7 @@ void Foam::ReactingParcel<ParcelType>::calc
|
|||||||
scalar NCpW = 0.0;
|
scalar NCpW = 0.0;
|
||||||
|
|
||||||
// Surface concentrations of emitted species
|
// Surface concentrations of emitted species
|
||||||
scalarField Cs(td.cloud().composition().carrier().species().size(), 0.0);
|
scalarField Cs(composition.carrier().species().size(), 0.0);
|
||||||
|
|
||||||
// Calc mass and enthalpy transfer due to phase change
|
// Calc mass and enthalpy transfer due to phase change
|
||||||
calcPhaseChange
|
calcPhaseChange
|
||||||
@ -372,8 +375,10 @@ void Foam::ReactingParcel<ParcelType>::calc
|
|||||||
// Transfer mass lost from particle to carrier mass source
|
// Transfer mass lost from particle to carrier mass source
|
||||||
forAll(dMassPC, i)
|
forAll(dMassPC, i)
|
||||||
{
|
{
|
||||||
label gid = td.cloud().composition().localToGlobalCarrierId(0, i);
|
label gid = composition.localToGlobalCarrierId(0, i);
|
||||||
td.cloud().rhoTrans(gid)[cellI] += np0*dMassPC[i];
|
td.cloud().rhoTrans(gid)[cellI] += np0*dMassPC[i];
|
||||||
|
td.cloud().hsTrans()[cellI] +=
|
||||||
|
np0*dMassPC[i]*composition.carrier().Hs(gid, T0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update momentum transfer
|
// Update momentum transfer
|
||||||
@ -401,13 +406,12 @@ void Foam::ReactingParcel<ParcelType>::calc
|
|||||||
// Absorb parcel into carrier phase
|
// Absorb parcel into carrier phase
|
||||||
forAll(Y_, i)
|
forAll(Y_, i)
|
||||||
{
|
{
|
||||||
label gid =
|
label gid = composition.localToGlobalCarrierId(0, i);
|
||||||
td.cloud().composition().localToGlobalCarrierId(0, i);
|
|
||||||
td.cloud().rhoTrans(gid)[cellI] += np0*mass1*Y_[i];
|
td.cloud().rhoTrans(gid)[cellI] += np0*mass1*Y_[i];
|
||||||
}
|
}
|
||||||
td.cloud().UTrans()[cellI] += np0*mass1*U1;
|
td.cloud().UTrans()[cellI] += np0*mass1*U1;
|
||||||
td.cloud().hsTrans()[cellI] +=
|
td.cloud().hsTrans()[cellI] +=
|
||||||
np0*mass1*td.cloud().composition().H(0, Y_, pc_, T1);
|
np0*mass1*composition.H(0, Y_, pc_, T1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -417,7 +421,7 @@ void Foam::ReactingParcel<ParcelType>::calc
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->Cp_ = td.cloud().composition().Cp(0, Y_, pc_, T1);
|
this->Cp_ = composition.Cp(0, Y_, pc_, T1);
|
||||||
this->T_ = T1;
|
this->T_ = T1;
|
||||||
this->U_ = U1;
|
this->U_ = U1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user