FreeFOAM The Cross-Platform CFD Toolkit
PhaseChangeModel.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::PhaseChangeModel
26 
27 Description
28  Templated phase change model class
29 
30 SourceFiles
31  PhaseChangeModel.C
32  NewPhaseChangeModel.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef PhaseChangeModel_H
37 #define PhaseChangeModel_H
38 
39 #include <OpenFOAM/IOdictionary.H>
40 #include <OpenFOAM/autoPtr.H>
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class PhaseChangeModel Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class CloudType>
54 {
55 public:
56 
57  // Public enumerations
58 
59  //- Enthalpy transfer type
61  {
64  };
65 
66  //- Name representations of enthalpy transfer types
68 
69 
70 protected:
71 
72  // Protected data
73 
74  //- The cloud dictionary
75  const dictionary& dict_;
76 
77  //- Reference to the owner cloud class
78  CloudType& owner_;
79 
80  //- The coefficient dictionary
82 
83  //- Enthalpy transfer type enumeration
85 
86 
87  // Protected member functions
88 
89  //- Convert word to enthalpy transfer type
91 
92  //- Sherwood number
93  scalar Sh() const;
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("PhaseChangeModel");
100 
101  //- Declare runtime constructor selection table
103  (
104  autoPtr,
106  dictionary,
107  (
108  const dictionary& dict,
109  CloudType& owner
110  ),
111  (dict, owner)
112  );
113 
114 
115  // Constructors
116 
117  //- Construct null from owner
118  PhaseChangeModel(CloudType& owner);
119 
120  //- Construct from dictionary
122  (
123  const dictionary& dict,
124  CloudType& owner,
125  const word& type
126  );
127 
128 
129  //- Destructor
130  virtual ~PhaseChangeModel();
131 
132 
133  //- Selector
135  (
136  const dictionary& dict,
137  CloudType& owner
138  );
139 
140 
141  // Access
142 
143  //- Return the owner cloud object
144  const CloudType& owner() const;
145 
146  //- Return the cloud dictionary
147  const dictionary& dict() const;
148 
149  //- Return the coefficient dictionary
150  const dictionary& coeffDict() const;
151 
152  //- Return the enthalpy transfer type enumeration
153  const enthalpyTransferType& enthalpyTransfer() const;
154 
155 
156  // Member Functions
157 
158  //- Flag to indicate whether model activates phase change model
159  virtual bool active() const = 0;
160 
161  //- Update model
162  virtual void calculate
163  (
164  const scalar dt,
165  const label cellI,
166  const scalar Re,
167  const scalar d,
168  const scalar nu,
169  const scalar T,
170  const scalar Ts,
171  const scalar pc,
172  scalarField& dMassPC
173  ) const = 0;
174 };
175 
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 } // End namespace Foam
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #define makePhaseChangeModel(CloudType) \
184  \
185  defineNamedTemplateTypeNameAndDebug(PhaseChangeModel<CloudType>, 0); \
186  \
187  defineTemplateRunTimeSelectionTable \
188  ( \
189  PhaseChangeModel<CloudType>, \
190  dictionary \
191  );
192 
193 
194 #define makePhaseChangeModelThermoType(SS, CloudType, ParcelType, ThermoType) \
195  \
196  defineNamedTemplateTypeNameAndDebug \
197  ( \
198  SS<CloudType<ParcelType<ThermoType> > >, \
199  0 \
200  ); \
201  \
202  PhaseChangeModel<CloudType<ParcelType<ThermoType> > >:: \
203  adddictionaryConstructorToTable \
204  <SS<CloudType<ParcelType<ThermoType> > > > \
205  add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
206 
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 #ifdef NoRepository
211 # include "PhaseChangeModel.C"
212 #endif
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 #endif
217 
218 // ************************ vim: set sw=4 sts=4 et: ************************ //