1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "COxidationKineticDiffusionLimitedRate.H"
27 #include "mathematicalConstants.H"
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 template<class CloudType>
32 Foam::COxidationKineticDiffusionLimitedRate<CloudType>::
33 COxidationKineticDiffusionLimitedRate
35 const dictionary& dict,
39 SurfaceReactionModel<CloudType>(dict, owner, typeName),
40 Sb_(readScalar(this->coeffDict().lookup("Sb"))),
41 C1_(readScalar(this->coeffDict().lookup("C1"))),
42 C2_(readScalar(this->coeffDict().lookup("C2"))),
43 E_(readScalar(this->coeffDict().lookup("E"))),
45 O2GlobalId_(owner.composition().globalCarrierId("O2")),
46 CO2GlobalId_(owner.composition().globalCarrierId("CO2")),
52 label idSolid = owner.composition().idSolid();
53 CsLocalId_ = owner.composition().localId(idSolid, "C");
55 // Set local copies of thermo properties
56 WO2_ = owner.thermo().carrier().W(O2GlobalId_);
57 const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
60 HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
62 const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_];
63 const scalar YSolidTot = owner.composition().YMixture0()[idSolid];
64 Info<< " C(s): particle mass fraction = " << YCloc*YSolidTot << endl;
68 template<class CloudType>
69 Foam::COxidationKineticDiffusionLimitedRate<CloudType>::
70 COxidationKineticDiffusionLimitedRate
72 const COxidationKineticDiffusionLimitedRate<CloudType>& srm
75 SurfaceReactionModel<CloudType>(srm),
80 CsLocalId_(srm.CsLocalId_),
81 O2GlobalId_(srm.O2GlobalId_),
82 CO2GlobalId_(srm.CO2GlobalId_),
88 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
90 template<class CloudType>
91 Foam::COxidationKineticDiffusionLimitedRate<CloudType>::
92 ~COxidationKineticDiffusionLimitedRate()
96 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
98 template<class CloudType>
99 Foam::scalar Foam::COxidationKineticDiffusionLimitedRate<CloudType>::calculate
109 const scalarField& YGas,
110 const scalarField& YLiquid,
111 const scalarField& YSolid,
112 const scalarField& YMixture,
114 scalarField& dMassGas,
115 scalarField& dMassLiquid,
116 scalarField& dMassSolid,
117 scalarField& dMassSRCarrier
120 // Fraction of remaining combustible material
121 const label idSolid = CloudType::parcelType::SLD;
122 const scalar fComb = YMixture[idSolid]*YSolid[CsLocalId_];
124 // Surface combustion active combustible fraction is consumed
130 const SLGThermo& thermo = this->owner().thermo();
132 // Local mass fraction of O2 in the carrier phase
133 const scalar YO2 = thermo.carrier().Y(O2GlobalId_)[cellI];
135 // Diffusion rate coefficient
136 const scalar D0 = C1_/d*pow(0.5*(T + Tc), 0.75);
139 const scalar Rk = C2_*exp(-E_/(specie::RR*Tc));
141 // Particle surface area
142 const scalar Ap = constant::mathematical::pi*sqr(d);
144 // Change in C mass [kg]
145 scalar dmC = Ap*rhoc*specie::RR*Tc*YO2/WO2_*D0*Rk/(D0 + Rk)*dt;
147 // Limit mass transfer by availability of C
148 dmC = min(mass*fComb, dmC);
151 const scalar dOmega = dmC/WC_;
153 // Change in O2 mass [kg]
154 const scalar dmO2 = dOmega*Sb_*WO2_;
156 // Mass of newly created CO2 [kg]
157 const scalar dmCO2 = dOmega*(WC_ + Sb_*WO2_);
159 // Update local particle C mass
160 dMassSolid[CsLocalId_] += dOmega*WC_;
162 // Update carrier O2 and CO2 mass
163 dMassSRCarrier[O2GlobalId_] -= dmO2;
164 dMassSRCarrier[CO2GlobalId_] += dmCO2;
166 const scalar HsC = thermo.solids().properties()[CsLocalId_].Hs(T);
168 // carrier sensible enthalpy exchange handled via change in mass
170 // Heat of reaction [J]
171 return dmC*HsC - dmCO2*HcCO2_;
175 // ************************************************************************* //