initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / lagrangian / intermediate / clouds / Templates / ThermoCloud / ThermoCloud.C
blob0e07f89769863278cff67902b0daa63341826206
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 \*---------------------------------------------------------------------------*/
27 #include "ThermoCloud.H"
28 #include "HeatTransferModel.H"
30 #include "interpolationCellPoint.H"
31 #include "ThermoParcel.H"
33 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
35 template<class ParcelType>
36 Foam::ThermoCloud<ParcelType>::ThermoCloud
38     const word& cloudType,
39     const volPointInterpolation& vpi,
40     const volScalarField& rho,
41     const volVectorField& U,
42     const dimensionedVector& g,
43     basicThermo& thermo
46     KinematicCloud<ParcelType>
47     (
48         cloudType,
49         vpi,
50         rho,
51         U,
52         thermo.mu(),
53         g
54     ),
55     thermoCloud(),
56     constProps_(this->particleProperties()),
57     carrierThermo_(thermo),
58     heatTransferModel_
59     (
60         HeatTransferModel<ThermoCloud<ParcelType> >::New
61         (
62             this->particleProperties(),
63             *this
64         )
65     ),
66     TIntegrator_
67     (
68         scalarIntegrationScheme::New
69         (
70             "T",
71             this->particleProperties().subDict("integrationSchemes")
72         )
73     ),
74     radiation_(this->particleProperties().lookup("radiation")),
75     hTrans_
76     (
77         IOobject
78         (
79             this->name() + "hTrans",
80             this->db().time().timeName(),
81             this->db(),
82             IOobject::NO_READ,
83             IOobject::NO_WRITE,
84             false
85         ),
86         this->mesh(),
87         dimensionedScalar("zero", dimensionSet(1, 2, -2, 0, 0), 0.0)
88     ),
89     hCoeff_
90     (
91         IOobject
92         (
93             this->name() + "hCoeff",
94             this->db().time().timeName(),
95             this->db(),
96             IOobject::NO_READ,
97             IOobject::NO_WRITE,
98             false
99         ),
100         this->mesh(),
101         dimensionedScalar("zero", dimensionSet(1, 2, -3, -1, 0), 0.0)
102     )
106 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
108 template<class ParcelType>
109 Foam::ThermoCloud<ParcelType>::~ThermoCloud()
113 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
115 template<class ParcelType>
116 void Foam::ThermoCloud<ParcelType>::resetSourceTerms()
118     KinematicCloud<ParcelType>::resetSourceTerms();
119     hTrans_.field() = 0.0;
120     hCoeff_.field() = 0.0;
124 template<class ParcelType>
125 void Foam::ThermoCloud<ParcelType>::evolve()
127     const volScalarField& T = carrierThermo_.T();
128     const volScalarField cp = carrierThermo_.Cp();
130     autoPtr<interpolation<scalar> > rhoInterpolator = interpolation<scalar>::New
131     (
132         this->interpolationSchemes(),
133         this->vpi(),
134         this->rho()
135     );
137     autoPtr<interpolation<vector> > UInterpolator = interpolation<vector>::New
138     (
139         this->interpolationSchemes(),
140         this->vpi(),
141         this->U()
142     );
144     autoPtr<interpolation<scalar> > muInterpolator = interpolation<scalar>::New
145     (
146         this->interpolationSchemes(),
147         this->vpi(),
148         this->mu()
149     );
151     autoPtr<interpolation<scalar> > TInterpolator = interpolation<scalar>::New
152     (
153         this->interpolationSchemes(),
154         this->vpi(),
155         T
156     );
158     autoPtr<interpolation<scalar> > cpInterpolator = interpolation<scalar>::New
159     (
160         this->interpolationSchemes(),
161         this->vpi(),
162         cp
163     );
165     typename ParcelType::trackData td
166     (
167         *this,
168         constProps_,
169         rhoInterpolator(),
170         UInterpolator(),
171         muInterpolator(),
172         TInterpolator(),
173         cpInterpolator(),
174         this->g().value()
175     );
177     inject(td);
179     this->move(td);
183 template<class ParcelType>
184 template<class TrackingData>
185 void Foam::ThermoCloud<ParcelType>::inject
187     TrackingData& td
190     // Injection is same as for KinematicCloud<ParcelType>
191     KinematicCloud<ParcelType>::inject(td);
195 // ************************************************************************* //