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 -------------------------------------------------------------------------------
10 License
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 
30 template<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 
41 template<class ParcelType>
44 (
45  const constantProperties& cp
46 )
47 :
48  ParcelType::constantProperties(cp),
49  TDevol_(cp.TDevol_),
50  LDevol_(cp.LDevol_),
51  hRetentionCoeff_(cp.hRetentionCoeff_)
52 {}
53 
54 
55 template<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 
69 template<class ParcelType>
71 (
72  const polyMesh& mesh,
73  const barycentric& coordinates,
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),
83  canCombust_(0)
84 {}
85 
86 
87 template<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 
103 template<class ParcelType>
105 (
106  const polyMesh& mesh,
107  const barycentric& coordinates,
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,
129  coordinates,
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 
153 template<class ParcelType>
154 inline Foam::scalar
156 {
157  return TDevol_.value();
158 }
159 
160 
161 template<class ParcelType>
162 inline Foam::scalar
164 {
165  return LDevol_.value();
166 }
167 
168 
169 template<class ParcelType>
170 inline Foam::scalar
172 hRetentionCoeff() 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 
189 template<class ParcelType>
191 YGas() const
192 {
193  return YGas_;
194 }
195 
196 
197 template<class ParcelType>
199 YLiquid() const
200 {
201  return YLiquid_;
202 }
203 
204 
205 template<class ParcelType>
207 YSolid() const
208 {
209  return YSolid_;
210 }
211 
212 
213 template<class ParcelType>
214 inline Foam::label
216 {
217  return canCombust_;
218 }
219 
220 
221 template<class ParcelType>
223 {
224  return YGas_;
225 }
226 
227 
228 template<class ParcelType>
230 {
231  return YLiquid_;
232 }
233 
234 
235 template<class ParcelType>
237 {
238  return YSolid_;
239 }
240 
241 
242 template<class ParcelType>
244 {
245  return canCombust_;
246 }
247 
248 
249 // ************************************************************************* //
label canCombust() const
Return const access to the canCombust flag.
scalarList Y0(nSpecie, Zero)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:598
label canCombust_
Flag to identify if the particle can devolatilise and combust.
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:50
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
scalar LDevol() const
Return const access to the latent heat of devolatilisation.
const Type & value() const
Return the value.
ReactingMultiphaseParcel(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from mesh, position and topology.
scalarField YGas_
Mass fractions of gases [].
scalar hRetentionCoeff() const
Return const access to the fraction of enthalpy retained by.
dynamicFvMesh & mesh
const scalarField & YGas() const
Return const access to mass fractions of gases.
scalar TDevol() const
Return const access to the devolatilisation temperature.
scalarField YSolid_
Mass fractions of solids [].
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const scalarField & YLiquid() const
Return const access to mass fractions of liquids.
const volScalarField & cp
scalarField YLiquid_
Mass fractions of liquids [].
PtrList< coordinateSystem > coordinates(solidRegions.size())
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Class to hold reacting multiphase particle constant properties.
const scalarField & YSolid() const
Return const access to mass fractions of solids.