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-2015 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 // ************************************************************************* //
Foam::ReactingMultiphaseParcel::YGas
const scalarField & YGas() const
Return const access to mass fractions of gases.
Definition: ReactingMultiphaseParcelI.H:173
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::cp
bool cp(const fileName &src, const fileName &dst)
Copy, recursively if necessary, the source to the destination.
Definition: POSIX.C:755
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::ReactingMultiphaseParcel::canCombust
label canCombust() const
Return const access to the canCombust flag.
Definition: ReactingMultiphaseParcelI.H:197
Foam::ReactingMultiphaseParcel::constantProperties
Class to hold reacting multiphase particle constant properties.
Definition: ReactingMultiphaseParcel.H:84
Foam::ReactingMultiphaseParcel::canCombust_
label canCombust_
Flag to identify if the particle can devolatilise and combust.
Definition: ReactingMultiphaseParcel.H:200
Foam::label
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
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::nl
static const char nl
Definition: Ostream.H:260
Y0
scalarList Y0(nSpecie, 0.0)
Foam::ReactingMultiphaseParcel::constantProperties::TDevol
scalar TDevol() const
Return const access to the devolatilisation temperature.
Definition: ReactingMultiphaseParcelI.H:137
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::ReactingMultiphaseParcel::YLiquid
const scalarField & YLiquid() const
Return const access to mass fractions of liquids.
Definition: ReactingMultiphaseParcelI.H:181
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:318
Foam::Vector< scalar >
Foam::ReactingMultiphaseParcel::YLiquid_
scalarField YLiquid_
Mass fractions of liquids [].
Definition: ReactingMultiphaseParcel.H:189
Foam::ReactingMultiphaseParcel::YSolid
const scalarField & YSolid() const
Return const access to mass fractions of solids.
Definition: ReactingMultiphaseParcelI.H:189
Foam::ReactingMultiphaseParcel::constantProperties::constantProperties
constantProperties()
Null constructor.
Definition: ReactingMultiphaseParcelI.H:30
Foam::ReactingMultiphaseParcel::YGas_
scalarField YGas_
Mass fractions of gases [].
Definition: ReactingMultiphaseParcel.H:186
Foam::ReactingMultiphaseParcel::constantProperties::hRetentionCoeff
scalar hRetentionCoeff() const
Return const access to the fraction of enthalpy retained by.
Definition: ReactingMultiphaseParcelI.H:154
Foam::ReactingMultiphaseParcel::ReactingMultiphaseParcel
ReactingMultiphaseParcel(const polyMesh &mesh, const vector &position, const label cellI, const label tetFaceI, const label tetPtI)
Construct from owner, position, and cloud owner.
Definition: ReactingMultiphaseParcelI.H:69
Foam::ReactingMultiphaseParcel::constantProperties::LDevol
scalar LDevol() const
Return const access to the latent heat of devolatilisation.
Definition: ReactingMultiphaseParcelI.H:145
Foam::ReactingMultiphaseParcel::YSolid_
scalarField YSolid_
Mass fractions of solids [].
Definition: ReactingMultiphaseParcel.H:192