virtualMassModel.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2014-2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::virtualMassModel
28 
29 Description
30 
31 SourceFiles
32  virtualMassModel.C
33  newVirtualMassModel.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef virtualMassModel_H
38 #define virtualMassModel_H
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 #include "volFields.H"
43 #include "dictionary.H"
44 #include "runTimeSelectionTables.H"
45 
46 namespace Foam
47 {
48 
49 class phasePair;
50 
51 /*---------------------------------------------------------------------------*\
52  Class virtualMassModel Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class virtualMassModel
56 :
57  public regIOobject
58 {
59 protected:
60 
61  // Protected data
62 
63  //- Phase pair
64  const phasePair& pair_;
65 
66 
67 public:
68 
69  //- Runtime type information
70  TypeName("virtualMassModel");
71 
72 
73  // Declare runtime construction
74 
76  (
77  autoPtr,
79  dictionary,
80  (
81  const dictionary& dict,
82  const phasePair& pair,
83  const bool registerObject
84  ),
85  (dict, pair, registerObject)
86  );
87 
88 
89  // Static data members
90 
91  //- Coefficient dimensions
92  static const dimensionSet dimK;
93 
94 
95  // Constructors
96 
97  //- Construct from a dictionary and a phase pair
99  (
100  const dictionary& dict,
101  const phasePair& pair,
102  const bool registerObject
103  );
104 
105 
106  //- Destructor
107  virtual ~virtualMassModel();
108 
109 
110  // Selectors
111 
113  (
114  const dictionary& dict,
115  const phasePair& pair
116  );
117 
118 
119  // Member Functions
120 
121  //- Return the virtual mass coefficient
122  virtual tmp<volScalarField> Cvm() const = 0;
123 
124  //- Return the phase-intensive virtual mass coefficient Ki
125  // used in the momentum equation
126  // ddt(alpha1*rho1*U1) + ... = ... alphad*K*(DU1_Dt - DU2_Dt)
127  // ddt(alpha2*rho2*U2) + ... = ... alphad*K*(DU1_Dt - DU2_Dt)
128  virtual tmp<volScalarField> Ki() const;
129 
130  //- Return the virtual mass coefficient K
131  // used in the momentum equation
132  // ddt(alpha1*rho1*U1) + ... = ... K*(DU1_Dt - DU2_Dt)
133  // ddt(alpha2*rho2*U2) + ... = ... K*(DU1_Dt - DU2_Dt)
134  virtual tmp<volScalarField> K() const;
135 
136  //- Return the virtual mass coefficient Kf
137  // used in the face-momentum equations
138  virtual tmp<surfaceScalarField> Kf() const;
139 
140  // Dummy write for regIOobject
141  bool writeData(Ostream& os) const;
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
Foam::virtualMassModel
Definition: virtualMassModel.H:54
volFields.H
Foam::phasePair
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
Definition: phasePair.H:51
Foam::virtualMassModel::~virtualMassModel
virtual ~virtualMassModel()
Destructor.
Definition: virtualMassModel.C:72
Foam::tmp< volScalarField >
Foam::virtualMassModel::virtualMassModel
virtualMassModel(const dictionary &dict, const phasePair &pair, const bool registerObject)
Construct from a dictionary and a phase pair.
Definition: virtualMassModel.C:48
Foam::virtualMassModel::writeData
bool writeData(Ostream &os) const
Pure virtual writeData function.
Definition: virtualMassModel.C:97
Foam::dimensionSet
Dimension set for the base types.
Definition: dimensionSet.H:65
Foam::virtualMassModel::K
virtual tmp< volScalarField > K() const
Return the virtual mass coefficient K.
Definition: virtualMassModel.C:84
Foam::virtualMassModel::Ki
virtual tmp< volScalarField > Ki() const
Return the phase-intensive virtual mass coefficient Ki.
Definition: virtualMassModel.C:78
Foam::IOobject::registerObject
bool registerObject() const
Should object created with this IOobject be registered?
Definition: IOobjectI.H:112
Foam::virtualMassModel::New
static autoPtr< virtualMassModel > New(const dictionary &dict, const phasePair &pair)
Definition: newVirtualMassModel.C:35
Foam::virtualMassModel::pair_
const phasePair & pair_
Phase pair.
Definition: virtualMassModel.H:63
Foam::virtualMassModel::TypeName
TypeName("virtualMassModel")
Runtime type information.
Foam::virtualMassModel::Cvm
virtual tmp< volScalarField > Cvm() const =0
Return the virtual mass coefficient.
Foam::virtualMassModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, virtualMassModel, dictionary,(const dictionary &dict, const phasePair &pair, const bool registerObject),(dict, pair, registerObject))
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::virtualMassModel::Kf
virtual tmp< surfaceScalarField > Kf() const
Return the virtual mass coefficient Kf.
Definition: virtualMassModel.C:90
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:68
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
dictionary.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::virtualMassModel::dimK
static const dimensionSet dimK
Coefficient dimensions.
Definition: virtualMassModel.H:91