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

HeatTransferModel.H

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 Class
00025     Foam::HeatTransferModel
00026 
00027 Description
00028     Templated heat transfer model class
00029 
00030 SourceFiles
00031     HeatTransferModel.C
00032     NewHeatTransferModel.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef HeatTransferModel_H
00037 #define HeatTransferModel_H
00038 
00039 #include <OpenFOAM/IOdictionary.H>
00040 #include <OpenFOAM/autoPtr.H>
00041 #include <OpenFOAM/runTimeSelectionTables.H>
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 /*---------------------------------------------------------------------------*\
00049                        Class HeatTransferModel Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 template<class CloudType>
00053 class HeatTransferModel
00054 {
00055     // Private data
00056 
00057         //- The cloud dictionary
00058         const dictionary& dict_;
00059 
00060         //- Reference to the owner cloud class
00061         CloudType& owner_;
00062 
00063         //- The coefficients dictionary
00064         const dictionary coeffDict_;
00065 
00066         //- Apply Bird's correction to the htc
00067         const Switch BirdCorrection_;
00068 
00069 
00070 public:
00071 
00072     //- Runtime type information
00073     TypeName("HeatTransferModel");
00074 
00075     //- Declare runtime constructor selection table
00076     declareRunTimeSelectionTable
00077     (
00078         autoPtr,
00079         HeatTransferModel,
00080         dictionary,
00081         (
00082             const dictionary& dict,
00083             CloudType& owner
00084         ),
00085         (dict, owner)
00086     );
00087 
00088 
00089     // Constructors
00090 
00091         //- Construct null from owner
00092         HeatTransferModel(CloudType& owner);
00093 
00094         //- Construct from dictionary
00095         HeatTransferModel
00096         (
00097             const dictionary& dict,
00098             CloudType& owner,
00099             const word& type
00100         );
00101 
00102 
00103     //- Destructor
00104     virtual ~HeatTransferModel();
00105 
00106 
00107     //- Selector
00108     static autoPtr<HeatTransferModel<CloudType> > New
00109     (
00110         const dictionary& dict,
00111         CloudType& owner
00112     );
00113 
00114 
00115     // Member Functions
00116 
00117         // Access
00118 
00119             //- Return the cloud dictionary
00120             const dictionary& dict() const;
00121 
00122             //- Return the coefficients dictionary
00123             const dictionary& coeffDict() const;
00124 
00125             //- Return the owner cloud object
00126             const CloudType& owner() const;
00127 
00128             //- Return the Bird htc correction flag
00129             const Switch& BirdCorrection() const;
00130 
00131             //- Flag to indicate whether model activates heat transfer model
00132             virtual bool active() const = 0;
00133 
00134 
00135         // Evaluation
00136 
00137             //- Nusselt number
00138             virtual scalar Nu
00139             (
00140                 const scalar Re,
00141                 const scalar Pr
00142             ) const = 0;
00143 
00144             //- Return heat transfer coefficient
00145             virtual scalar htc
00146             (
00147                 const scalar dp,
00148                 const scalar Re,
00149                 const scalar Pr,
00150                 const scalar kappa,
00151                 const scalar NCpW
00152             ) const;
00153 };
00154 
00155 
00156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00157 
00158 } // End namespace Foam
00159 
00160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00161 
00162 #define makeHeatTransferModel(CloudType)                                      \
00163                                                                               \
00164     defineNamedTemplateTypeNameAndDebug(HeatTransferModel<CloudType>, 0);     \
00165                                                                               \
00166     defineTemplateRunTimeSelectionTable                                       \
00167     (                                                                         \
00168         HeatTransferModel<CloudType>,                                         \
00169         dictionary                                                            \
00170     );
00171 
00172 
00173 #define makeHeatTransferModelType(SS, CloudType, ParcelType)                  \
00174                                                                               \
00175     defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0);       \
00176                                                                               \
00177     HeatTransferModel<CloudType<ParcelType> >::                               \
00178         adddictionaryConstructorToTable<SS<CloudType<ParcelType> > >          \
00179             add##SS##CloudType##ParcelType##ConstructorToTable_;
00180 
00181 
00182 #define makeHeatTransferModelThermoType(SS, CloudType, ParcelType, ThermoType)\
00183                                                                               \
00184     defineNamedTemplateTypeNameAndDebug                                       \
00185     (                                                                         \
00186         SS<CloudType<ParcelType<ThermoType> > >,                              \
00187         0                                                                     \
00188     );                                                                        \
00189                                                                               \
00190     HeatTransferModel<CloudType<ParcelType<ThermoType> > >::                  \
00191         adddictionaryConstructorToTable                                       \
00192             <SS<CloudType<ParcelType<ThermoType> > > >                        \
00193             add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
00194 
00195 
00196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00197 
00198 #ifdef NoRepository
00199 #   include <lagrangianIntermediate/HeatTransferModel.C>
00200 #endif
00201 
00202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00203 
00204 #endif
00205 
00206 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines