FreeFOAM The Cross-Platform CFD Toolkit
COxidationKineticDiffusionLimitedRate.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) 2008-2010 OpenCFD Ltd.
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 
28 
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 
31 template<class CloudType>
34 (
35  const dictionary& dict,
36  CloudType& owner
37 )
38 :
40  (
41  dict,
42  owner,
43  typeName
44  ),
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()),
49  CsLocalId_(-1),
50  O2GlobalId_(owner.composition().globalCarrierId("O2")),
51  CO2GlobalId_(owner.composition().globalCarrierId("CO2")),
52  WC_(0.0),
53  WO2_(0.0),
54  HcCO2_(0.0)
55 {
56  // Determine Cs ids
57  label idSolid = owner.composition().idSolid();
58  CsLocalId_ = owner.composition().localId(idSolid, "C");
59 
60  // Set local copies of thermo properties
61  WO2_ = owner.mcCarrierThermo().speciesData()[O2GlobalId_].W();
62  scalar WCO2 = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].W();
63  WC_ = WCO2 - WO2_;
64  HcCO2_ = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].Hc();
65 
66  if (Sb_ < 0)
67  {
69  (
70  "COxidationKineticDiffusionLimitedRate"
71  "("
72  "const dictionary&, "
73  "CloudType&"
74  ")"
75  ) << "Stoichiometry of reaction, Sb, must be greater than zero" << nl
76  << exit(FatalError);
77  }
78 }
79 
80 
81 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
82 
83 template<class CloudType>
86 {}
87 
88 
89 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
90 
91 template<class CloudType>
93 {
94  return true;
95 }
96 
97 
98 template<class CloudType>
100 (
101  const scalar dt,
102  const label cellI,
103  const scalar d,
104  const scalar T,
105  const scalar Tc,
106  const scalar pc,
107  const scalar rhoc,
108  const scalar mass,
109  const scalarField& YGas,
110  const scalarField& YLiquid,
111  const scalarField& YSolid,
112  const scalarField& YMixture,
113  const scalar N,
114  scalarField& dMassGas,
115  scalarField& dMassLiquid,
116  scalarField& dMassSolid,
117  scalarField& dMassSRCarrier
118 ) const
119 {
120  // Fraction of remaining combustible material
121  const label idSolid = CloudType::parcelType::SLD;
122  const scalar fComb = YMixture[idSolid]*YSolid[CsLocalId_];
123 
124  // Surface combustion active combustible fraction is consumed
125  if (fComb < SMALL)
126  {
127  return 0.0;
128  }
129 
130  // Local mass fraction of O2 in the carrier phase
131  const scalar YO2 = this->owner().mcCarrierThermo().Y(O2GlobalId_)[cellI];
132 
133  // Diffusion rate coefficient
134  const scalar D0 = C1_/d*pow(0.5*(T + Tc), 0.75);
135 
136  // Kinetic rate
137  const scalar Rk = C2_*exp(-E_/(specie::RR*Tc));
138 
139  // Particle surface area
140  const scalar Ap = mathematicalConstant::pi*sqr(d);
141 
142  // Change in C mass [kg]
143  scalar dmC = Ap*rhoc*specie::RR*Tc*YO2/WO2_*D0*Rk/(D0 + Rk)*dt;
144 
145  // Limit mass transfer by availability of C
146  dmC = min(mass*fComb, dmC);
147 
148  // Change in O2 mass [kg]
149  const scalar dmO2 = dmC/WC_*Sb_*WO2_;
150 
151  // Mass of newly created CO2 [kg]
152  const scalar dmCO2 = dmC + dmO2;
153 
154  // Update local particle C mass
155  dMassSolid[CsLocalId_] += dmC;
156 
157  // Update carrier O2 and CO2 mass
158  dMassSRCarrier[O2GlobalId_] -= dmO2;
159  dMassSRCarrier[CO2GlobalId_] += dmCO2;
160 
161  // Heat of reaction [J]
162  return -HcCO2_*dmCO2;
163 }
164 
165 
166 // ************************ vim: set sw=4 sts=4 et: ************************ //