BUG: PointEdgeWave : n cyclics bool instead of label
[OpenFOAM-1.6.x.git] / src / lagrangian / intermediate / submodels / Reacting / PhaseChangeModel / PhaseChangeModel / PhaseChangeModel.H
blob27b92e2539119525271223a6dcb5e9ee6f33869d
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 public:
58     // Public enumerations
60         //- Enthalpy transfer type
61         enum enthalpyTransferType
62         {
63             etLatentHeat,
64             etEnthalpyDifference
65         };
67         //- Name representations of enthalpy transfer types
68         static const Foam::wordList enthalpyTransferTypeNames;
71 protected:
73     // Protected data
75         //- The cloud dictionary
76         const dictionary& dict_;
78         //- Reference to the owner cloud class
79         CloudType& owner_;
81         //- The coefficient dictionary
82         const dictionary coeffDict_;
84         //- Enthalpy transfer type enumeration
85         enthalpyTransferType enthalpyTransfer_;
88     // Protected member functions
90         //- Convert word to enthalpy transfer type
91         enthalpyTransferType wordToEnthalpyTransfer(const word& etName) const;
93         //- Sherwood number
94         scalar Sh() const;
97 public:
99     //- Runtime type information
100     TypeName("PhaseChangeModel");
102     //- Declare runtime constructor selection table
103     declareRunTimeSelectionTable
104     (
105         autoPtr,
106         PhaseChangeModel,
107         dictionary,
108         (
109             const dictionary& dict,
110             CloudType& owner
111         ),
112         (dict, owner)
113     );
116     // Constructors
118         //- Construct null from owner
119         PhaseChangeModel(CloudType& owner);
121         //- Construct from dictionary
122         PhaseChangeModel
123         (
124             const dictionary& dict,
125             CloudType& owner,
126             const word& type
127         );
130     //- Destructor
131     virtual ~PhaseChangeModel();
134     //- Selector
135     static autoPtr<PhaseChangeModel<CloudType> > New
136     (
137         const dictionary& dict,
138         CloudType& owner
139     );
142     // Access
144         //- Return the owner cloud object
145         const CloudType& owner() const;
147         //- Return the cloud dictionary
148         const dictionary& dict() const;
150         //- Return the coefficient dictionary
151         const dictionary& coeffDict() const;
153         //- Return the enthalpy transfer type enumeration
154         const enthalpyTransferType& enthalpyTransfer() const;
157     // Member Functions
159         //- Flag to indicate whether model activates phase change model
160         virtual bool active() const = 0;
162         //- Update model
163         virtual void calculate
164         (
165             const scalar dt,
166             const label cellI,
167             const scalar Re,
168             const scalar d,
169             const scalar nu,
170             const scalar T,
171             const scalar Ts,
172             const scalar pc,
173             scalarField& dMassPC
174         ) const = 0;
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 } // End namespace Foam
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 #define makePhaseChangeModel(CloudType)                                       \
185                                                                               \
186     defineNamedTemplateTypeNameAndDebug(PhaseChangeModel<CloudType>, 0);      \
187                                                                               \
188     defineTemplateRunTimeSelectionTable                                       \
189     (                                                                         \
190         PhaseChangeModel<CloudType>,                                          \
191         dictionary                                                            \
192     );
195 #define makePhaseChangeModelThermoType(SS, CloudType, ParcelType, ThermoType) \
196                                                                               \
197     defineNamedTemplateTypeNameAndDebug                                       \
198     (                                                                         \
199         SS<CloudType<ParcelType<ThermoType> > >,                              \
200         0                                                                     \
201     );                                                                        \
202                                                                               \
203     PhaseChangeModel<CloudType<ParcelType<ThermoType> > >::                   \
204         adddictionaryConstructorToTable                                       \
205             <SS<CloudType<ParcelType<ThermoType> > > >                        \
206             add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 #ifdef NoRepository
212 #   include "PhaseChangeModel.C"
213 #endif
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 #endif
219 // ************************************************************************* //