ReactingMultiphaseParcelI.H
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) 2011-2017 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29
30template<class ParcelType>
33:
34 ParcelType::constantProperties(),
35 TDevol_(this->dict_, 0.0),
36 LDevol_(this->dict_, 0.0),
37 hRetentionCoeff_(this->dict_, 0.0)
38{}
39
40
41template<class ParcelType>
44(
46)
47:
48 ParcelType::constantProperties(cp),
49 TDevol_(cp.TDevol_),
50 LDevol_(cp.LDevol_),
51 hRetentionCoeff_(cp.hRetentionCoeff_)
52{}
53
54
55template<class ParcelType>
58(
59 const dictionary& parentDict
60)
61:
62 ParcelType::constantProperties(parentDict),
63 TDevol_(this->dict_, "TDevol"),
64 LDevol_(this->dict_, "LDevol"),
65 hRetentionCoeff_(this->dict_, "hRetentionCoeff")
66{}
67
68
69template<class ParcelType>
71(
72 const polyMesh& mesh,
74 const label celli,
75 const label tetFacei,
76 const label tetPti
77)
78:
79 ParcelType(mesh, coordinates, celli, tetFacei, tetPti),
80 YGas_(0),
81 YLiquid_(0),
82 YSolid_(0),
84{}
85
86
87template<class ParcelType>
89(
90 const polyMesh& mesh,
91 const vector& position,
92 const label celli
93)
94:
95 ParcelType(mesh, position, celli),
96 YGas_(0),
97 YLiquid_(0),
98 YSolid_(0),
99 canCombust_(0)
100{}
101
102
103template<class ParcelType>
105(
106 const polyMesh& mesh,
108 const label celli,
109 const label tetFacei,
110 const label tetPti,
111 const label typeId,
112 const scalar nParticle0,
113 const scalar d0,
114 const scalar dTarget0,
115 const vector& U0,
116 const vector& f0,
117 const vector& angularMomentum0,
118 const vector& torque0,
119 const scalarField& Y0,
120 const scalarField& YGas0,
121 const scalarField& YLiquid0,
122 const scalarField& YSolid0,
123 const constantProperties& constProps
124)
125:
126 ParcelType
127 (
128 mesh,
130 celli,
131 tetFacei,
132 tetPti,
133 typeId,
134 nParticle0,
135 d0,
136 dTarget0,
137 U0,
138 f0,
139 angularMomentum0,
140 torque0,
141 Y0,
142 constProps
143 ),
144 YGas_(YGas0),
145 YLiquid_(YLiquid0),
146 YSolid_(YSolid0),
147 canCombust_(0)
148{}
149
150
151// * * * * * * * * * constantProperties Member Functions * * * * * * * * * * //
152
153template<class ParcelType>
154inline Foam::scalar
156{
157 return TDevol_.value();
158}
159
160
161template<class ParcelType>
162inline Foam::scalar
164{
165 return LDevol_.value();
166}
167
168
169template<class ParcelType>
170inline Foam::scalar
172hRetentionCoeff() const
173{
174 scalar value = hRetentionCoeff_.value();
175
176 if ((value < 0) || (value > 1))
177 {
179 << "hRetentionCoeff must be in the range 0 to 1" << nl
180 << exit(FatalError) << endl;
181 }
182
183 return value;
184}
185
186
187// * * * * * * * * * * ThermoParcel Member Functions * * * * * * * * * * * * //
188
189template<class ParcelType>
191YGas() const
192{
193 return YGas_;
194}
195
196
197template<class ParcelType>
199YLiquid() const
200{
201 return YLiquid_;
202}
203
204
205template<class ParcelType>
207YSolid() const
208{
209 return YSolid_;
210}
211
212
213template<class ParcelType>
214inline Foam::label
216{
217 return canCombust_;
218}
219
220
221template<class ParcelType>
223{
224 return YGas_;
225}
226
227
228template<class ParcelType>
230{
231 return YLiquid_;
232}
233
234
235template<class ParcelType>
237{
238 return YSolid_;
239}
240
241
242template<class ParcelType>
244{
245 return canCombust_;
246}
247
248
249// ************************************************************************* //
Class to hold reacting multiphase particle constant properties.
scalar hRetentionCoeff() const
Return const access to the fraction of enthalpy retained by.
scalar TDevol() const
Return const access to the devolatilisation temperature.
scalar LDevol() const
Return const access to the latent heat of devolatilisation.
Multiphase variant of the reacting parcel class with one/two-way coupling with the continuous phase.
scalarField YLiquid_
Mass fractions of liquids [].
scalarField YSolid_
Mass fractions of solids [].
label canCombust_
Flag to identify if the particle can devolatilise and combust.
scalarField YGas_
Mass fractions of gases [].
label canCombust() const
Return const access to the canCombust flag.
const scalarField & YGas() const
Return const access to mass fractions of gases.
const scalarField & YSolid() const
Return const access to mass fractions of solids.
const scalarField & YLiquid() const
Return const access to mass fractions of liquids.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
dynamicFvMesh & mesh
PtrList< coordinateSystem > coordinates(solidRegions.size())
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
error FatalError
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
scalarList Y0(nSpecie, Zero)
const volScalarField & cp