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 "COxidationMurphyShaddix.H"
27 #include "mathematicalConstants.H"
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 template<class CloudType>
32 Foam::label Foam::COxidationMurphyShaddix<CloudType>::maxIters_ = 1000;
34 template<class CloudType>
35 Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::tolerance_ = 1e-06;
38 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
40 template<class CloudType>
41 Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
43 const dictionary& dict,
47 SurfaceReactionModel<CloudType>(dict, owner, typeName),
48 D0_(readScalar(this->coeffDict().lookup("D0"))),
49 rho0_(readScalar(this->coeffDict().lookup("rho0"))),
50 T0_(readScalar(this->coeffDict().lookup("T0"))),
51 Dn_(readScalar(this->coeffDict().lookup("Dn"))),
52 A_(readScalar(this->coeffDict().lookup("A"))),
53 E_(readScalar(this->coeffDict().lookup("E"))),
54 n_(readScalar(this->coeffDict().lookup("n"))),
55 WVol_(readScalar(this->coeffDict().lookup("WVol"))),
57 O2GlobalId_(owner.composition().globalCarrierId("O2")),
58 CO2GlobalId_(owner.composition().globalCarrierId("CO2")),
64 label idSolid = owner.composition().idSolid();
65 CsLocalId_ = owner.composition().localId(idSolid, "C");
67 // Set local copies of thermo properties
68 WO2_ = owner.thermo().carrier().W(O2GlobalId_);
69 const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
72 HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
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::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
83 const COxidationMurphyShaddix<CloudType>& srm
86 SurfaceReactionModel<CloudType>(srm),
95 CsLocalId_(srm.CsLocalId_),
96 O2GlobalId_(srm.O2GlobalId_),
97 CO2GlobalId_(srm.CO2GlobalId_),
103 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
105 template<class CloudType>
106 Foam::COxidationMurphyShaddix<CloudType>::~COxidationMurphyShaddix()
110 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
112 template<class CloudType>
113 Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::calculate
123 const scalarField& YGas,
124 const scalarField& YLiquid,
125 const scalarField& YSolid,
126 const scalarField& YMixture,
128 scalarField& dMassGas,
129 scalarField& dMassLiquid,
130 scalarField& dMassSolid,
131 scalarField& dMassSRCarrier
134 // Fraction of remaining combustible material
135 const label idSolid = CloudType::parcelType::SLD;
136 const scalar fComb = YMixture[idSolid]*YSolid[CsLocalId_];
138 // Surface combustion until combustible fraction is consumed
144 const SLGThermo& thermo = this->owner().thermo();
146 // Cell carrier phase O2 species density [kg/m^3]
147 const scalar rhoO2 = rhoc*thermo.carrier().Y(O2GlobalId_)[cellI];
154 // Particle surface area [m^2]
155 const scalar Ap = constant::mathematical::pi*sqr(d);
157 // Calculate diffision constant at continuous phase temperature
158 // and density [m^2/s]
159 const scalar D = D0_*(rho0_/rhoc)*pow(Tc/T0_, Dn_);
161 // Far field partial pressure O2 [Pa]
162 const scalar ppO2 = rhoO2/WO2_*specie::RR*Tc;
164 // Total molar concentration of the carrier phase [kmol/m^3]
165 const scalar C = pc/(specie::RR*Tc);
169 Pout<< "mass = " << mass << nl
170 << "fComb = " << fComb << nl
171 << "Ap = " << Ap << nl
172 << "dt = " << dt << nl
177 // Molar reaction rate per unit surface area [kmol/(m^2.s)]
181 const scalar qCsLim = mass*fComb/(WC_*Ap*dt);
185 Pout<< "qCsLim = " << qCsLim << endl;
189 while ((mag(qCs - qCsOld)/qCs > tolerance_) && (iter <= maxIters_))
192 const scalar PO2Surface = ppO2*exp(-(qCs + N)*d/(2*C*D));
193 qCs = A_*exp(-E_/(specie::RR*T))*pow(PO2Surface, n_);
194 qCs = (100.0*qCs + iter*qCsOld)/(100.0 + iter);
195 qCs = min(qCs, qCsLim);
199 Pout<< "iter = " << iter
200 << ", qCsOld = " << qCsOld
208 if (iter > maxIters_)
212 "scalar Foam::COxidationMurphyShaddix<CloudType>::calculate(...)"
213 ) << "iter limit reached (" << maxIters_ << ")" << nl << endl;
216 // Calculate the number of molar units reacted
217 scalar dOmega = qCs*Ap*dt;
219 // Add to carrier phase mass transfer
220 dMassSRCarrier[O2GlobalId_] += -dOmega*WO2_;
221 dMassSRCarrier[CO2GlobalId_] += dOmega*(WC_ + WO2_);
223 // Add to particle mass transfer
224 dMassSolid[CsLocalId_] += dOmega*WC_;
226 const scalar HsC = thermo.solids().properties()[CsLocalId_].Hs(T);
228 // carrier sensible enthalpy exchange handled via change in mass
230 // Heat of reaction [J]
231 return dOmega*(WC_*HsC - (WC_ + WO2_)*HcCO2_);
235 // ************************************************************************* //