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 Templated base class for thermodynamic cloud
30 - Adds to kinematic cloud
37 \*---------------------------------------------------------------------------*/
42 #include "KinematicCloud.H"
43 #include "thermoCloud.H"
44 #include "SLGThermo.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 // Forward declaration of classes
53 template<class CloudType>
54 class HeatTransferModel;
56 /*---------------------------------------------------------------------------*\
57 Class ThermoCloud Declaration
58 \*---------------------------------------------------------------------------*/
60 template<class CloudType>
70 //- Type of cloud this cloud was instantiated for
71 typedef CloudType cloudType;
73 //- Type of parcel the cloud was instantiated for
74 typedef typename CloudType::particleType parcelType;
76 //- Convenience typedef for this cloud type
77 typedef ThermoCloud<CloudType> thermoCloudType;
84 //- Cloud copy pointer
85 autoPtr<ThermoCloud<CloudType> > cloudCopyPtr_;
88 // Private member functions
90 //- Disallow default bitwise copy construct
91 ThermoCloud(const ThermoCloud&);
93 //- Disallow default bitwise assignment
94 void operator=(const ThermoCloud&);
101 //- Thermo parcel constant properties
102 typename parcelType::constantProperties constProps_;
105 // References to the carrier gas fields
107 //- SLG thermodynamics package
108 const SLGThermo& thermo_;
111 const volScalarField& T_;
114 const volScalarField& p_;
117 // References to the cloud sub-models
119 //- Heat transfer model
120 autoPtr<HeatTransferModel<ThermoCloud<CloudType> > >
124 // Reference to the particle integration schemes
126 //- Temperature integration
127 autoPtr<scalarIntegrationScheme> TIntegrator_;
132 //- Include radiation
138 //- Sensible enthalpy transfer [J/kg]
139 autoPtr<DimensionedField<scalar, volMesh> > hsTrans_;
141 //- Coefficient for carrier phase hs equation [W/K]
142 autoPtr<DimensionedField<scalar, volMesh> > hsCoeff_;
145 // Protected Member Functions
149 //- Set cloud sub-models
153 // Cloud evolution functions
155 //- Reset state of cloud
156 void cloudReset(ThermoCloud<CloudType>& c);
163 //- Construct given carrier gas fields
166 const word& cloudName,
167 const volScalarField& rho,
168 const volVectorField& U,
169 const dimensionedVector& g,
170 const SLGThermo& thermo,
171 bool readFields = true
174 //- Copy constructor with new name
175 ThermoCloud(ThermoCloud<CloudType>& c, const word& name);
177 //- Copy constructor with new name - creates bare cloud
182 const ThermoCloud<CloudType>& c
185 //- Construct and return clone based on (this) with new name
186 virtual autoPtr<Cloud<parcelType> > clone(const word& name)
188 return autoPtr<Cloud<parcelType> >
190 new ThermoCloud(*this, name)
194 //- Construct and return bare clone based on (this) with new name
195 virtual autoPtr<Cloud<parcelType> > cloneBare(const word& name) const
197 return autoPtr<Cloud<parcelType> >
199 new ThermoCloud(this->mesh(), name, *this)
205 virtual ~ThermoCloud();
212 //- Return a reference to the cloud copy
213 inline const ThermoCloud& cloudCopy() const;
215 //- Return the constant properties
216 inline const typename parcelType::constantProperties&
219 //- Return const access to thermo package
220 inline const SLGThermo& thermo() const;
222 //- Return const access to the carrier temperature field
223 inline const volScalarField& T() const;
225 //- Return const access to the carrier prressure field
226 inline const volScalarField& p() const;
231 //- Return reference to heat transfer model
232 inline const HeatTransferModel<ThermoCloud<CloudType> >&
233 heatTransfer() const;
236 // Integration schemes
238 //-Return reference to velocity integration
239 inline const scalarIntegrationScheme& TIntegrator() const;
245 inline bool radiation() const;
252 //- Sensible enthalpy transfer [J/kg]
253 inline DimensionedField<scalar, volMesh>& hsTrans();
255 //- Sensible enthalpy transfer [J/kg]
256 inline const DimensionedField<scalar, volMesh>&
259 //- Return coefficient for carrier phase hs equation
260 inline DimensionedField<scalar, volMesh>& hsCoeff();
262 //- Return const coefficient for carrier phase hs equation
263 inline const DimensionedField<scalar, volMesh>&
266 //- Return sensible enthalpy source term [J/kg/m3/s]
267 inline tmp<fvScalarMatrix> Sh(volScalarField& hs) const;
270 // Radiation - overrides thermoCloud virtual abstract members
272 //- Return tmp equivalent particulate emission
273 inline tmp<volScalarField> Ep() const;
275 //- Return tmp equivalent particulate absorption
276 inline tmp<volScalarField> ap() const;
278 //- Return tmp equivalent particulate scattering factor
279 inline tmp<volScalarField> sigmap() const;
282 // Cloud evolution functions
284 //- Set parcel thermo properties
285 void setParcelThermoProperties
288 const scalar lagrangianDt
291 //- Check parcel properties
292 void checkParcelProperties
295 const scalar lagrangianDt,
296 const bool fullyDescribed
299 //- Store the current cloud state
302 //- Reset the current cloud to the previously stored state
305 //- Reset the cloud source terms
306 void resetSourceTerms();
308 //- Apply relaxation to (steady state) cloud sources
309 void relaxSources(const ThermoCloud<CloudType>& cloudOldTime);
311 //- Apply scaling to (transient) cloud sources
323 //- Print cloud information
328 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
330 } // End namespace Foam
332 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
334 #include "ThermoCloudI.H"
336 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
339 # include "ThermoCloud.C"
342 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
346 // ************************************************************************* //