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

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