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

PhaseChangeModel.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) 2009-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::PhaseChangeModel
00027 
00028 Description
00029     Templated phase change model class
00030 
00031 SourceFiles
00032     PhaseChangeModel.C
00033     NewPhaseChangeModel.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef PhaseChangeModel_H
00038 #define PhaseChangeModel_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 PhaseChangeModel Declaration
00051 \*---------------------------------------------------------------------------*/
00052 
00053 template<class CloudType>
00054 class PhaseChangeModel
00055 {
00056 protected:
00057 
00058     // Protected data
00059 
00060         //- The cloud dictionary
00061         const dictionary& dict_;
00062 
00063         //- Reference to the owner cloud class
00064         CloudType& owner_;
00065 
00066         //- The coefficient dictionary
00067         const dictionary coeffDict_;
00068 
00069 
00070     // Protected member functions
00071 
00072         //- Sherwood number
00073         scalar Sh() const;
00074 
00075 
00076 public:
00077 
00078     //- Runtime type information
00079     TypeName("PhaseChangeModel");
00080 
00081     //- Declare runtime constructor selection table
00082     declareRunTimeSelectionTable
00083     (
00084         autoPtr,
00085         PhaseChangeModel,
00086         dictionary,
00087         (
00088             const dictionary& dict,
00089             CloudType& owner
00090         ),
00091         (dict, owner)
00092     );
00093 
00094 
00095     // Constructors
00096 
00097         //- Construct null from owner
00098         PhaseChangeModel(CloudType& owner);
00099 
00100         //- Construct from dictionary
00101         PhaseChangeModel
00102         (
00103             const dictionary& dict,
00104             CloudType& owner,
00105             const word& type
00106         );
00107 
00108 
00109     //- Destructor
00110     virtual ~PhaseChangeModel();
00111 
00112 
00113     //- Selector
00114     static autoPtr<PhaseChangeModel<CloudType> > New
00115     (
00116         const dictionary& dict,
00117         CloudType& owner
00118     );
00119 
00120 
00121     // Access
00122 
00123         //- Return the owner cloud object
00124         const CloudType& owner() const;
00125 
00126         //- Return the cloud dictionary
00127         const dictionary& dict() const;
00128 
00129         //- Return the coefficient dictionary
00130         const dictionary& coeffDict() const;
00131 
00132 
00133     // Member Functions
00134 
00135         //- Flag to indicate whether model activates phase change model
00136         virtual bool active() const = 0;
00137 
00138         //- Update model
00139         virtual void calculate
00140         (
00141             const scalar dt,
00142             const label cellI,
00143             const scalar d,
00144             const scalar T,
00145             const scalar pc,
00146             const scalar Tc,
00147             const scalar nuc,
00148             const vector& Ur,
00149             scalarField& dMassPC
00150         ) const = 0;
00151 };
00152 
00153 
00154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00155 
00156 } // End namespace Foam
00157 
00158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00159 
00160 #define makePhaseChangeModel(CloudType)                                       \
00161                                                                               \
00162     defineNamedTemplateTypeNameAndDebug(PhaseChangeModel<CloudType>, 0);      \
00163                                                                               \
00164     defineTemplateRunTimeSelectionTable                                       \
00165     (                                                                         \
00166         PhaseChangeModel<CloudType>,                                          \
00167         dictionary                                                            \
00168     );
00169 
00170 
00171 #define makePhaseChangeModelThermoType(SS, CloudType, ParcelType, ThermoType) \
00172                                                                               \
00173     defineNamedTemplateTypeNameAndDebug                                       \
00174     (                                                                         \
00175         SS<CloudType<ParcelType<ThermoType> > >,                              \
00176         0                                                                     \
00177     );                                                                        \
00178                                                                               \
00179     PhaseChangeModel<CloudType<ParcelType<ThermoType> > >::                   \
00180         adddictionaryConstructorToTable                                       \
00181             <SS<CloudType<ParcelType<ThermoType> > > >                        \
00182             add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
00183 
00184 
00185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00186 
00187 #ifdef NoRepository
00188 #   include "PhaseChangeModel.C"
00189 #endif
00190 
00191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00192 
00193 #endif
00194 
00195 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd