virtualMassModel.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
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::virtualMassModel
26 
27 Description
28 
29 SourceFiles
30  virtualMassModel.C
31  newVirtualMassModel.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef virtualMassModel_H
36 #define virtualMassModel_H
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 #include "volFields.H"
41 #include "dictionary.H"
42 #include "runTimeSelectionTables.H"
43 
44 namespace Foam
45 {
46 
47 class phasePair;
48 
49 /*---------------------------------------------------------------------------*\
50  Class virtualMassModel Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class virtualMassModel
54 :
55  public regIOobject
56 {
57 protected:
58 
59  // Protected data
60 
61  //- Phase pair
62  const phasePair& pair_;
63 
64 
65 public:
66 
67  //- Runtime type information
68  TypeName("virtualMassModel");
69 
70 
71  // Declare runtime construction
72 
74  (
75  autoPtr,
77  dictionary,
78  (
79  const dictionary& dict,
80  const phasePair& pair,
81  const bool registerObject
82  ),
83  (dict, pair, registerObject)
84  );
85 
86 
87  // Static data members
88 
89  //- Coefficient dimensions
90  static const dimensionSet dimK;
91 
92 
93  // Constructors
94 
95  //- Construct from a dictionary and a phase pair
97  (
98  const dictionary& dict,
99  const phasePair& pair,
100  const bool registerObject
101  );
102 
103 
104  //- Destructor
105  virtual ~virtualMassModel();
106 
107 
108  // Selectors
109 
111  (
112  const dictionary& dict,
113  const phasePair& pair
114  );
115 
116 
117  // Member Functions
118 
119  //- Return the virtual mass coefficient
120  virtual tmp<volScalarField> Cvm() const = 0;
121 
122  //- Return the phase-intensive virtual mass coefficient Ki
123  // used in the momentum equation
124  // ddt(alpha1*rho1*U1) + ... = ... alphad*K*(DU1_Dt - DU2_Dt)
125  // ddt(alpha2*rho2*U2) + ... = ... alphad*K*(DU1_Dt - DU2_Dt)
126  virtual tmp<volScalarField> Ki() const;
127 
128  //- Return the virtual mass coefficient K
129  // used in the momentum equation
130  // ddt(alpha1*rho1*U1) + ... = ... K*(DU1_Dt - DU2_Dt)
131  // ddt(alpha2*rho2*U2) + ... = ... K*(DU1_Dt - DU2_Dt)
132  virtual tmp<volScalarField> K() const;
133 
134  //- Return the virtual mass coefficient Kf
135  // used in the face-momentum equations
136  virtual tmp<surfaceScalarField> Kf() const;
137 
138  // Dummy write for regIOobject
139  bool writeData(Ostream& os) const;
140 };
141 
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 } // End namespace Foam
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #endif
150 
151 // ************************************************************************* //
static autoPtr< virtualMassModel > New(const dictionary &dict, const phasePair &pair)
virtual ~virtualMassModel()
Destructor.
bool writeData(Ostream &os) const
Pure virtual writaData function.
dictionary dict
virtual tmp< surfaceScalarField > Kf() const
Return the virtual mass coefficient Kf.
virtualMassModel(const dictionary &dict, const phasePair &pair, const bool registerObject)
Construct from a dictionary and a phase pair.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
TypeName("virtualMassModel")
Runtime type information.
virtual tmp< volScalarField > Ki() const
Return the phase-intensive virtual mass coefficient Ki.
static const dimensionSet dimK
Coefficient dimensions.
Dimension set for the base types.
Definition: dimensionSet.H:120
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual tmp< volScalarField > Cvm() const =0
Return the virtual mass coefficient.
declareRunTimeSelectionTable(autoPtr, virtualMassModel, dictionary,(const dictionary &dict, const phasePair &pair, const bool registerObject),(dict, pair, registerObject))
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:65
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Macros to ease declaration of run-time selection tables.
A class for managing temporary objects.
Definition: PtrList.H:53
bool & registerObject()
Register object created from this IOobject with registry if true.
Definition: IOobject.H:333
const phasePair & pair_
Phase pair.
virtual tmp< volScalarField > K() const
Return the virtual mass coefficient K.
Namespace for OpenFOAM.