1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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 "COxidationDiffusionLimitedRate.H"
27 #include "mathematicalConstants.H"
29 using namespace Foam::constant;
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 template<class CloudType>
34 Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
36 const dictionary& dict,
40 SurfaceReactionModel<CloudType>(dict, owner, typeName),
41 Sb_(readScalar(this->coeffDict().lookup("Sb"))),
42 D_(readScalar(this->coeffDict().lookup("D"))),
44 O2GlobalId_(owner.composition().globalCarrierId("O2")),
45 CO2GlobalId_(owner.composition().globalCarrierId("CO2")),
51 label idSolid = owner.composition().idSolid();
52 CsLocalId_ = owner.composition().localId(idSolid, "C");
54 // Set local copies of thermo properties
55 WO2_ = owner.thermo().carrier().W(O2GlobalId_);
56 const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
59 HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
65 "COxidationDiffusionLimitedRate<CloudType>"
70 ) << "Stoichiometry of reaction, Sb, must be greater than zero" << nl
74 const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_];
75 const scalar YSolidTot = owner.composition().YMixture0()[idSolid];
76 Info<< " C(s): particle mass fraction = " << YCloc*YSolidTot << endl;
80 template<class CloudType>
81 Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
83 const COxidationDiffusionLimitedRate<CloudType>& srm
86 SurfaceReactionModel<CloudType>(srm),
89 CsLocalId_(srm.CsLocalId_),
90 O2GlobalId_(srm.O2GlobalId_),
91 CO2GlobalId_(srm.CO2GlobalId_),
98 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
100 template<class CloudType>
101 Foam::COxidationDiffusionLimitedRate<CloudType>::
102 ~COxidationDiffusionLimitedRate()
106 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
108 template<class CloudType>
109 Foam::scalar Foam::COxidationDiffusionLimitedRate<CloudType>::calculate
119 const scalarField& YGas,
120 const scalarField& YLiquid,
121 const scalarField& YSolid,
122 const scalarField& YMixture,
124 scalarField& dMassGas,
125 scalarField& dMassLiquid,
126 scalarField& dMassSolid,
127 scalarField& dMassSRCarrier
130 // Fraction of remaining combustible material
131 const label idSolid = CloudType::parcelType::SLD;
132 const scalar fComb = YMixture[idSolid]*YSolid[CsLocalId_];
134 // Surface combustion active combustible fraction is consumed
140 const SLGThermo& thermo = this->owner().thermo();
142 // Local mass fraction of O2 in the carrier phase
143 const scalar YO2 = thermo.carrier().Y(O2GlobalId_)[cellI];
145 // Change in C mass [kg]
146 scalar dmC = 4.0*mathematical::pi*d*D_*YO2*Tc*rhoc/(Sb_*(T + Tc))*dt;
148 // Limit mass transfer by availability of C
149 dmC = min(mass*fComb, dmC);
151 // Change in O2 mass [kg]
152 const scalar dmO2 = dmC/WC_*Sb_*WO2_;
154 // Mass of newly created CO2 [kg]
155 const scalar dmCO2 = dmC + dmO2;
157 // Update local particle C mass
158 dMassSolid[CsLocalId_] += dmC;
160 // Update carrier O2 and CO2 mass
161 dMassSRCarrier[O2GlobalId_] -= dmO2;
162 dMassSRCarrier[CO2GlobalId_] += dmCO2;
164 const scalar HsC = thermo.solids().properties()[CsLocalId_].Hs(T);
166 // carrier sensible enthalpy exchange handled via change in mass
168 // Heat of reaction [J]
169 return dmC*HsC - dmCO2*HcCO2_;
173 // ************************************************************************* //