ThermoParcelI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 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>
30 :
31  ParcelType::constantProperties(),
32  T0_(this->dict_, 0.0),
33  TMin_(this->dict_, 0.0),
34  TMax_(this->dict_, vGreat),
35  Cp0_(this->dict_, 0.0),
36  epsilon0_(this->dict_, 0.0),
37  f0_(this->dict_, 0.0)
38 {}
39 
40 
41 template<class ParcelType>
43 (
44  const constantProperties& cp
45 )
46 :
47  ParcelType::constantProperties(cp),
48  T0_(cp.T0_),
49  TMin_(cp.TMin_),
50  TMax_(cp.TMax_),
51  Cp0_(cp.Cp0_),
52  epsilon0_(cp.epsilon0_),
53  f0_(cp.f0_)
54 {}
55 
56 
57 template<class ParcelType>
59 (
60  const dictionary& parentDict
61 )
62 :
63  ParcelType::constantProperties(parentDict),
64  T0_(this->dict_, "T0"),
65  TMin_(this->dict_, "TMin", 200.0),
66  TMax_(this->dict_, "TMax", 5000.0),
67  Cp0_(this->dict_, "Cp0"),
68  epsilon0_(this->dict_, "epsilon0"),
69  f0_(this->dict_, "f0")
70 {}
71 
72 
73 template<class ParcelType>
75 (
76  const polyMesh& mesh,
77  const barycentric& coordinates,
78  const label celli,
79  const label tetFacei,
80  const label tetPti
81 )
82 :
83  ParcelType(mesh, coordinates, celli, tetFacei, tetPti),
84  T_(0.0),
85  Cp_(0.0)
86 {}
87 
88 
89 template<class ParcelType>
91 (
92  const polyMesh& mesh,
93  const vector& position,
94  const label celli
95 )
96 :
97  ParcelType(mesh, position, celli),
98  T_(0.0),
99  Cp_(0.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 constantProperties& constProps
120 )
121 :
122  ParcelType
123  (
124  mesh,
125  coordinates,
126  celli,
127  tetFacei,
128  tetPti,
129  typeId,
130  nParticle0,
131  d0,
132  dTarget0,
133  U0,
134  f0,
135  angularMomentum0,
136  torque0,
137  constProps
138  ),
139  T_(constProps.T0()),
140  Cp_(constProps.Cp0())
141 {}
142 
143 
144 // * * * * * * * * * constantProperties Member Functions * * * * * * * * * * //
145 
146 template<class ParcelType>
147 inline Foam::scalar
149 {
150  return T0_.value();
151 }
152 
153 
154 template<class ParcelType>
155 inline Foam::scalar
157 {
158  return TMin_.value();
159 }
160 
161 
162 template<class ParcelType>
163 inline Foam::scalar
165 {
166  return TMax_.value();
167 }
168 
169 
170 template<class ParcelType>
171 inline void
173 {
174  TMax_.setValue(TMax);
175 }
176 
177 
178 template<class ParcelType>
179 inline Foam::scalar
181 {
182  return Cp0_.value();
183 }
184 
185 
186 template<class ParcelType>
187 inline Foam::scalar
189 {
190  return epsilon0_.value();
191 }
192 
193 
194 template<class ParcelType>
195 inline Foam::scalar
197 {
198  return f0_.value();
199 }
200 
201 
202 // * * * * * * * * * * ThermoParcel Member Functions * * * * * * * * * * * * //
203 
204 template<class ParcelType>
205 inline Foam::scalar Foam::ThermoParcel<ParcelType>::T() const
206 {
207  return T_;
208 }
209 
210 
211 template<class ParcelType>
212 inline Foam::scalar Foam::ThermoParcel<ParcelType>::Cp() const
213 {
214  return Cp_;
215 }
216 
217 
218 template<class ParcelType>
219 inline Foam::scalar Foam::ThermoParcel<ParcelType>::hs() const
220 {
221  return Cp_*(T_ - 298.15);
222 }
223 
224 
225 template<class ParcelType>
226 inline Foam::scalar& Foam::ThermoParcel<ParcelType>::T()
227 {
228  return T_;
229 }
230 
231 
232 template<class ParcelType>
234 {
235  return Cp_;
236 }
237 
238 
239 // ************************************************************************* //
scalar T0() const
Return const access to the particle initial temperature [K].
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
scalar TMin() const
Return const access to minimum temperature [K].
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
scalar Cp_
Specific heat capacity [J/(kg.K)].
Definition: ThermoParcel.H:252
scalar T() const
Return const access to temperature.
Class to hold thermo particle constant properties.
Definition: ThermoParcel.H:78
void setTMax(const scalar TMax)
Set the maximum temperature [K].
ThermoParcel(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from mesh, coordinates and topology.
Definition: ThermoParcelI.H:75
scalar f0() const
Return const access to the particle scattering factor [].
const Type & value() const
Return the value.
scalar Cp() const
Return const access to specific heat capacity.
scalar T_
Temperature [K].
Definition: ThermoParcel.H:249
scalar hs() const
Return the parcel sensible enthalpy.
scalar Cp0() const
Return const access to the particle specific heat capacity.
void setValue(const Type &value)
Set the value.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
scalar TMax() const
Return const access to maximum temperature [K].
scalar epsilon0() const
Return const access to the particle emissivity [].