initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / intermediate / submodels / Reacting / PhaseChangeModel / PhaseChangeModel / PhaseChangeModel.H
blob7445ea6264ca0d8d31dd69d9769d0ad109338701
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2009-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::PhaseChangeModel
28 Description
29     Templated phase change model class
31 SourceFiles
32     PhaseChangeModel.C
33     NewPhaseChangeModel.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef PhaseChangeModel_H
38 #define PhaseChangeModel_H
40 #include "IOdictionary.H"
41 #include "autoPtr.H"
42 #include "runTimeSelectionTables.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                       Class PhaseChangeModel Declaration
51 \*---------------------------------------------------------------------------*/
53 template<class CloudType>
54 class PhaseChangeModel
56 protected:
58     // Protected data
60         //- The cloud dictionary
61         const dictionary& dict_;
63         //- Reference to the owner cloud class
64         CloudType& owner_;
66         //- The coefficient dictionary
67         const dictionary coeffDict_;
70     // Protected member functions
72         //- Sherwood number
73         scalar Sh() const;
76 public:
78     //- Runtime type information
79     TypeName("PhaseChangeModel");
81     //- Declare runtime constructor selection table
82     declareRunTimeSelectionTable
83     (
84         autoPtr,
85         PhaseChangeModel,
86         dictionary,
87         (
88             const dictionary& dict,
89             CloudType& owner
90         ),
91         (dict, owner)
92     );
95     // Constructors
97         //- Construct null from owner
98         PhaseChangeModel(CloudType& owner);
100         //- Construct from dictionary
101         PhaseChangeModel
102         (
103             const dictionary& dict,
104             CloudType& owner,
105             const word& type
106         );
109     //- Destructor
110     virtual ~PhaseChangeModel();
113     //- Selector
114     static autoPtr<PhaseChangeModel<CloudType> > New
115     (
116         const dictionary& dict,
117         CloudType& owner
118     );
121     // Access
123         //- Return the owner cloud object
124         const CloudType& owner() const;
126         //- Return the cloud dictionary
127         const dictionary& dict() const;
129         //- Return the coefficient dictionary
130         const dictionary& coeffDict() const;
133     // Member Functions
135         //- Flag to indicate whether model activates phase change model
136         virtual bool active() const = 0;
138         //- Update model
139         virtual void calculate
140         (
141             const scalar dt,
142             const label cellI,
143             const scalar d,
144             const scalar T,
145             const scalar pc,
146             const scalar Tc,
147             const scalar nuc,
148             const vector& Ur,
149             scalarField& dMassPC
150         ) const = 0;
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 } // End namespace Foam
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 #define makePhaseChangeModel(CloudType)                                       \
161                                                                               \
162     defineNamedTemplateTypeNameAndDebug(PhaseChangeModel<CloudType>, 0);      \
163                                                                               \
164     defineTemplateRunTimeSelectionTable                                       \
165     (                                                                         \
166         PhaseChangeModel<CloudType>,                                          \
167         dictionary                                                            \
168     );
171 #define makePhaseChangeModelThermoType(SS, CloudType, ParcelType, ThermoType) \
172                                                                               \
173     defineNamedTemplateTypeNameAndDebug                                       \
174     (                                                                         \
175         SS<CloudType<ParcelType<ThermoType> > >,                              \
176         0                                                                     \
177     );                                                                        \
178                                                                               \
179     PhaseChangeModel<CloudType<ParcelType<ThermoType> > >::                   \
180         adddictionaryConstructorToTable                                       \
181             <SS<CloudType<ParcelType<ThermoType> > > >                        \
182             add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 #ifdef NoRepository
188 #   include "PhaseChangeModel.C"
189 #endif
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 #endif
195 // ************************************************************************* //