1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2008-2009 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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "COxidationKineticDiffusionLimitedRate.H"
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 template<class CloudType>
32 Foam::COxidationKineticDiffusionLimitedRate<CloudType>::
33 COxidationKineticDiffusionLimitedRate
35 const dictionary& dict,
39 SurfaceReactionModel<CloudType>
45 Sb_(dimensionedScalar(this->coeffDict().lookup("Sb")).value()),
46 C1_(dimensionedScalar(this->coeffDict().lookup("C1")).value()),
47 C2_(dimensionedScalar(this->coeffDict().lookup("C2")).value()),
48 E_(dimensionedScalar(this->coeffDict().lookup("E")).value()),
50 O2GlobalId_(owner.composition().globalCarrierId("O2")),
51 CO2GlobalId_(owner.composition().globalCarrierId("CO2")),
57 label idSolid = owner.composition().idSolid();
58 CsLocalId_ = owner.composition().localId(idSolid, "C");
60 // Set local copies of thermo properties
61 WO2_ = owner.mcCarrierThermo().speciesData()[O2GlobalId_].W();
62 scalar WCO2 = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].W();
64 HcCO2_ = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].Hc();
70 "COxidationKineticDiffusionLimitedRate"
75 ) << "Stoichiometry of reaction, Sb, must be greater than zero" << nl
81 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
83 template<class CloudType>
84 Foam::COxidationKineticDiffusionLimitedRate<CloudType>::
85 ~COxidationKineticDiffusionLimitedRate()
89 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
91 template<class CloudType>
92 bool Foam::COxidationKineticDiffusionLimitedRate<CloudType>::active() const
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,
113 const scalarField& dMassVolatile,
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 // Local mass fraction of O2 in the carrier phase
131 const scalar YO2 = this->owner().mcCarrierThermo().Y(O2GlobalId_)[cellI];
133 // Diffusion rate coefficient
134 const scalar D0 = C1_/d*pow(0.5*(T + Tc), 0.75);
137 const scalar Rk = C2_*exp(-E_/(specie::RR*Tc));
139 // Particle surface area
140 const scalar Ap = mathematicalConstant::pi*sqr(d);
142 // Change in C mass [kg]
143 scalar dmC = Ap*rhoc*specie::RR*Tc*YO2/WO2_*D0*Rk/(D0 + Rk);
145 // Limit mass transfer by availability of C
146 dmC = min(mass*fComb, dmC);
148 // Change in O2 mass [kg]
149 const scalar dmO2 = dmC/WC_*Sb_*WO2_;
151 // Mass of newly created CO2 [kg]
152 const scalar dmCO2 = dmC + dmO2;
154 // Update local particle C mass
155 dMassSolid[CsLocalId_] += dmC;
157 // Update carrier O2 and CO2 mass
158 dMassSRCarrier[O2GlobalId_] -= dmO2;
159 dMassSRCarrier[CO2GlobalId_] += dmCO2;
161 // Heat of reaction [J]
162 return -HcCO2_*dmCO2;
166 // ************************************************************************* //