1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2008-2011 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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
28 Thermodynamic parcel class with one/two-way coupling with the continuous
29 phase. Includes Kinematic parcel sub-models, plus:
37 \*---------------------------------------------------------------------------*/
39 #ifndef ThermoParcel_H
40 #define ThermoParcel_H
43 #include "SLGThermo.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 template<class ParcelType>
53 template<class ParcelType>
57 const ThermoParcel<ParcelType>&
60 /*---------------------------------------------------------------------------*\
61 Class ThermoParcel Declaration
62 \*---------------------------------------------------------------------------*/
64 template<class ParcelType>
71 //- Class to hold thermo particle constant properties
72 class constantProperties
74 public ParcelType::constantProperties
79 //- Particle initial temperature [K]
82 //- Minimum temperature [K]
85 //- Particle specific heat capacity [J/(kg.K)]
88 //- Particle emissivity [] (radiation)
91 //- Particle scattering factor [] (radiation)
94 //- Default carrier Prandtl number []
103 constantProperties();
106 constantProperties(const constantProperties& cp);
108 //- Constructor from dictionary
111 const dictionary& parentDict,
112 const bool readFields = true
115 //- Construct from components
118 const label parcelTypeId,
121 const scalar minParticleMass,
122 const scalar youngsModulus,
123 const scalar poissonsRatio,
127 const scalar epsilon0,
137 //- Return const access to the particle initial temperature [K]
138 inline scalar T0() const;
140 //- Return const access to minimum temperature [K]
141 inline scalar TMin() const;
143 //- Return const access to the particle specific heat capacity
145 inline scalar Cp0() const;
147 //- Return const access to the particle emissivity []
148 // Active for radiation only
149 inline scalar epsilon0() const;
151 //- Return const access to the particle scattering factor []
152 // Active for radiation only
153 inline scalar f0() const;
155 //- Return const access to the default carrier Prandtl number []
156 inline scalar Pr() const;
160 template<class CloudType>
163 public ParcelType::template TrackingData<CloudType>
169 //- Local copy of carrier specific heat field
170 // Cp not stored on carrier thermo, but returned as tmp<...>
171 const volScalarField Cp_;
174 // Interpolators for continuous phase fields
176 //- Temperature field interpolator
177 autoPtr<interpolation<scalar> > TInterp_;
179 //- Specific heat capacity field interpolator
180 autoPtr<interpolation<scalar> > CpInterp_;
182 //- Radiation field interpolator
183 autoPtr<interpolation<scalar> > GInterp_;
189 typedef typename ParcelType::template TrackingData<CloudType>::trackPart
194 //- Construct from components
198 trackPart part = ParcelType::template
199 TrackingData<CloudType>::tpLinearTrack
205 //- Return access to the locally stored carrier Cp field
206 inline const volScalarField& Cp() const;
208 //- Return const access to the interpolator for continuous
209 // phase temperature field
210 inline const interpolation<scalar>& TInterp() const;
212 //- Return const access to the interpolator for continuous
213 // phase specific heat capacity field
214 inline const interpolation<scalar>& CpInterp() const;
216 //- Return const access to the interpolator for continuous
218 inline const interpolation<scalar>& GInterp() const;
231 //- Specific heat capacity [J/(kg.K)]
235 // Cell-based quantities
240 //- Specific heat capacity [J/(kg.K)]
244 // Protected Member Functions
246 //- Calculate new particle temperature
247 template<class TrackData>
248 scalar calcHeatTransfer
251 const scalar dt, // timestep
252 const label cellI, // owner cell
253 const scalar Re, // Reynolds number
254 const scalar Pr, // Prandtl number - surface
255 const scalar kappa, // Thermal conductivity - surface
256 const scalar NCpW, // Sum of N*Cp*W of emission species
257 const scalar Sh, // explicit particle enthalpy source
258 scalar& dhsTrans, // sensible enthalpy transfer to carrier
259 scalar& Sph // linearised heat transfer coefficient
265 // Static data members
267 //- String representation of properties
268 static string propHeader;
270 //- Runtime type information
271 TypeName("ThermoParcel");
276 //- Construct from owner, position, and cloud owner
277 // Other properties initialised as null
280 const polyMesh& mesh,
281 const vector& position,
283 const label tetFaceI,
287 //- Construct from components
290 const polyMesh& mesh,
291 const vector& position,
293 const label tetFaceI,
296 const scalar nParticle0,
298 const scalar dTarget0,
301 const vector& angularMomentum0,
302 const vector& torque0,
303 const constantProperties& constProps
306 //- Construct from Istream
309 const polyMesh& mesh,
311 bool readFields = true
314 //- Construct as a copy
315 ThermoParcel(const ThermoParcel& p);
317 //- Construct as a copy
318 ThermoParcel(const ThermoParcel& p, const polyMesh& mesh);
320 //- Construct and return a (basic particle) clone
321 virtual autoPtr<particle> clone() const
323 return autoPtr<particle>(new ThermoParcel(*this));
326 //- Construct and return a (basic particle) clone
327 virtual autoPtr<particle> clone(const polyMesh& mesh) const
329 return autoPtr<particle>(new ThermoParcel(*this, mesh));
332 //- Factory class to read-construct particles used for
336 const polyMesh& mesh_;
340 iNew(const polyMesh& mesh)
345 autoPtr<ThermoParcel<ParcelType> > operator()(Istream& is) const
347 return autoPtr<ThermoParcel<ParcelType> >
349 new ThermoParcel<ParcelType>(mesh_, is, true)
359 //- Return const access to temperature
360 inline scalar T() const;
362 //- Return const access to specific heat capacity
363 inline scalar Cp() const;
365 //- Return the parcel sensible enthalpy
366 inline scalar hs() const;
368 //- Return const access to carrier temperature
369 inline scalar Tc() const;
371 //- Return const access to carrier specific heat capacity
372 inline scalar Cpc() const;
377 //- Return access to temperature
380 //- Return access to specific heat capacity
384 // Main calculation loop
387 template<class TrackData>
395 //- Correct cell values using latest transfer information
396 template<class TrackData>
397 void cellValueSourceCorrection
404 //- Calculate surface thermo properties
405 template<class TrackData>
406 void calcSurfaceValues
418 //- Update parcel properties over the time interval
419 template<class TrackData>
431 template<class CloudType>
432 static void readFields(CloudType& c);
435 template<class CloudType>
436 static void writeFields(const CloudType& c);
441 friend Ostream& operator<< <ParcelType>
444 const ThermoParcel<ParcelType>&
449 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
451 } // End namespace Foam
453 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
455 #include "ThermoParcelI.H"
456 #include "ThermoParcelTrackingDataI.H"
458 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
461 #include "ThermoParcel.C"
464 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
468 // ************************************************************************* //