BUG: PointEdgeWave : n cyclics bool instead of label
[OpenFOAM-1.6.x.git] / src / lagrangian / intermediate / clouds / Templates / ThermoCloud / ThermoCloud.C
blobb3135ce81c9b5a0324b62629a3a1893de012499c
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 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 "interpolationCellPoint.H"
29 #include "ThermoParcel.H"
31 #include "HeatTransferModel.H"
33 // * * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * //
35 template<class ParcelType>
36 void Foam::ThermoCloud<ParcelType>::preEvolve()
38     KinematicCloud<ParcelType>::preEvolve();
42 template<class ParcelType>
43 void Foam::ThermoCloud<ParcelType>::evolveCloud()
45     const volScalarField& T = carrierThermo_.T();
46     const volScalarField cp = carrierThermo_.Cp();
48     autoPtr<interpolation<scalar> > rhoInterp = interpolation<scalar>::New
49     (
50         this->interpolationSchemes(),
51         this->rho()
52     );
54     autoPtr<interpolation<vector> > UInterp = interpolation<vector>::New
55     (
56         this->interpolationSchemes(),
57         this->U()
58     );
60     autoPtr<interpolation<scalar> > muInterp = interpolation<scalar>::New
61     (
62         this->interpolationSchemes(),
63         this->mu()
64     );
66     autoPtr<interpolation<scalar> > TInterp = interpolation<scalar>::New
67     (
68         this->interpolationSchemes(),
69         T
70     );
72     autoPtr<interpolation<scalar> > cpInterp = interpolation<scalar>::New
73     (
74         this->interpolationSchemes(),
75         cp
76     );
78     typename ParcelType::trackData td
79     (
80         *this,
81         constProps_,
82         rhoInterp(),
83         UInterp(),
84         muInterp(),
85         TInterp(),
86         cpInterp(),
87         this->g().value()
88     );
90     this->injection().inject(td);
92     if (this->coupled())
93     {
94         resetSourceTerms();
95     }
97     Cloud<ParcelType>::move(td);
101 template<class ParcelType>
102 void Foam::ThermoCloud<ParcelType>::postEvolve()
104     KinematicCloud<ParcelType>::postEvolve();
108 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
110 template<class ParcelType>
111 Foam::ThermoCloud<ParcelType>::ThermoCloud
113     const word& cloudName,
114     const volScalarField& rho,
115     const volVectorField& U,
116     const dimensionedVector& g,
117     basicThermo& thermo,
118     bool readFields
121     KinematicCloud<ParcelType>
122     (
123         cloudName,
124         rho,
125         U,
126         thermo.mu(),
127         g,
128         false
129     ),
130     thermoCloud(),
131     constProps_(this->particleProperties()),
132     carrierThermo_(thermo),
133     heatTransferModel_
134     (
135         HeatTransferModel<ThermoCloud<ParcelType> >::New
136         (
137             this->particleProperties(),
138             *this
139         )
140     ),
141     TIntegrator_
142     (
143         scalarIntegrationScheme::New
144         (
145             "T",
146             this->particleProperties().subDict("integrationSchemes")
147         )
148     ),
149     radiation_(this->particleProperties().lookup("radiation")),
150     hsTrans_
151     (
152         IOobject
153         (
154             this->name() + "hsTrans",
155             this->db().time().timeName(),
156             this->db(),
157             IOobject::NO_READ,
158             IOobject::NO_WRITE,
159             false
160         ),
161         this->mesh(),
162         dimensionedScalar("zero", dimEnergy, 0.0)
163     )
165     if (readFields)
166     {
167         ParcelType::readFields(*this);
168     }
172 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
174 template<class ParcelType>
175 Foam::ThermoCloud<ParcelType>::~ThermoCloud()
179 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
181 template<class ParcelType>
182 void Foam::ThermoCloud<ParcelType>::checkParcelProperties
184     ParcelType& parcel,
185     const scalar lagrangianDt,
186     const bool fullyDescribed
189     KinematicCloud<ParcelType>::checkParcelProperties
190     (
191         parcel,
192         lagrangianDt,
193         fullyDescribed
194     );
196     if (!fullyDescribed)
197     {
198         parcel.T() = constProps_.T0();
199         parcel.cp() = constProps_.cp0();
200     }
204 template<class ParcelType>
205 void Foam::ThermoCloud<ParcelType>::resetSourceTerms()
207     KinematicCloud<ParcelType>::resetSourceTerms();
208     hsTrans_.field() = 0.0;
212 template<class ParcelType>
213 void Foam::ThermoCloud<ParcelType>::evolve()
215     if (this->active())
216     {
217         preEvolve();
219         evolveCloud();
221         postEvolve();
223         info();
224         Info<< endl;
225     }
229 template<class ParcelType>
230 void Foam::ThermoCloud<ParcelType>::info() const
232     KinematicCloud<ParcelType>::info();
236 // ************************************************************************* //