ThermoParcelI.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>
32 :
33  ParcelType::constantProperties(),
34  T0_(this->dict_, 0.0),
35  TMin_(this->dict_, 0.0),
36  TMax_(this->dict_, VGREAT),
37  Cp0_(this->dict_, 0.0),
38  epsilon0_(this->dict_, 0.0),
39  f0_(this->dict_, 0.0)
40 {}
41 
42 
43 template<class ParcelType>
45 (
46  const constantProperties& cp
47 )
48 :
49  ParcelType::constantProperties(cp),
50  T0_(cp.T0_),
51  TMin_(cp.TMin_),
52  TMax_(cp.TMax_),
53  Cp0_(cp.Cp0_),
54  epsilon0_(cp.epsilon0_),
55  f0_(cp.f0_)
56 {}
57 
58 
59 template<class ParcelType>
61 (
62  const dictionary& parentDict
63 )
64 :
65  ParcelType::constantProperties(parentDict),
66  T0_(this->dict_, "T0"),
67  TMin_(this->dict_, "TMin", 200.0),
68  TMax_(this->dict_, "TMax", 5000.0),
69  Cp0_(this->dict_, "Cp0"),
70  epsilon0_(this->dict_, "epsilon0"),
71  f0_(this->dict_, "f0")
72 {}
73 
74 
75 template<class ParcelType>
77 (
78  const polyMesh& mesh,
79  const barycentric& coordinates,
80  const label celli,
81  const label tetFacei,
82  const label tetPti
83 )
84 :
85  ParcelType(mesh, coordinates, celli, tetFacei, tetPti),
86  T_(0.0),
87  Cp_(0.0)
88 {}
89 
90 
91 template<class ParcelType>
93 (
94  const polyMesh& mesh,
95  const vector& position,
96  const label celli
97 )
98 :
99  ParcelType(mesh, position, celli),
100  T_(0.0),
101  Cp_(0.0)
102 {}
103 
104 
105 template<class ParcelType>
107 (
108  const polyMesh& mesh,
109  const barycentric& coordinates,
110  const label celli,
111  const label tetFacei,
112  const label tetPti,
113  const label typeId,
114  const scalar nParticle0,
115  const scalar d0,
116  const scalar dTarget0,
117  const vector& U0,
118  const vector& f0,
119  const vector& angularMomentum0,
120  const vector& torque0,
121  const constantProperties& constProps
122 )
123 :
124  ParcelType
125  (
126  mesh,
127  coordinates,
128  celli,
129  tetFacei,
130  tetPti,
131  typeId,
132  nParticle0,
133  d0,
134  dTarget0,
135  U0,
136  f0,
137  angularMomentum0,
138  torque0,
139  constProps
140  ),
141  T_(constProps.T0()),
142  Cp_(constProps.Cp0())
143 {}
144 
145 
146 // * * * * * * * * * constantProperties Member Functions * * * * * * * * * * //
147 
148 template<class ParcelType>
149 inline Foam::scalar
151 {
152  return T0_.value();
153 }
154 
155 
156 template<class ParcelType>
157 inline Foam::scalar
159 {
160  return TMin_.value();
161 }
162 
163 
164 template<class ParcelType>
165 inline Foam::scalar
167 {
168  return TMax_.value();
169 }
170 
171 
172 template<class ParcelType>
173 inline void
175 {
176  TMax_.setValue(TMax);
177 }
178 
179 
180 template<class ParcelType>
181 inline Foam::scalar
183 {
184  return Cp0_.value();
185 }
186 
187 
188 template<class ParcelType>
189 inline Foam::scalar
191 {
192  return epsilon0_.value();
193 }
194 
195 
196 template<class ParcelType>
197 inline Foam::scalar
199 {
200  return f0_.value();
201 }
202 
203 
204 // * * * * * * * * * * ThermoParcel Member Functions * * * * * * * * * * * * //
205 
206 template<class ParcelType>
207 inline Foam::scalar Foam::ThermoParcel<ParcelType>::T() const
208 {
209  return T_;
210 }
211 
212 
213 template<class ParcelType>
214 inline Foam::scalar Foam::ThermoParcel<ParcelType>::Cp() const
215 {
216  return Cp_;
217 }
218 
219 
220 template<class ParcelType>
221 inline Foam::scalar Foam::ThermoParcel<ParcelType>::hs() const
222 {
223  return Cp_*(T_ - 298.15);
224 }
225 
226 
227 template<class ParcelType>
228 inline Foam::scalar& Foam::ThermoParcel<ParcelType>::T()
229 {
230  return T_;
231 }
232 
233 
234 template<class ParcelType>
236 {
237  return Cp_;
238 }
239 
240 
241 // ************************************************************************* //
Foam::ThermoParcel::constantProperties
Class to hold thermo particle constant properties.
Definition: ThermoParcel.H:82
Foam::ThermoParcel::constantProperties::epsilon0
scalar epsilon0() const
Return const access to the particle emissivity [].
Definition: ThermoParcelI.H:190
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::ThermoParcel::constantProperties::f0
scalar f0() const
Return const access to the particle scattering factor [].
Definition: ThermoParcelI.H:198
Foam::ThermoParcel::constantProperties::setTMax
void setTMax(const scalar TMax)
Set the maximum temperature [K].
Definition: ThermoParcelI.H:174
Foam::ThermoParcel::constantProperties::T0
scalar T0() const
Return const access to the particle initial temperature [K].
Definition: ThermoParcelI.H:150
Foam::ThermoParcel::T_
scalar T_
Temperature [K].
Definition: ThermoParcel.H:253
Foam::ThermoParcel::Cp_
scalar Cp_
Specific heat capacity [J/(kg.K)].
Definition: ThermoParcel.H:256
coordinates
PtrList< coordinateSystem > coordinates(solidRegions.size())
Foam::ThermoParcel::T
scalar T() const
Return const access to temperature.
Definition: ThermoParcelI.H:207
Foam::ThermoParcel::hs
scalar hs() const
Return the parcel sensible enthalpy.
Definition: ThermoParcelI.H:221
Foam::Barycentric< scalar >
Foam::ThermoParcel::constantProperties::Cp0
scalar Cp0() const
Return const access to the particle specific heat capacity.
Definition: ThermoParcelI.H:182
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::ThermoParcel::constantProperties::TMax
scalar TMax() const
Return const access to maximum temperature [K].
Definition: ThermoParcelI.H:166
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::ThermoParcel::constantProperties::constantProperties
constantProperties()
Null constructor.
Definition: ThermoParcelI.H:31
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::Vector< scalar >
Foam::ThermoParcel::constantProperties::TMin
scalar TMin() const
Return const access to minimum temperature [K].
Definition: ThermoParcelI.H:158
Foam::ThermoParcel::ThermoParcel
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:77
Foam::ThermoParcel::Cp
scalar Cp() const
Return const access to specific heat capacity.
Definition: ThermoParcelI.H:214