Commit b079c715 authored by Mark Olesen's avatar Mark Olesen
Browse files

Merge remote branch 'OpenCFD/master' into olesenm

parents d521850b 285579a7
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -160,12 +160,12 @@ Foam::scalar Foam::COxidationDiffusionLimitedRate<CloudType>::calculate
dMassSRCarrier[O2GlobalId_] -= dmO2;
dMassSRCarrier[CO2GlobalId_] += dmCO2;
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);
const scalar HsC = thermo.solids().properties()[CsLocalId_].Hs(T);
// Heat of reaction [J]
return dmC*HC + dmO2*HO2 - dmCO2*HCO2;
// Sensible enthalpy contributions due to O2 depletion and CO2 generation
// handled by particle transfer terms
return dmC*HsC - dmCO2*HcCO2_;
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -36,12 +36,8 @@ COxidationKineticDiffusionLimitedRate
CloudType& owner
)
:
SurfaceReactionModel<CloudType>
(
dict,
owner,
typeName
),
SurfaceReactionModel<CloudType>(dict, owner, typeName),
Sb_(readScalar(this->coeffDict().lookup("Sb"))),
C1_(readScalar(this->coeffDict().lookup("C1"))),
C2_(readScalar(this->coeffDict().lookup("C2"))),
E_(readScalar(this->coeffDict().lookup("E"))),
......@@ -76,6 +72,7 @@ COxidationKineticDiffusionLimitedRate
)
:
SurfaceReactionModel<CloudType>(srm),
Sb_(srm.Sb_),
C1_(srm.C1_),
C2_(srm.C2_),
E_(srm.E_),
......@@ -83,7 +80,8 @@ COxidationKineticDiffusionLimitedRate
O2GlobalId_(srm.O2GlobalId_),
CO2GlobalId_(srm.CO2GlobalId_),
WC_(srm.WC_),
WO2_(srm.WO2_)
WO2_(srm.WO2_),
HcCO2_(srm.HcCO2_)
{}
......@@ -153,10 +151,10 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate<CloudType>::calculate
const scalar dOmega = dmC/WC_;
// Change in O2 mass [kg]
const scalar dmO2 = dOmega*WO2_;
const scalar dmO2 = dOmega*Sb_*WO2_;
// Mass of newly created CO2 [kg]
const scalar dmCO2 = dOmega*(WC_ + WO2_);
const scalar dmCO2 = dOmega*(WC_ + Sb_*WO2_);
// Update local particle C mass
dMassSolid[CsLocalId_] += dOmega*WC_;
......@@ -165,12 +163,12 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate<CloudType>::calculate
dMassSRCarrier[O2GlobalId_] -= dmO2;
dMassSRCarrier[CO2GlobalId_] += dmCO2;
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);
const scalar HsC = thermo.solids().properties()[CsLocalId_].Hs(T);
// Heat of reaction [J]
return dOmega*(WC_*HC + WO2_*HO2 - (WC_ + WO2_)*HCO2);
// Sensible enthalpy contributions due to O2 depletion and CO2 generation
// handled by particle transfer terms
return dmC*HsC - dmCO2*HcCO2_;
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -61,6 +61,9 @@ class COxidationKineticDiffusionLimitedRate
// Model constants
//- Stoichiometry of reaction
const scalar Sb_;
//- Mass diffusion limited rate constant, C1
const scalar C1_;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -44,12 +44,7 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
CloudType& owner
)
:
SurfaceReactionModel<CloudType>
(
dict,
owner,
typeName
),
SurfaceReactionModel<CloudType>(dict, owner, typeName),
D0_(readScalar(this->coeffDict().lookup("D0"))),
rho0_(readScalar(this->coeffDict().lookup("rho0"))),
T0_(readScalar(this->coeffDict().lookup("T0"))),
......@@ -62,7 +57,8 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
O2GlobalId_(owner.composition().globalCarrierId("O2")),
CO2GlobalId_(owner.composition().globalCarrierId("CO2")),
WC_(0.0),
WO2_(0.0)
WO2_(0.0),
HcCO2_(0.0)
{
// Determine Cs ids
label idSolid = owner.composition().idSolid();
......@@ -72,6 +68,7 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
WO2_ = owner.thermo().carrier().W(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
WC_ = WCO2 - WO2_;
HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_];
const scalar YSolidTot = owner.composition().YMixture0()[idSolid];
......@@ -98,7 +95,8 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
O2GlobalId_(srm.O2GlobalId_),
CO2GlobalId_(srm.CO2GlobalId_),
WC_(srm.WC_),
WO2_(srm.WO2_)
WO2_(srm.WO2_),
HcCO2_(srm.HcCO2_)
{}
......@@ -225,12 +223,12 @@ Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::calculate
// Add to particle mass transfer
dMassSolid[CsLocalId_] += dOmega*WC_;
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);
const scalar HsC = thermo.solids().properties()[CsLocalId_].Hs(T);
// Heat of reaction
return dOmega*(WC_*HC + WO2_*HO2 - (WC_ + WO2_)*HCO2);
// Heat of reaction [J]
// Sensible enthalpy contributions due to O2 depletion and CO2 generation
// handled by particle transfer terms
return dOmega*(WC_*HsC - (WC_ + WO2_)*HcCO2_);
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -115,6 +115,9 @@ class COxidationMurphyShaddix
//- Molecular weight of O2 [kg/kmol]
scalar WO2_;
//- Chemical enthalpy of CO2 [J/kg]
scalar HcCO2_;
public:
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -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
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -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;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -114,7 +114,7 @@ void Foam::ConstantRateDevolatilisation<CloudType>::calculate
forAll(volatileData_, i)
{
const label id = volatileToGasMap_[i];
const scalar massVolatile0 = mass0*YVolatile0_[id];
const scalar massVolatile0 = mass0*YVolatile0_[i];
const scalar massVolatile = mass*YGasEff[id];
// Combustion allowed once all volatile components evolved
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -117,7 +117,7 @@ void Foam::SingleKineticRateDevolatilisation<CloudType>::calculate
forAll(volatileData_, i)
{
const label id = volatileToGasMap_[i];
const scalar massVolatile0 = mass0*YVolatile0_[id];
const scalar massVolatile0 = mass0*YVolatile0_[i];
const scalar massVolatile = mass*YGasEff[id];
// Combustion allowed once all volatile components evolved
......
......@@ -36,7 +36,7 @@ divSchemes
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,omega) Gauss upwind;
div((muEff*dev2(grad(U).T()))) Gauss linear;
div((muEff*dev2(T(grad(U))))) Gauss linear;
div(phi,Yi_h) Gauss upwind;
}
......
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