Commit 03445584 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: Updated enthalpy transfer terms for reacting parcels

parent 2b06a002
......@@ -205,6 +205,9 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
const label cellI
)
{
typedef typename ReactingParcel<ParcelType>::trackData::cloudType cloudType;
const CompositionModel<cloudType>& composition = td.cloud().composition();
// Define local properties at beginning of timestep
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const scalar np0 = this->nParticle_;
......@@ -218,9 +221,9 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
const scalar pc = this->pc_;
const scalarField& YMix = this->Y_;
const label idG = td.cloud().composition().idGas();
const label idL = td.cloud().composition().idLiquid();
const label idS = td.cloud().composition().idSolid();
const label idG = composition.idGas();
const label idL = composition.idLiquid();
const label idS = composition.idSolid();
// Calc surface values
......@@ -262,7 +265,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
scalar NCpW = 0.0;
// 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
this->calcPhaseChange
......@@ -323,12 +326,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
scalarField dMassSRGas(YGas_.size(), 0.0);
scalarField dMassSRLiquid(YLiquid_.size(), 0.0);
scalarField dMassSRSolid(YSolid_.size(), 0.0);
scalarField
dMassSRCarrier
(
td.cloud().composition().carrier().species().size(),
0.0
);
scalarField dMassSRCarrier(composition.carrier().species().size(), 0.0);
// Clac mass and enthalpy transfer due to surface reactions
calcSurfaceReactions
......@@ -423,25 +421,33 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
// Transfer mass lost from particle to carrier mass source
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().hsTrans()[cellI] +=
np0*dMassGas[i]*composition.carrier().Hs(gid, T0);
}
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().hsTrans()[cellI] +=
np0*dMassLiquid[i]*composition.carrier().Hs(gid, T0);
}
/*
// No mapping between solid components and carrier phase
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().hsTrans()[cellI] +=
np0*dMassSolid[i]*composition.carrier().Hs(gid, T0);
}
*/
forAll(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
......@@ -470,14 +476,12 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
// Absorb parcel into carrier phase
forAll(YGas_, i)
{
label gid =
td.cloud().composition().localToGlobalCarrierId(GAS, i);
label gid = composition.localToGlobalCarrierId(GAS, i);
td.cloud().rhoTrans(gid)[cellI] += np0*mass1*YMix[GAS]*YGas_[i];
}
forAll(YLiquid_, i)
{
label gid =
td.cloud().composition().localToGlobalCarrierId(LIQ, i);
label gid = composition.localToGlobalCarrierId(LIQ, i);
td.cloud().rhoTrans(gid)[cellI] +=
np0*mass1*YMix[LIQ]*YLiquid_[i];
}
......@@ -485,8 +489,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
// No mapping between solid components and carrier phase
forAll(YSolid_, i)
{
label gid =
td.cloud().composition().localToGlobalCarrierId(SLD, i);
label gid = composition.localToGlobalCarrierId(SLD, i);
td.cloud().rhoTrans(gid)[cellI] +=
np0*mass1*YMix[SLD]*YSolid_[i];
}
......@@ -551,6 +554,9 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
return;
}
typedef typename ReactingParcel<ParcelType>::trackData::cloudType cloudType;
const CompositionModel<cloudType>& composition = td.cloud().composition();
// Total mass of volatiles evolved
td.cloud().devolatilisation().calculate
(
......@@ -578,10 +584,9 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
// Note: hardcoded gaseous diffusivities for now
// TODO: add to carrier thermo
const scalar beta = sqr(cbrt(15.0) + cbrt(15.0));
const label id =
td.cloud().composition().localToGlobalCarrierId(GAS, i);
const scalar Cp = td.cloud().thermo().carrier().Cp(id, Ts);
const scalar W = td.cloud().thermo().carrier().W(id);
const label id = composition.localToGlobalCarrierId(GAS, i);
const scalar Cp = composition.carrier().Cp(id, Ts);
const scalar W = composition.carrier().W(id);
const scalar Ni = dMassDV[i]/(this->areaS(d)*dt*W);
// Dab calc'd using API vapour mass diffusivity function
......
......@@ -236,6 +236,9 @@ void Foam::ReactingParcel<ParcelType>::calc
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
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const scalar np0 = this->nParticle_;
......@@ -285,7 +288,7 @@ void Foam::ReactingParcel<ParcelType>::calc
scalar NCpW = 0.0;
// 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
calcPhaseChange
......@@ -372,8 +375,10 @@ void Foam::ReactingParcel<ParcelType>::calc
// Transfer mass lost from particle to carrier mass source
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().hsTrans()[cellI] +=
np0*dMassPC[i]*composition.carrier().Hs(gid, T0);
}
// Update momentum transfer
......@@ -401,13 +406,12 @@ void Foam::ReactingParcel<ParcelType>::calc
// Absorb parcel into carrier phase
forAll(Y_, i)
{
label gid =
td.cloud().composition().localToGlobalCarrierId(0, i);
label gid = composition.localToGlobalCarrierId(0, i);
td.cloud().rhoTrans(gid)[cellI] += np0*mass1*Y_[i];
}
td.cloud().UTrans()[cellI] += np0*mass1*U1;
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
{
this->Cp_ = td.cloud().composition().Cp(0, Y_, pc_, T1);
this->Cp_ = composition.Cp(0, Y_, pc_, T1);
this->T_ = T1;
this->U_ = U1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment