1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Thermodynamic parcel class with one/two-way coupling with the continuous
30 phase. Includes Kinematic parcel sub-models, plus:
38 \*---------------------------------------------------------------------------*/
40 #ifndef ThermoParcel_H
41 #define ThermoParcel_H
45 #include "interpolationCellPoint.H"
46 #include "contiguous.H"
48 #include "KinematicParcel.H"
49 #include "ThermoCloud.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 template<class ParcelType>
59 template<class ParcelType>
63 const ThermoParcel<ParcelType>&
66 /*---------------------------------------------------------------------------*\
67 Class ThermoParcel Declaration
68 \*---------------------------------------------------------------------------*/
70 template<class ParcelType>
73 public KinematicParcel<ParcelType>
77 //- Class to hold thermo particle constant properties
78 class constantProperties
80 public KinematicParcel<ParcelType>::constantProperties
85 //- Particle initial temperature [K]
88 //- Minimum temperature [K]
91 //- Particle specific heat capacity [J/(kg.K)]
94 //- Particle emissivity [] (radiation)
95 const scalar epsilon0_;
97 //- Particle scattering factor [] (radiation)
104 constantProperties(const dictionary& parentDict);
110 //- Return const access to the particle initial temperature [K]
111 inline scalar T0() const;
113 //- Return const access to minimum temperature [K]
114 inline scalar TMin() const;
116 //- Return const access to the particle specific heat capacity
118 inline scalar cp0() const;
120 //- Return const access to the particle emissivity []
121 // Active for radiation only
122 inline scalar epsilon0() const;
124 //- Return const access to the particle scattering factor []
125 // Active for radiation only
126 inline scalar f0() const;
130 //- Class used to pass thermo tracking data to the trackToFace function
133 public KinematicParcel<ParcelType>::trackData
138 //- Reference to the cloud containing this particle
139 ThermoCloud<ParcelType>& cloud_;
141 //- Particle constant properties
142 const constantProperties& constProps_;
144 // Interpolators for continuous phase fields
146 //- Temperature field interpolator
147 const interpolation<scalar>& TInterp_;
149 //- Specific heat capacity field interpolator
150 const interpolation<scalar>& cpInterp_;
157 //- Construct from components
160 ThermoCloud<ParcelType>& cloud,
161 const constantProperties& constProps,
162 const interpolation<scalar>& rhoInterp,
163 const interpolation<vector>& UInterp,
164 const interpolation<scalar>& muInterp,
165 const interpolation<scalar>& TInterp,
166 const interpolation<scalar>& cpInterp,
173 //- Return access to the owner cloud
174 inline ThermoCloud<ParcelType>& cloud();
176 //- Return const access to the owner cloud
177 inline const constantProperties& constProps() const;
179 //- Return const access to the interpolator for continuous
180 // phase temperature field
181 inline const interpolation<scalar>& TInterp() const;
183 //- Return const access to the interpolator for continuous
184 // phase specific heat capacity field
185 inline const interpolation<scalar>& cpInterp() const;
198 //- Specific heat capacity [J/(kg.K)]
202 // Cell-based quantities
207 //- Specific heat capacity [J/(kg.K)]
211 // Protected member functions
213 //- Calculate new particle temperature
214 template<class TrackData>
215 scalar calcHeatTransfer
218 const scalar dt, // timestep
219 const label cellI, // owner cell
220 const scalar d, // diameter
221 const vector& U, // velocity
222 const scalar rho, // density
223 const scalar T, // temperature
224 const scalar cp, // specific heat capacity
225 const scalar Sh, // explicit particle enthalpy source
226 scalar& dhsTrans // sensible enthalpy transfer to carrier
232 // Static data members
234 //- String representation of properties
235 static string propHeader;
237 //- Runtime type information
238 TypeName("ThermoParcel");
241 friend class Cloud<ParcelType>;
246 //- Construct from owner, position, and cloud owner
247 // Other properties initialised as null
250 ThermoCloud<ParcelType>& owner,
251 const vector& position,
255 //- Construct from components
258 ThermoCloud<ParcelType>& owner,
259 const vector& position,
262 const scalar nParticle0,
265 const constantProperties& constProps
268 //- Construct from Istream
271 const Cloud<ParcelType>& c,
273 bool readFields = true
276 //- Construct as a copy
277 ThermoParcel(const ThermoParcel& p);
279 //- Construct and return a clone
280 autoPtr<ThermoParcel> clone() const
282 return autoPtr<ThermoParcel>(new ThermoParcel(*this));
290 //- Return const access to temperature
291 inline scalar T() const;
293 //- Return const access to specific heat capacity
294 inline scalar cp() const;
299 //- Return access to temperature
302 //- Return access to specific heat capacity
306 // Main calculation loop
309 template<class TrackData>
317 //- Correct cell values using latest transfer information
318 template<class TrackData>
319 void cellValueSourceCorrection
326 //- Update parcel properties over the time interval
327 template<class TrackData>
339 static void readFields(ThermoCloud<ParcelType>& c);
342 static void writeFields(const ThermoCloud<ParcelType>& c);
347 friend Ostream& operator<< <ParcelType>
350 const ThermoParcel<ParcelType>&
355 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
357 } // End namespace Foam
359 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
361 #include "ThermoParcelI.H"
363 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
366 #include "ThermoParcel.C"
369 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
373 // ************************************************************************* //