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
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 // ************************************************************************* //
Foam::ReactingMultiphaseParcel::YGas
const scalarField & YGas() const
Return const access to mass fractions of gases.
Definition: ReactingMultiphaseParcelI.H:191
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::ReactingMultiphaseParcel::canCombust
label canCombust() const
Return const access to the canCombust flag.
Definition: ReactingMultiphaseParcelI.H:215
Foam::ReactingMultiphaseParcel::constantProperties
Class to hold reacting multiphase particle constant properties.
Definition: ReactingMultiphaseParcel.H:83
Foam::ReactingMultiphaseParcel::canCombust_
label canCombust_
Flag to identify if the particle can devolatilise and combust.
Definition: ReactingMultiphaseParcel.H:206
Foam::Field< scalar >
coordinates
PtrList< coordinateSystem > coordinates(solidRegions.size())
Foam::ReactingMultiphaseParcel::constantProperties::TDevol
scalar TDevol() const
Return const access to the devolatilisation temperature.
Definition: ReactingMultiphaseParcelI.H:155
Foam::Barycentric< scalar >
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::ReactingMultiphaseParcel::YLiquid
const scalarField & YLiquid() const
Return const access to mass fractions of liquids.
Definition: ReactingMultiphaseParcelI.H:199
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Foam::cp
bool cp(const fileName &src, const fileName &dst, const bool followLink=true)
Copy the source to the destination (recursively if necessary).
Definition: MSwindows.C:802
Foam::nl
constexpr char nl
Definition: Ostream.H:404
Foam::Vector< scalar >
Foam::ReactingMultiphaseParcel::YLiquid_
scalarField YLiquid_
Mass fractions of liquids [].
Definition: ReactingMultiphaseParcel.H:195
Foam::ReactingMultiphaseParcel::YSolid
const scalarField & YSolid() const
Return const access to mass fractions of solids.
Definition: ReactingMultiphaseParcelI.H:207
Foam::ReactingMultiphaseParcel::constantProperties::constantProperties
constantProperties()
Null constructor.
Definition: ReactingMultiphaseParcelI.H:32
Foam::ReactingMultiphaseParcel::YGas_
scalarField YGas_
Mass fractions of gases [].
Definition: ReactingMultiphaseParcel.H:192
Foam::ReactingMultiphaseParcel::constantProperties::hRetentionCoeff
scalar hRetentionCoeff() const
Return const access to the fraction of enthalpy retained by.
Definition: ReactingMultiphaseParcelI.H:172
Foam::ReactingMultiphaseParcel::ReactingMultiphaseParcel
ReactingMultiphaseParcel(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from mesh, position and topology.
Definition: ReactingMultiphaseParcelI.H:71
Y0
scalarList Y0(nSpecie, Zero)
Foam::ReactingMultiphaseParcel::constantProperties::LDevol
scalar LDevol() const
Return const access to the latent heat of devolatilisation.
Definition: ReactingMultiphaseParcelI.H:163
Foam::ReactingMultiphaseParcel::YSolid_
scalarField YSolid_
Mass fractions of solids [].
Definition: ReactingMultiphaseParcel.H:198