1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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
26 Foam::PhaseChangeModel
29 Templated phase change model class
35 \*---------------------------------------------------------------------------*/
37 #ifndef PhaseChangeModel_H
38 #define PhaseChangeModel_H
40 #include "IOdictionary.H"
42 #include "runTimeSelectionTables.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class PhaseChangeModel Declaration
51 \*---------------------------------------------------------------------------*/
53 template<class CloudType>
54 class PhaseChangeModel
58 // Public enumerations
60 //- Enthalpy transfer type
61 enum enthalpyTransferType
67 //- Name representations of enthalpy transfer types
68 static const Foam::wordList enthalpyTransferTypeNames;
75 //- The cloud dictionary
76 const dictionary& dict_;
78 //- Reference to the owner cloud class
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;
99 //- Runtime type information
100 TypeName("PhaseChangeModel");
102 //- Declare runtime constructor selection table
103 declareRunTimeSelectionTable
109 const dictionary& dict,
118 //- Construct null from owner
119 PhaseChangeModel(CloudType& owner);
121 //- Construct from dictionary
124 const dictionary& dict,
131 virtual ~PhaseChangeModel();
135 static autoPtr<PhaseChangeModel<CloudType> > New
137 const dictionary& dict,
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;
159 //- Flag to indicate whether model activates phase change model
160 virtual bool active() const = 0;
163 virtual void calculate
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 } // End namespace Foam
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 #define makePhaseChangeModel(CloudType) \
186 defineNamedTemplateTypeNameAndDebug(PhaseChangeModel<CloudType>, 0); \
188 defineTemplateRunTimeSelectionTable \
190 PhaseChangeModel<CloudType>, \
195 #define makePhaseChangeModelThermoType(SS, CloudType, ParcelType, ThermoType) \
197 defineNamedTemplateTypeNameAndDebug \
199 SS<CloudType<ParcelType<ThermoType> > >, \
203 PhaseChangeModel<CloudType<ParcelType<ThermoType> > >:: \
204 adddictionaryConstructorToTable \
205 <SS<CloudType<ParcelType<ThermoType> > > > \
206 add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 # include "PhaseChangeModel.C"
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 // ************************************************************************* //