Loading...
Searching...
No Matches
COxidationIntrinsicRate.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2014-2016 OpenFOAM Foundation
9 Copyright (C) 2019-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
31
32using namespace Foam::constant;
33
34// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
35
36template<class CloudType>
38(
39 const dictionary& dict,
41)
42:
44 Sb_(this->coeffDict().getScalar("Sb")),
45 C1_(this->coeffDict().getScalar("C1")),
46 rMean_(this->coeffDict().getScalar("rMean")),
47 theta_(this->coeffDict().getScalar("theta")),
48 Ai_(this->coeffDict().getScalar("Ai")),
49 Ei_(this->coeffDict().getScalar("Ei")),
50 Ag_(this->coeffDict().getScalar("Ag")),
51 tau_(this->coeffDict().getOrDefault("tau", sqrt(2.0))),
52 CsLocalId_(-1),
53 O2GlobalId_(owner.composition().carrierId("O2")),
54 CO2GlobalId_(owner.composition().carrierId("CO2")),
55 WC_(0.0),
56 WO2_(0.0),
57 HcCO2_(0.0)
58{
59 // Determine Cs ids
60 label idSolid = owner.composition().idSolid();
61 CsLocalId_ = owner.composition().localId(idSolid, "C");
62
63 // Set local copies of thermo properties
64 WO2_ = owner.thermo().carrier().W(O2GlobalId_);
65 const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
66 WC_ = WCO2 - WO2_;
67
68 HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
69
70 if (Sb_ < 0)
71 {
73 << "Stoichiometry of reaction, Sb, must be greater than zero" << nl
74 << exit(FatalError);
75 }
76
77 const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_];
78 const scalar YSolidTot = owner.composition().YMixture0()[idSolid];
79 Info<< " C(s): particle mass fraction = " << YCloc*YSolidTot << endl;
80}
81
82
83template<class CloudType>
85(
87)
88:
90 Sb_(srm.Sb_),
91 C1_(srm.C1_),
92 rMean_(srm.rMean_),
93 theta_(srm.theta_),
94 Ai_(srm.Ai_),
95 Ei_(srm.Ei_),
96 Ag_(srm.Ag_),
97 tau_(srm.tau_),
98 CsLocalId_(srm.CsLocalId_),
99 O2GlobalId_(srm.O2GlobalId_),
100 CO2GlobalId_(srm.CO2GlobalId_),
101 WC_(srm.WC_),
102 WO2_(srm.WO2_),
103 HcCO2_(srm.HcCO2_)
104{}
105
106
107// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
108
109template<class CloudType>
111(
112 const scalar dt,
113 const scalar Re,
114 const scalar nu,
115 const label celli,
116 const scalar d,
117 const scalar T,
118 const scalar Tc,
119 const scalar pc,
120 const scalar rhoc,
121 const scalar mass,
122 const scalarField& YGas,
123 const scalarField& YLiquid,
124 const scalarField& YSolid,
125 const scalarField& YMixture,
126 const scalar N,
127 scalarField& dMassGas,
128 scalarField& dMassLiquid,
129 scalarField& dMassSolid,
130 scalarField& dMassSRCarrier
131) const
132{
133 // Fraction of remaining combustible material
134 const label idSolid = CloudType::parcelType::SLD;
135 const scalar Ychar = YMixture[idSolid]*YSolid[CsLocalId_];
136
137 // Surface combustion until combustible fraction is consumed
138 if (Ychar < SMALL)
139 {
140 return 0.0;
141 }
142
143 const SLGThermo& thermo = this->owner().thermo();
144
145 // Local mass fraction of O2 in the carrier phase []
146 const scalar YO2 = thermo.carrier().Y(O2GlobalId_)[celli];
147
148 // Quick exit if oxidant not present
149 if (YO2 < ROOTVSMALL)
150 {
151 return 0.0;
152 }
153
154 // Diffusion rate coefficient [m2/s]
155 const scalar D0 = C1_/d*pow(0.5*(T + Tc), 0.75);
156
157 // Apparent density of pyrolysis char [kg/m3]
158 const scalar rhop = 6.0*mass/(constant::mathematical::pi*pow3(d));
159
160 // Knusden diffusion coefficient [m2/s]
161 const scalar Dkn = 97.0*rMean_*sqrt(T/WO2_);
162
163 // Effective diffusion [m2/s]
164 const scalar De = theta_/sqr(tau_)/(1.0/Dkn + 1/D0);
165
166 // Cell carrier phase O2 species density [kg/m^3]
167 const scalar rhoO2 = rhoc*YO2;
168
169 // Partial pressure O2 [Pa]
170 const scalar ppO2 = rhoO2/WO2_*RR*Tc;
171
172 // Intrinsic reactivity [1/s]
173 const scalar ki = Ai_*exp(-Ei_/RR/T);
174
175 // Thiele modulus []
176 const scalar phi =
177 max(0.5*d*sqrt(Sb_*rhop*Ag_*ki*ppO2/(De*rhoO2)), ROOTVSMALL);
178
179 // Effectiveness factor []
180 const scalar eta = max(3.0/sqr(phi)*(phi/tanh(phi) - 1.0), 0.0);
181
182 // Chemical rate [kmol/m2/s]
183 const scalar R = eta*d/6.0*rhop*Ag_*ki;
184
185 // Particle surface area [m2]
186 const scalar Ap = constant::mathematical::pi*sqr(d);
187
188 // Change in C mass [kg]
189 scalar dmC = Ap*rhoc*RR*Tc*YO2/WO2_*D0*R/(D0 + R)*dt;
190
191 // Limit mass transfer by availability of C
192 dmC = min(mass*Ychar, dmC);
193
194 // Molar consumption [kmol]
195 const scalar dOmega = dmC/WC_;
196
197 // Change in O2 mass [kg]
198 const scalar dmO2 = dOmega*Sb_*WO2_;
199
200 // Mass of newly created CO2 [kg]
201 const scalar dmCO2 = dOmega*(WC_ + Sb_*WO2_);
202
203 // Update local particle C mass
204 dMassSolid[CsLocalId_] += dOmega*WC_;
205
206 // Update carrier O2 and CO2 mass
207 dMassSRCarrier[O2GlobalId_] -= dmO2;
208 dMassSRCarrier[CO2GlobalId_] += dmCO2;
209
210 const scalar HsC = thermo.solids().properties()[CsLocalId_].Hs(T);
211
212 // carrier sensible enthalpy exchange handled via change in mass
213
214 // Heat of reaction [J]
215 return dmC*HsC - dmCO2*HcCO2_;
216}
217
218
219// ************************************************************************* //
#define R(A, B, C, D, E, F, K, M)
Intrinsic char surface reaction mndel.
COxidationIntrinsicRate(const dictionary &dict, CloudType &owner)
Construct from dictionary.
virtual scalar calculate(const scalar dt, const scalar Re, const scalar nu, 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.
const CloudType & owner() const
Return const access to the owner cloud.
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
Definition SLGThermo.H:63
Templated surface reaction model class.
SurfaceReactionModel(CloudType &owner)
Construct null from owner.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
const dictionary & coeffDict() const
Return const access to the coefficients dictionary.
const dictionary & dict() const
Return const access to the cloud dictionary.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
basicSpecieMixture & composition
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition error.H:600
constexpr scalar pi(M_PI)
const scalar RR
Universal gas constant: default in [J/(kmol K)].
Different types of constants.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition hashSets.C:40
DSMCCloud< dsmcParcel > CloudType
dimensionedScalar exp(const dimensionedScalar &ds)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar pow3(const dimensionedScalar &ds)
dimensionedScalar tanh(const dimensionedScalar &ds)
messageStream Info
Information stream (stdout output on master, null elsewhere).
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
dimensionedScalar sqrt(const dimensionedScalar &ds)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition hashSets.C:26
scalarField Re(const UList< complex > &cmplx)
Extract real component.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition errorManip.H:125
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
constexpr char nl
The newline '\n' character (0x0a).
Definition Ostream.H:50
scalarList Y0(nSpecie, Zero)
volScalarField & nu
psiReactionThermo & thermo
const Vector< label > N(dict.get< Vector< label > >("N"))