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 | Copyright (C) 2011-2013 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 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
27 
28 template<class ParcelType>
31 :
32  ParcelType::constantProperties(),
33  TDevol_(this->dict_, 0.0),
34  LDevol_(this->dict_, 0.0),
35  hRetentionCoeff_(this->dict_, 0.0)
36 {}
37 
38 
39 template<class ParcelType>
42 (
43  const constantProperties& cp
44 )
45 :
46  ParcelType::constantProperties(cp),
47  TDevol_(cp.TDevol_),
48  LDevol_(cp.LDevol_),
49  hRetentionCoeff_(cp.hRetentionCoeff_)
50 {}
51 
52 
53 template<class ParcelType>
56 (
57  const dictionary& parentDict
58 )
59 :
60  ParcelType::constantProperties(parentDict),
61  TDevol_(this->dict_, "TDevol"),
62  LDevol_(this->dict_, "LDevol"),
63  hRetentionCoeff_(this->dict_, "hRetentionCoeff")
64 {}
65 
66 
67 template<class ParcelType>
69 (
70  const polyMesh& mesh,
71  const vector& position,
72  const label cellI,
73  const label tetFaceI,
74  const label tetPtI
75 )
76 :
77  ParcelType(mesh, position, cellI, tetFaceI, tetPtI),
78  YGas_(0),
79  YLiquid_(0),
80  YSolid_(0),
81  canCombust_(0)
82 {}
83 
84 
85 template<class ParcelType>
87 (
88  const polyMesh& mesh,
89  const vector& position,
90  const label cellI,
91  const label tetFaceI,
92  const label tetPtI,
93  const label typeId,
94  const scalar nParticle0,
95  const scalar d0,
96  const scalar dTarget0,
97  const vector& U0,
98  const vector& f0,
99  const vector& angularMomentum0,
100  const vector& torque0,
101  const scalarField& Y0,
102  const scalarField& YGas0,
103  const scalarField& YLiquid0,
104  const scalarField& YSolid0,
105  const constantProperties& constProps
106 )
107 :
108  ParcelType
109  (
110  mesh,
111  position,
112  cellI,
113  tetFaceI,
114  tetPtI,
115  typeId,
116  nParticle0,
117  d0,
118  dTarget0,
119  U0,
120  f0,
121  angularMomentum0,
122  torque0,
123  Y0,
124  constProps
125  ),
126  YGas_(YGas0),
127  YLiquid_(YLiquid0),
128  YSolid_(YSolid0),
129  canCombust_(0)
130 {}
131 
132 
133 // * * * * * * * * * constantProperties Member Functions * * * * * * * * * * //
134 
135 template<class ParcelType>
136 inline Foam::scalar
138 {
139  return TDevol_.value();
140 }
141 
142 
143 template<class ParcelType>
144 inline Foam::scalar
146 {
147  return LDevol_.value();
148 }
149 
150 
151 template<class ParcelType>
152 inline Foam::scalar
155 {
156  scalar value = hRetentionCoeff_.value();
157 
158  if ((value < 0) || (value > 1))
159  {
161  (
162  "ReactingMultiphaseParcel<ParcelType>::constantProperties::"
163  "constantProperties"
164  ) << "hRetentionCoeff must be in the range 0 to 1" << nl
165  << exit(FatalError) << endl;
166  }
167 
168  return value;
169 }
170 
171 
172 // * * * * * * * * * * ThermoParcel Member Functions * * * * * * * * * * * * //
173 
174 template<class ParcelType>
176 YGas() const
177 {
178  return YGas_;
179 }
180 
181 
182 template<class ParcelType>
184 YLiquid() const
185 {
186  return YLiquid_;
187 }
188 
189 
190 template<class ParcelType>
192 YSolid() const
193 {
194  return YSolid_;
195 }
196 
197 
198 template<class ParcelType>
199 inline Foam::label
201 {
202  return canCombust_;
203 }
204 
205 
206 template<class ParcelType>
208 {
209  return YGas_;
210 }
211 
212 
213 template<class ParcelType>
215 {
216  return YLiquid_;
217 }
218 
219 
220 template<class ParcelType>
222 {
223  return YSolid_;
224 }
225 
226 
227 template<class ParcelType>
229 {
230  return canCombust_;
231 }
232 
233 
234 // ************************************************************************* //
scalarField YSolid_
Mass fractions of solids [].
const scalarField & YLiquid() const
Return const access to mass fractions of liquids.
const scalarField & YSolid() const
Return const access to mass fractions of solids.
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
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
static const char nl
Definition: Ostream.H:260
scalar hRetentionCoeff() const
Return const access to the fraction of enthalpy retained by.
scalar LDevol() const
Return const access to the latent heat of devolatilisation.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
label canCombust() const
Return const access to the canCombust flag.
scalarField YLiquid_
Mass fractions of liquids [].
const scalarField & YGas() const
Return const access to mass fractions of gases.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Definition: error.H:314
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
error FatalError
label canCombust_
Flag to identify if the particle can devolatilise and combust.
Class to hold reacting multiphase particle constant properties.
scalar TDevol() const
Return const access to the devolatilisation temperature.
const Type & value() const
Return the value.
ReactingMultiphaseParcel(const polyMesh &mesh, const vector &position, const label cellI, const label tetFaceI, const label tetPtI)
Construct from owner, position, and cloud owner.
scalarField YGas_
Mass fractions of gases [].