1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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)
100 //- Default carrier Prandtl number []
107 constantProperties(const dictionary& parentDict);
113 //- Return const access to the particle initial temperature [K]
114 inline scalar T0() const;
116 //- Return const access to minimum temperature [K]
117 inline scalar TMin() const;
119 //- Return const access to the particle specific heat capacity
121 inline scalar cp0() const;
123 //- Return const access to the particle emissivity []
124 // Active for radiation only
125 inline scalar epsilon0() const;
127 //- Return const access to the particle scattering factor []
128 // Active for radiation only
129 inline scalar f0() const;
131 //- Return const access to the default carrier Prandtl number []
132 inline scalar Pr() const;
136 //- Class used to pass thermo tracking data to the trackToFace function
139 public KinematicParcel<ParcelType>::trackData
144 //- Reference to the cloud containing this particle
145 ThermoCloud<ParcelType>& cloud_;
147 //- Particle constant properties
148 const constantProperties& constProps_;
150 // Interpolators for continuous phase fields
152 //- Temperature field interpolator
153 const interpolation<scalar>& TInterp_;
155 //- Specific heat capacity field interpolator
156 const interpolation<scalar>& cpInterp_;
163 //- Construct from components
166 ThermoCloud<ParcelType>& cloud,
167 const constantProperties& constProps,
168 const interpolation<scalar>& rhoInterp,
169 const interpolation<vector>& UInterp,
170 const interpolation<scalar>& muInterp,
171 const interpolation<scalar>& TInterp,
172 const interpolation<scalar>& cpInterp,
179 //- Return access to the owner cloud
180 inline ThermoCloud<ParcelType>& cloud();
182 //- Return const access to the owner cloud
183 inline const constantProperties& constProps() const;
185 //- Return const access to the interpolator for continuous
186 // phase temperature field
187 inline const interpolation<scalar>& TInterp() const;
189 //- Return const access to the interpolator for continuous
190 // phase specific heat capacity field
191 inline const interpolation<scalar>& cpInterp() const;
204 //- Specific heat capacity [J/(kg.K)]
208 // Cell-based quantities
213 //- Specific heat capacity [J/(kg.K)]
217 // Protected member functions
219 //- Calculate new particle temperature
220 template<class TrackData>
221 scalar calcHeatTransfer
224 const scalar dt, // timestep
225 const label cellI, // owner cell
226 const scalar Re, // Reynolds number
227 const scalar Pr, // Prandtl number - surface
228 const scalar kappa, // Thermal conductivity - surface
229 const scalar d, // diameter
230 const scalar rho, // density
231 const scalar T, // temperature
232 const scalar cp, // specific heat capacity
233 const scalar NCpW, // Sum of N*Cp*W of emission species
234 const scalar Sh, // explicit particle enthalpy source
235 scalar& dhsTrans // sensible enthalpy transfer to carrier
241 // Static data members
243 //- String representation of properties
244 static string propHeader;
246 //- Runtime type information
247 TypeName("ThermoParcel");
250 friend class Cloud<ParcelType>;
255 //- Construct from owner, position, and cloud owner
256 // Other properties initialised as null
259 ThermoCloud<ParcelType>& owner,
260 const vector& position,
264 //- Construct from components
267 ThermoCloud<ParcelType>& owner,
268 const vector& position,
271 const scalar nParticle0,
274 const constantProperties& constProps
277 //- Construct from Istream
280 const Cloud<ParcelType>& c,
282 bool readFields = true
285 //- Construct as a copy
286 ThermoParcel(const ThermoParcel& p);
288 //- Construct and return a clone
289 autoPtr<ThermoParcel> clone() const
291 return autoPtr<ThermoParcel>(new ThermoParcel(*this));
299 //- Return const access to temperature
300 inline scalar T() const;
302 //- Return const access to specific heat capacity
303 inline scalar cp() const;
308 //- Return access to temperature
311 //- Return access to specific heat capacity
315 // Main calculation loop
318 template<class TrackData>
326 //- Correct cell values using latest transfer information
327 template<class TrackData>
328 void cellValueSourceCorrection
335 //- Calculate surface thermo properties
336 template<class TrackData>
337 void calcSurfaceValues
349 //- Update parcel properties over the time interval
350 template<class TrackData>
362 static void readFields(Cloud<ParcelType>& c);
365 static void writeFields(const Cloud<ParcelType>& c);
370 friend Ostream& operator<< <ParcelType>
373 const ThermoParcel<ParcelType>&
378 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
380 } // End namespace Foam
382 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
384 #include "ThermoParcelI.H"
386 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
389 #include "ThermoParcel.C"
392 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
396 // ************************************************************************* //