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-2023 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  Model for virtual mass between phases
29 
30 SourceFiles
31  virtualMassModel.C
32  virtualMassModelNew.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef virtualMassModel_H
37 #define virtualMassModel_H
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 #include "volFields.H"
42 #include "dictionary.H"
43 #include "runTimeSelectionTables.H"
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class virtualMassModel Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class virtualMassModel
54 :
55  public regIOobject
56 {
57 public:
58 
59  //- Runtime type information
60  TypeName("virtualMassModel");
61 
62 
63  // Declare runtime construction
64 
66  (
67  autoPtr,
69  dictionary,
70  (
71  const dictionary& dict,
72  const phaseInterface& interface,
73  const bool registerObject
74  ),
75  (dict, interface, registerObject)
76  );
77 
78 
79  // Static Data Members
80 
81  //- Coefficient dimensions
82  static const dimensionSet dimK;
83 
84  //- This model should not be set to 0 on fixed flux boundaries
85  static const bool correctFixedFluxBCs = false;
86 
87 
88  // Constructors
89 
90  //- Construct from a dictionary and an interface
92  (
93  const dictionary& dict,
94  const phaseInterface& interface,
95  const bool registerObject
96  );
97 
98 
99  //- Destructor
100  virtual ~virtualMassModel();
101 
102 
103  // Selectors
104 
106  (
107  const dictionary& dict,
108  const phaseInterface& interface,
109  const bool outer=true,
110  const bool registerObject=true
111  );
112 
113 
114  // Member Functions
115 
116  //- Return the virtual mass coefficient K
117  // used in the momentum equation
118  // ddt(alpha1*rho1*U1) + ... = ... K*(DU1_Dt - DU2_Dt)
119  // ddt(alpha2*rho2*U2) + ... = ... K*(DU1_Dt - DU2_Dt)
120  virtual tmp<volScalarField> K() const = 0;
121 
122  // Dummy write for regIOobject
123  bool writeData(Ostream& os) const;
124 };
125 
126 
127 /*---------------------------------------------------------------------------*\
128  Class blendedVirtualMassModel Declaration
129 \*---------------------------------------------------------------------------*/
130 
132 :
133  public BlendedInterfacialModel<virtualMassModel>
134 {
135 public:
136 
137  // Constructors
138 
139  //- Inherit base class constructors
140  using
143 
144 
145  // Selectors
146 
148  (
149  const dictionary& dict,
151  );
152 
153 
154  // Member Functions
155 
156  //- Return the virtual mass coefficient K
157  tmp<volScalarField> K() const;
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #endif
168 
169 // ************************************************************************* //
const phaseInterface & interface() const
Access the interface.
BlendedInterfacialModel(const dictionary &dict, const phaseInterface &interface)
Construct from a dictionary and an interface.
bool & registerObject()
Register object created from this IOobject with registry if true.
Definition: IOobject.H:346
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
static autoPtr< blendedVirtualMassModel > New(const dictionary &dict, const phaseInterface &interface)
tmp< volScalarField > K() const
Return the virtual mass coefficient K.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Dimension set for the base types.
Definition: dimensionSet.H:122
Class to represent an interface between phases. Derivations can further specify the configuration of ...
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:55
A class for managing temporary objects.
Definition: tmp.H:55
Model for virtual mass between phases.
virtual ~virtualMassModel()
Destructor.
bool writeData(Ostream &os) const
Pure virtual writaData function.
declareRunTimeSelectionTable(autoPtr, virtualMassModel, dictionary,(const dictionary &dict, const phaseInterface &interface, const bool registerObject),(dict, interface, registerObject))
virtual tmp< volScalarField > K() const =0
Return the virtual mass coefficient K.
static const bool correctFixedFluxBCs
This model should not be set to 0 on fixed flux boundaries.
static autoPtr< virtualMassModel > New(const dictionary &dict, const phaseInterface &interface, const bool outer=true, const bool registerObject=true)
virtualMassModel(const dictionary &dict, const phaseInterface &interface, const bool registerObject)
Construct from a dictionary and an interface.
static const dimensionSet dimK
Coefficient dimensions.
TypeName("virtualMassModel")
Runtime type information.
Namespace for OpenFOAM.
void outer(FieldField< Field1, typename outerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Macros to ease declaration of run-time selection tables.
dictionary dict