ENH: Updated cloud enthalpy coupling

This commit is contained in:
andy
2011-03-07 16:47:50 +00:00
parent f25f3d6f07
commit f26ba2c303
8 changed files with 19 additions and 50 deletions

View File

@ -44,8 +44,7 @@ Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
O2GlobalId_(owner.composition().globalCarrierId("O2")), O2GlobalId_(owner.composition().globalCarrierId("O2")),
CO2GlobalId_(owner.composition().globalCarrierId("CO2")), CO2GlobalId_(owner.composition().globalCarrierId("CO2")),
WC_(0.0), WC_(0.0),
WO2_(0.0), WO2_(0.0)
HcCO2_(0.0)
{ {
// Determine Cs ids // Determine Cs ids
label idSolid = owner.composition().idSolid(); label idSolid = owner.composition().idSolid();
@ -55,7 +54,6 @@ Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
WO2_ = owner.thermo().carrier().W(O2GlobalId_); WO2_ = owner.thermo().carrier().W(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_); const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
WC_ = WCO2 - WO2_; WC_ = WCO2 - WO2_;
HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
if (Sb_ < 0) if (Sb_ < 0)
{ {
@ -89,8 +87,7 @@ Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
O2GlobalId_(srm.O2GlobalId_), O2GlobalId_(srm.O2GlobalId_),
CO2GlobalId_(srm.CO2GlobalId_), CO2GlobalId_(srm.CO2GlobalId_),
WC_(srm.WC_), WC_(srm.WC_),
WO2_(srm.WO2_), WO2_(srm.WO2_)
HcCO2_(srm.HcCO2_)
{} {}
@ -160,12 +157,12 @@ Foam::scalar Foam::COxidationDiffusionLimitedRate<CloudType>::calculate
dMassSRCarrier[O2GlobalId_] -= dmO2; dMassSRCarrier[O2GlobalId_] -= dmO2;
dMassSRCarrier[CO2GlobalId_] += dmCO2; dMassSRCarrier[CO2GlobalId_] += dmCO2;
const scalar HsC = thermo.solids().properties()[CsLocalId_].Hs(T); const scalar HC = thermo.solids().properties()[CsLocalId_].H(T);
const scalar HCO2 = thermo.carrier().H(CO2GlobalId_, T);
const scalar HO2 = thermo.carrier().H(O2GlobalId_, T);
// Heat of reaction [J] // Heat of reaction [J]
// Sensible enthalpy contributions due to O2 depletion and CO2 generation return dmC*HC + dmO2*HO2 - dmCO2*HCO2;
// handled by particle transfer terms
return dmC*HsC - dmCO2*HcCO2_;
} }

View File

@ -86,9 +86,6 @@ class COxidationDiffusionLimitedRate
//- Molecular weight of O2 [kg/kmol] //- Molecular weight of O2 [kg/kmol]
scalar WO2_; scalar WO2_;
//- Chemical enthalpy of CO2 [J/kg]
scalar HcCO2_;
public: public:

View File

@ -45,8 +45,7 @@ COxidationKineticDiffusionLimitedRate
O2GlobalId_(owner.composition().globalCarrierId("O2")), O2GlobalId_(owner.composition().globalCarrierId("O2")),
CO2GlobalId_(owner.composition().globalCarrierId("CO2")), CO2GlobalId_(owner.composition().globalCarrierId("CO2")),
WC_(0.0), WC_(0.0),
WO2_(0.0), WO2_(0.0)
HcCO2_(0.0)
{ {
// Determine Cs ids // Determine Cs ids
label idSolid = owner.composition().idSolid(); label idSolid = owner.composition().idSolid();
@ -56,7 +55,6 @@ COxidationKineticDiffusionLimitedRate
WO2_ = owner.thermo().carrier().W(O2GlobalId_); WO2_ = owner.thermo().carrier().W(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_); const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
WC_ = WCO2 - WO2_; WC_ = WCO2 - WO2_;
HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_]; const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_];
const scalar YSolidTot = owner.composition().YMixture0()[idSolid]; const scalar YSolidTot = owner.composition().YMixture0()[idSolid];
@ -80,8 +78,7 @@ COxidationKineticDiffusionLimitedRate
O2GlobalId_(srm.O2GlobalId_), O2GlobalId_(srm.O2GlobalId_),
CO2GlobalId_(srm.CO2GlobalId_), CO2GlobalId_(srm.CO2GlobalId_),
WC_(srm.WC_), WC_(srm.WC_),
WO2_(srm.WO2_), WO2_(srm.WO2_)
HcCO2_(srm.HcCO2_)
{} {}
@ -163,12 +160,12 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate<CloudType>::calculate
dMassSRCarrier[O2GlobalId_] -= dmO2; dMassSRCarrier[O2GlobalId_] -= dmO2;
dMassSRCarrier[CO2GlobalId_] += dmCO2; dMassSRCarrier[CO2GlobalId_] += dmCO2;
const scalar HsC = thermo.solids().properties()[CsLocalId_].Hs(T); const scalar HC = thermo.solids().properties()[CsLocalId_].H(T);
const scalar HCO2 = thermo.carrier().H(CO2GlobalId_, T);
const scalar HO2 = thermo.carrier().H(O2GlobalId_, T);
// Heat of reaction [J] // Heat of reaction [J]
// Sensible enthalpy contributions due to O2 depletion and CO2 generation return dmC*HC + dmO2*HO2 - dmCO2*HCO2;
// handled by particle transfer terms
return dmC*HsC - dmCO2*HcCO2_;
} }

View File

@ -94,9 +94,6 @@ class COxidationKineticDiffusionLimitedRate
//- Molecular weight of O2 [kg/kmol] //- Molecular weight of O2 [kg/kmol]
scalar WO2_; scalar WO2_;
//- Chemical enthalpy of CO2 [J/kg]
scalar HcCO2_;
public: public:

View File

@ -57,8 +57,7 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
O2GlobalId_(owner.composition().globalCarrierId("O2")), O2GlobalId_(owner.composition().globalCarrierId("O2")),
CO2GlobalId_(owner.composition().globalCarrierId("CO2")), CO2GlobalId_(owner.composition().globalCarrierId("CO2")),
WC_(0.0), WC_(0.0),
WO2_(0.0), WO2_(0.0)
HcCO2_(0.0)
{ {
// Determine Cs ids // Determine Cs ids
label idSolid = owner.composition().idSolid(); label idSolid = owner.composition().idSolid();
@ -68,7 +67,6 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
WO2_ = owner.thermo().carrier().W(O2GlobalId_); WO2_ = owner.thermo().carrier().W(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_); const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
WC_ = WCO2 - WO2_; WC_ = WCO2 - WO2_;
HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_]; const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_];
const scalar YSolidTot = owner.composition().YMixture0()[idSolid]; const scalar YSolidTot = owner.composition().YMixture0()[idSolid];
@ -95,8 +93,7 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
O2GlobalId_(srm.O2GlobalId_), O2GlobalId_(srm.O2GlobalId_),
CO2GlobalId_(srm.CO2GlobalId_), CO2GlobalId_(srm.CO2GlobalId_),
WC_(srm.WC_), WC_(srm.WC_),
WO2_(srm.WO2_), WO2_(srm.WO2_)
HcCO2_(srm.HcCO2_)
{} {}
@ -223,12 +220,12 @@ Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::calculate
// Add to particle mass transfer // Add to particle mass transfer
dMassSolid[CsLocalId_] += dOmega*WC_; dMassSolid[CsLocalId_] += dOmega*WC_;
const scalar HsC = thermo.solids().properties()[CsLocalId_].Hs(T); const scalar HC = thermo.solids().properties()[CsLocalId_].H(T);
const scalar HCO2 = thermo.carrier().H(CO2GlobalId_, T);
const scalar HO2 = thermo.carrier().H(O2GlobalId_, T);
// Heat of reaction [J] // Heat of reaction
// Sensible enthalpy contributions due to O2 depletion and CO2 generation return dOmega*(WC_*HC + WO2_*HO2 - (WC_ + WO2_)*HCO2);
// handled by particle transfer terms
return dOmega*(WC_*HsC - (WC_ + WO2_)*HcCO2_);
} }

View File

@ -115,9 +115,6 @@ class COxidationMurphyShaddix
//- Molecular weight of O2 [kg/kmol] //- Molecular weight of O2 [kg/kmol]
scalar WO2_; scalar WO2_;
//- Chemical enthalpy of CO2 [J/kg]
scalar HcCO2_;
public: public:

View File

@ -382,16 +382,11 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
{ {
label gid = td.cloud().composition().localToGlobalCarrierId(GAS, i); label gid = td.cloud().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]*td.cloud().composition().carrier().Hs(gid, T0);
} }
forAll(YLiquid_, i) forAll(YLiquid_, i)
{ {
label gid = td.cloud().composition().localToGlobalCarrierId(LIQ, i); label gid = td.cloud().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]
*td.cloud().composition().carrier().Hs(gid, T0);
} }
/* /*
// No mapping between solid components and carrier phase // No mapping between solid components and carrier phase
@ -399,17 +394,11 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
{ {
label gid = td.cloud().composition().localToGlobalCarrierId(SLD, i); label gid = td.cloud().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]
*td.cloud().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]
*td.cloud().composition().carrier().Hs(i, T0);
} }
// Update momentum transfer // Update momentum transfer

View File

@ -391,8 +391,6 @@ void Foam::ReactingParcel<ParcelType>::calc
{ {
label gid = td.cloud().composition().localToGlobalCarrierId(0, i); label gid = td.cloud().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]*td.cloud().composition().carrier().Hs(gid, T0);
} }
// Update momentum transfer // Update momentum transfer