COxidationHurtMitchell.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "COxidationHurtMitchell.H"
27 #include "mathematicalConstants.H"
28 
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 
31 template<class CloudType>
33 (
34  const dictionary& dict,
35  CloudType& owner
36 )
37 :
38  SurfaceReactionModel<CloudType>(dict, owner, typeName),
39  Sb_(readScalar(this->coeffDict().lookup("Sb"))),
40  CsLocalId_(-1),
41  ashLocalId_(-1),
42  O2GlobalId_(owner.composition().carrierId("O2")),
43  CO2GlobalId_(owner.composition().carrierId("CO2")),
44  WC_(0.0),
45  WO2_(0.0),
46  HcCO2_(0.0),
47  heatOfReaction_(-1.0)
48 {
49  // Determine Cs and ash ids
50  label idSolid = owner.composition().idSolid();
51  CsLocalId_ = owner.composition().localId(idSolid, "C");
52  ashLocalId_ = owner.composition().localId(idSolid, "ash", true);
53 
54  // Set local copies of thermo properties
55  WO2_ = owner.thermo().carrier().W(O2GlobalId_);
56  const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
57  WC_ = WCO2 - WO2_;
58 
59  HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
60 
61  const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_];
62  const scalar YSolidTot = owner.composition().YMixture0()[idSolid];
63  Info<< " C(s): particle mass fraction = " << YCloc*YSolidTot << endl;
64 
65  if (this->coeffDict().readIfPresent("heatOfReaction", heatOfReaction_))
66  {
67  Info<< " Using user specified heat of reaction: "
68  << heatOfReaction_ << " [J/kg]" << endl;
69  }
70 }
71 
72 
73 template<class CloudType>
75 (
77 )
78 :
80  Sb_(srm.Sb_),
81  CsLocalId_(srm.CsLocalId_),
82  ashLocalId_(srm.ashLocalId_),
83  O2GlobalId_(srm.O2GlobalId_),
84  CO2GlobalId_(srm.CO2GlobalId_),
85  WC_(srm.WC_),
86  WO2_(srm.WO2_),
87  HcCO2_(srm.HcCO2_),
88  heatOfReaction_(srm.heatOfReaction_)
89 {}
90 
91 
92 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
93 
94 template<class CloudType>
96 {}
97 
98 
99 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
100 
101 template<class CloudType>
103 (
104  const scalar dt,
105  const label celli,
106  const scalar d,
107  const scalar T,
108  const scalar Tc,
109  const scalar pc,
110  const scalar rhoc,
111  const scalar mass,
112  const scalarField& YGas,
113  const scalarField& YLiquid,
114  const scalarField& YSolid,
115  const scalarField& YMixture,
116  const scalar N,
117  scalarField& dMassGas,
118  scalarField& dMassLiquid,
119  scalarField& dMassSolid,
120  scalarField& dMassSRCarrier
121 ) const
122 {
123  const label idGas = CloudType::parcelType::GAS;
124  const label idSolid = CloudType::parcelType::SLD;
125  const scalar Ychar = YMixture[idSolid]*YSolid[CsLocalId_];
126 
127  // Surface combustion until combustible fraction is consumed
128  if (Ychar < SMALL)
129  {
130  return 0.0;
131  }
132 
133  const SLGThermo& thermo = this->owner().thermo();
134 
135  // Local mass fraction of O2 in the carrier phase
136  const scalar YO2 = thermo.carrier().Y(O2GlobalId_)[celli];
137 
138  // No combustion if no oxygen present
139  if (YO2 < SMALL)
140  {
141  return 0.0;
142  }
143 
144  // Conversion from [g/cm^2) to [kg/m^2]
145  const scalar convSI = 1000.0/10000.0;
146 
147  // Universal gas constant in [kcal/mol/K]
148  const scalar RRcal = 1985.877534;
149 
150  // Dry mass fraction
151  scalar Ydaf = YMixture[idGas] + YMixture[idSolid];
152  if (ashLocalId_ != -1)
153  {
154  Ydaf -= YMixture[idSolid]*YSolid[ashLocalId_];
155  }
156 
157  // Char percentage
158  const scalar charPrc = max(0, min(Ychar/(Ydaf + ROOTVSMALL)*100.0, 100));
159 
160  // Particle surface area
161  const scalar Ap = constant::mathematical::pi*sqr(d);
162 
163  // Far field partial pressure O2 [Pa]
164  // Note: Should really use the surface partial pressure
165  const scalar ppO2 = max(0.0, rhoc*YO2/WO2_*RR*Tc);
166 
167  // Activation energy [kcal/mol]
168  const scalar E = -5.94 + 0.355*charPrc;
169 
170  // Pre-exponential factor [g/(cm^2.s.atm^0.5)]
171  const scalar lnK1750 = 2.8 - 0.0758*charPrc;
172  const scalar A = exp(lnK1750 + E/RRcal/1750.0);
173 
174  // Kinetic rate of char oxidation [g/(cm^2.s.atm^0.5)]
175  const scalar Rk = A*exp(-E/(RRcal*T));
176 
177  // Molar reaction rate per unit surface area [kmol/(m^2.s)]
178  const scalar qCsLim = mass*Ychar/(WC_*Ap*dt);
179  const scalar qCs = min(convSI*Rk*Foam::sqrt(ppO2/101325.0), qCsLim);
180 
181  // Calculate the number of molar units reacted [kmol]
182  const scalar dOmega = qCs*Ap*dt;
183 
184  // Add to carrier phase mass transfer
185  dMassSRCarrier[O2GlobalId_] += -dOmega*Sb_*WO2_;
186  dMassSRCarrier[CO2GlobalId_] += dOmega*(WC_ + Sb_*WO2_);
187 
188  // Add to particle mass transfer
189  dMassSolid[CsLocalId_] += dOmega*WC_;
190 
191 
192  // Return the heat of reaction [J]
193  // note: carrier sensible enthalpy exchange handled via change in mass
194  if (heatOfReaction_ < 0)
195  {
196  const scalar HsC = thermo.solids().properties()[CsLocalId_].Hs(T);
197  return dOmega*(WC_*HsC - (WC_ + Sb_*WO2_)*HcCO2_);
198  }
199  else
200  {
201  return dOmega*WC_*heatOfReaction_;
202  }
203 }
204 
205 
206 // ************************************************************************* //
#define readScalar
Definition: doubleScalar.C:38
dictionary dict
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
const PtrList< solidProperties > & properties() const
Return the solidProperties properties.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
const solidMixtureProperties & solids() const
Return reference to the global (additional) solids.
Definition: SLGThermo.C:134
PtrList< volScalarField > & Y()
Return the mass-fraction fields.
stressControl lookup("compactNormalStress") >> compactNormalStress
dimensionedScalar exp(const dimensionedScalar &ds)
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package, and provides:
Definition: SLGThermo.H:62
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
virtual ~COxidationHurtMitchell()
Destructor.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const basicSpecieMixture & carrier() const
Return reference to the gaseous components.
Definition: SLGThermo.C:108
COxidationHurtMitchell(const dictionary &dict, CloudType &owner)
Construct from dictionary.
virtual scalar calculate(const scalar dt, const label celli, const scalar d, const scalar T, const scalar Tc, const scalar pc, const scalar rhoc, const scalar mass, const scalarField &YGas, const scalarField &YLiquid, const scalarField &YSolid, const scalarField &YMixture, const scalar N, scalarField &dMassGas, scalarField &dMassLiquid, scalarField &dMassSolid, scalarField &dMassSRCarrier) const
Update surface reactions.
messageStream Info
const scalar RR
Universal gas constant (default in [J/(kmol K)])
Char oxidation model given by Hurt and Mitchell:
Templated surface reaction model class.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:69