OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 #include "ThermoCloud.H"
00028 #include "interpolationCellPoint.H"
00029 #include "ThermoParcel.H"
00030 
00031 #include "HeatTransferModel.H"
00032 
00033 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00034 
00035 template<class ParcelType>
00036 Foam::ThermoCloud<ParcelType>::ThermoCloud
00037 (
00038     const word& cloudName,
00039     const volScalarField& rho,
00040     const volVectorField& U,
00041     const dimensionedVector& g,
00042     basicThermo& thermo
00043 )
00044 :
00045     KinematicCloud<ParcelType>
00046     (
00047         cloudName,
00048         rho,
00049         U,
00050         thermo.mu(),
00051         g
00052     ),
00053     thermoCloud(),
00054     constProps_(this->particleProperties()),
00055     carrierThermo_(thermo),
00056     heatTransferModel_
00057     (
00058         HeatTransferModel<ThermoCloud<ParcelType> >::New
00059         (
00060             this->particleProperties(),
00061             *this
00062         )
00063     ),
00064     TIntegrator_
00065     (
00066         scalarIntegrationScheme::New
00067         (
00068             "T",
00069             this->particleProperties().subDict("integrationSchemes")
00070         )
00071     ),
00072     radiation_(this->particleProperties().lookup("radiation")),
00073     hsTrans_
00074     (
00075         IOobject
00076         (
00077             this->name() + "hsTrans",
00078             this->db().time().timeName(),
00079             this->db(),
00080             IOobject::NO_READ,
00081             IOobject::NO_WRITE,
00082             false
00083         ),
00084         this->mesh(),
00085         dimensionedScalar("zero", dimensionSet(1, 2, -2, 0, 0), 0.0)
00086     ),
00087     hcTrans_
00088     (
00089         IOobject
00090         (
00091             this->name() + "hcTrans",
00092             this->db().time().timeName(),
00093             this->db(),
00094             IOobject::NO_READ,
00095             IOobject::NO_WRITE,
00096             false
00097         ),
00098         this->mesh(),
00099         dimensionedScalar("zero", dimensionSet(1, 2, -2, 0, 0), 0.0)
00100     )
00101 {}
00102 
00103 
00104 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00105 
00106 template<class ParcelType>
00107 Foam::ThermoCloud<ParcelType>::~ThermoCloud()
00108 {}
00109 
00110 
00111 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00112 
00113 template<class ParcelType>
00114 void Foam::ThermoCloud<ParcelType>::checkParcelProperties
00115 (
00116     ParcelType& parcel,
00117     const scalar lagrangianDt,
00118     const bool fullyDescribed
00119 )
00120 {
00121     KinematicCloud<ParcelType>::checkParcelProperties
00122     (
00123         parcel,
00124         lagrangianDt,
00125         fullyDescribed
00126     );
00127 
00128     if (!fullyDescribed)
00129     {
00130         parcel.T() = constProps_.T0();
00131         parcel.cp() = constProps_.cp0();
00132     }
00133 }
00134 
00135 
00136 template<class ParcelType>
00137 void Foam::ThermoCloud<ParcelType>::resetSourceTerms()
00138 {
00139     KinematicCloud<ParcelType>::resetSourceTerms();
00140     hsTrans_.field() = 0.0;
00141     hcTrans_.field() = 0.0;
00142 }
00143 
00144 
00145 template<class ParcelType>
00146 void Foam::ThermoCloud<ParcelType>::preEvolve()
00147 {
00148     KinematicCloud<ParcelType>::preEvolve();
00149 }
00150 
00151 
00152 template<class ParcelType>
00153 void Foam::ThermoCloud<ParcelType>::postEvolve()
00154 {
00155     KinematicCloud<ParcelType>::postEvolve();
00156 }
00157 
00158 
00159 template<class ParcelType>
00160 void Foam::ThermoCloud<ParcelType>::evolve()
00161 {
00162     preEvolve();
00163 
00164     const volScalarField& T = carrierThermo_.T();
00165     const volScalarField cp = carrierThermo_.Cp();
00166 
00167     autoPtr<interpolation<scalar> > rhoInterp = interpolation<scalar>::New
00168     (
00169         this->interpolationSchemes(),
00170         this->rho()
00171     );
00172 
00173     autoPtr<interpolation<vector> > UInterp = interpolation<vector>::New
00174     (
00175         this->interpolationSchemes(),
00176         this->U()
00177     );
00178 
00179     autoPtr<interpolation<scalar> > muInterp = interpolation<scalar>::New
00180     (
00181         this->interpolationSchemes(),
00182         this->mu()
00183     );
00184 
00185     autoPtr<interpolation<scalar> > TInterp = interpolation<scalar>::New
00186     (
00187         this->interpolationSchemes(),
00188         T
00189     );
00190 
00191     autoPtr<interpolation<scalar> > cpInterp = interpolation<scalar>::New
00192     (
00193         this->interpolationSchemes(),
00194         cp
00195     );
00196 
00197     typename ParcelType::trackData td
00198     (
00199         *this,
00200         constProps_,
00201         rhoInterp(),
00202         UInterp(),
00203         muInterp(),
00204         TInterp(),
00205         cpInterp(),
00206         this->g().value()
00207     );
00208 
00209     this->injection().inject(td);
00210 
00211     if (this->coupled())
00212     {
00213         resetSourceTerms();
00214     }
00215 
00216     Cloud<ParcelType>::move(td);
00217 
00218     postEvolve();
00219 }
00220 
00221 
00222 template<class ParcelType>
00223 void Foam::ThermoCloud<ParcelType>::info() const
00224 {
00225     KinematicCloud<ParcelType>::info();
00226 }
00227 
00228 
00229 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd