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 // ************************************************************************* //
cp
const volScalarField & cp
Definition: setRegionSolidFields.H:8
Foam::ReactingMultiphaseParcel::YGas
const scalarField & YGas() const
Definition: ReactingMultiphaseParcelI.H:184
Foam::endl
Ostream & endl(Ostream &os)
Definition: Ostream.H:381
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:73
Foam::ReactingMultiphaseParcel::canCombust
label canCombust() const
Definition: ReactingMultiphaseParcelI.H:208
Foam::ReactingMultiphaseParcel::constantProperties
Definition: ReactingMultiphaseParcel.H:79
Foam::ReactingMultiphaseParcel::canCombust_
label canCombust_
Definition: ReactingMultiphaseParcel.H:202
Foam::Field
Generic templated field type.
Definition: Field.H:59
coordinates
PtrList< coordinateSystem > coordinates(solidRegions.size())
Foam::ReactingMultiphaseParcel::constantProperties::TDevol
scalar TDevol() const
Definition: ReactingMultiphaseParcelI.H:148
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:119
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::ReactingMultiphaseParcel::YLiquid
const scalarField & YLiquid() const
Definition: ReactingMultiphaseParcelI.H:192
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
FatalErrorInFunction
#define FatalErrorInFunction
Definition: error.H:465
Foam::cp
bool cp(const fileName &src, const fileName &dst, const bool followLink=true)
Definition: POSIX.C:975
Foam::nl
constexpr char nl
Definition: Ostream.H:424
Foam::Vector< scalar >
Foam::ReactingMultiphaseParcel::YLiquid_
scalarField YLiquid_
Definition: ReactingMultiphaseParcel.H:191
Foam::ReactingMultiphaseParcel::YSolid
const scalarField & YSolid() const
Definition: ReactingMultiphaseParcelI.H:200
Foam::ReactingMultiphaseParcel::constantProperties::constantProperties
constantProperties()
Definition: ReactingMultiphaseParcelI.H:25
Foam::ReactingMultiphaseParcel::YGas_
scalarField YGas_
Definition: ReactingMultiphaseParcel.H:188
Foam::ReactingMultiphaseParcel::constantProperties::hRetentionCoeff
scalar hRetentionCoeff() const
Definition: ReactingMultiphaseParcelI.H:165
Foam::ReactingMultiphaseParcel::ReactingMultiphaseParcel
ReactingMultiphaseParcel(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Definition: ReactingMultiphaseParcelI.H:64
Y0
scalarList Y0(nSpecie, Zero)
Foam::ReactingMultiphaseParcel::constantProperties::LDevol
scalar LDevol() const
Definition: ReactingMultiphaseParcelI.H:156
Foam::ReactingMultiphaseParcel::YSolid_
scalarField YSolid_
Definition: ReactingMultiphaseParcel.H:194
Foam::demandDrivenEntry::value
const Type & value() const
Definition: demandDrivenEntryI.H:37