FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

ThermoCloud_.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include "ThermoCloud_.H"
00027 #include <finiteVolume/interpolationCellPoint.H>
00028 #include <lagrangianIntermediate/ThermoParcel.H>
00029 
00030 #include <lagrangianIntermediate/HeatTransferModel.H>
00031 
00032 // * * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * //
00033 
00034 template<class ParcelType>
00035 void Foam::ThermoCloud<ParcelType>::preEvolve()
00036 {
00037     KinematicCloud<ParcelType>::preEvolve();
00038 }
00039 
00040 
00041 template<class ParcelType>
00042 void Foam::ThermoCloud<ParcelType>::evolveCloud()
00043 {
00044     const volScalarField& T = carrierThermo_.T();
00045     const volScalarField cp = carrierThermo_.Cp();
00046 
00047     autoPtr<interpolation<scalar> > rhoInterp = interpolation<scalar>::New
00048     (
00049         this->interpolationSchemes(),
00050         this->rho()
00051     );
00052 
00053     autoPtr<interpolation<vector> > UInterp = interpolation<vector>::New
00054     (
00055         this->interpolationSchemes(),
00056         this->U()
00057     );
00058 
00059     autoPtr<interpolation<scalar> > muInterp = interpolation<scalar>::New
00060     (
00061         this->interpolationSchemes(),
00062         this->mu()
00063     );
00064 
00065     autoPtr<interpolation<scalar> > TInterp = interpolation<scalar>::New
00066     (
00067         this->interpolationSchemes(),
00068         T
00069     );
00070 
00071     autoPtr<interpolation<scalar> > cpInterp = interpolation<scalar>::New
00072     (
00073         this->interpolationSchemes(),
00074         cp
00075     );
00076 
00077     typename ParcelType::trackData td
00078     (
00079         *this,
00080         constProps_,
00081         rhoInterp(),
00082         UInterp(),
00083         muInterp(),
00084         TInterp(),
00085         cpInterp(),
00086         this->g().value()
00087     );
00088 
00089     this->injection().inject(td);
00090 
00091     if (this->coupled())
00092     {
00093         resetSourceTerms();
00094     }
00095 
00096     Cloud<ParcelType>::move(td);
00097 }
00098 
00099 
00100 template<class ParcelType>
00101 void Foam::ThermoCloud<ParcelType>::postEvolve()
00102 {
00103     KinematicCloud<ParcelType>::postEvolve();
00104 }
00105 
00106 
00107 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00108 
00109 template<class ParcelType>
00110 Foam::ThermoCloud<ParcelType>::ThermoCloud
00111 (
00112     const word& cloudName,
00113     const volScalarField& rho,
00114     const volVectorField& U,
00115     const dimensionedVector& g,
00116     basicThermo& thermo,
00117     bool readFields
00118 )
00119 :
00120     KinematicCloud<ParcelType>
00121     (
00122         cloudName,
00123         rho,
00124         U,
00125         thermo.mu(),
00126         g,
00127         false
00128     ),
00129     thermoCloud(),
00130     constProps_(this->particleProperties()),
00131     carrierThermo_(thermo),
00132     heatTransferModel_
00133     (
00134         HeatTransferModel<ThermoCloud<ParcelType> >::New
00135         (
00136             this->particleProperties(),
00137             *this
00138         )
00139     ),
00140     TIntegrator_
00141     (
00142         scalarIntegrationScheme::New
00143         (
00144             "T",
00145             this->particleProperties().subDict("integrationSchemes")
00146         )
00147     ),
00148     radiation_(this->particleProperties().lookup("radiation")),
00149     hsTrans_
00150     (
00151         IOobject
00152         (
00153             this->name() + "hsTrans",
00154             this->db().time().timeName(),
00155             this->db(),
00156             IOobject::NO_READ,
00157             IOobject::NO_WRITE,
00158             false
00159         ),
00160         this->mesh(),
00161         dimensionedScalar("zero", dimEnergy, 0.0)
00162     )
00163 {
00164     if (readFields)
00165     {
00166         ParcelType::readFields(*this);
00167     }
00168 }
00169 
00170 
00171 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00172 
00173 template<class ParcelType>
00174 Foam::ThermoCloud<ParcelType>::~ThermoCloud()
00175 {}
00176 
00177 
00178 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00179 
00180 template<class ParcelType>
00181 void Foam::ThermoCloud<ParcelType>::checkParcelProperties
00182 (
00183     ParcelType& parcel,
00184     const scalar lagrangianDt,
00185     const bool fullyDescribed
00186 )
00187 {
00188     KinematicCloud<ParcelType>::checkParcelProperties
00189     (
00190         parcel,
00191         lagrangianDt,
00192         fullyDescribed
00193     );
00194 
00195     if (!fullyDescribed)
00196     {
00197         parcel.T() = constProps_.T0();
00198         parcel.cp() = constProps_.cp0();
00199     }
00200 }
00201 
00202 
00203 template<class ParcelType>
00204 void Foam::ThermoCloud<ParcelType>::resetSourceTerms()
00205 {
00206     KinematicCloud<ParcelType>::resetSourceTerms();
00207     hsTrans_.field() = 0.0;
00208 }
00209 
00210 
00211 template<class ParcelType>
00212 void Foam::ThermoCloud<ParcelType>::evolve()
00213 {
00214     if (this->active())
00215     {
00216         preEvolve();
00217 
00218         evolveCloud();
00219 
00220         postEvolve();
00221 
00222         info();
00223         Info<< endl;
00224     }
00225 }
00226 
00227 
00228 template<class ParcelType>
00229 void Foam::ThermoCloud<ParcelType>::info() const
00230 {
00231     KinematicCloud<ParcelType>::info();
00232 }
00233 
00234 
00235 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines