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-2016 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  << "hRetentionCoeff must be in the range 0 to 1" << nl
162  << exit(FatalError) << endl;
163  }
164 
165  return value;
166 }
167 
168 
169 // * * * * * * * * * * ThermoParcel Member Functions * * * * * * * * * * * * //
170 
171 template<class ParcelType>
173 YGas() const
174 {
175  return YGas_;
176 }
177 
178 
179 template<class ParcelType>
181 YLiquid() const
182 {
183  return YLiquid_;
184 }
185 
186 
187 template<class ParcelType>
189 YSolid() const
190 {
191  return YSolid_;
192 }
193 
194 
195 template<class ParcelType>
196 inline Foam::label
198 {
199  return canCombust_;
200 }
201 
202 
203 template<class ParcelType>
205 {
206  return YGas_;
207 }
208 
209 
210 template<class ParcelType>
212 {
213  return YLiquid_;
214 }
215 
216 
217 template<class ParcelType>
219 {
220  return YSolid_;
221 }
222 
223 
224 template<class ParcelType>
226 {
227  return canCombust_;
228 }
229 
230 
231 // ************************************************************************* //
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
error FatalError
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
label canCombust_
Flag to identify if the particle can devolatilise and combust.
scalar hRetentionCoeff() const
Return const access to the fraction of enthalpy retained by.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
const Type & value() const
Return the value.
scalar TDevol() const
Return const access to the devolatilisation temperature.
label canCombust() const
Return const access to the canCombust flag.
scalarField YGas_
Mass fractions of gases [].
ReactingMultiphaseParcel(const polyMesh &mesh, const vector &position, const label celli, const label tetFacei, const label tetPtI)
Construct from owner, position, and cloud owner.
const scalarField & YLiquid() const
Return const access to mass fractions of liquids.
const scalarField & YGas() const
Return const access to mass fractions of gases.
scalarField YSolid_
Mass fractions of solids [].
static const char nl
Definition: Ostream.H:262
scalar LDevol() const
Return const access to the latent heat of devolatilisation.
scalarField YLiquid_
Mass fractions of liquids [].
const scalarField & YSolid() const
Return const access to mass fractions of solids.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Class to hold reacting multiphase particle constant properties.