twoPhaseSystem.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) 2013-2019 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::twoPhaseSystem
26 
27 Description
28  Class which solves the volume fraction equations for two phases.
29 
30 SourceFiles
31  twoPhaseSystem.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef twoPhaseSystem_H
36 #define twoPhaseSystem_H
37 
38 #include "phaseSystem.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 class dragModel;
46 class virtualMassModel;
47 
48 /*---------------------------------------------------------------------------*\
49  Class twoPhaseSystem Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class twoPhaseSystem
53 :
54  public phaseSystem
55 {
56 private:
57 
58  // Private Member Functions
59 
60  //- Return the drag coefficient for phase pair
61  virtual tmp<volScalarField> Kd(const phasePairKey& key) const = 0;
62 
63  //- Return the face drag coefficient for phase pair
64  virtual tmp<surfaceScalarField> Kdf(const phasePairKey& key) const = 0;
65 
66  //- Return the virtual mass coefficient for phase pair
67  virtual tmp<volScalarField> Vm(const phasePairKey& key) const = 0;
68 
69 
70 protected:
71 
72  // Protected data
73 
74  //- Flag to indicate that returned lists of fields are "complete"; i.e.,
75  // that an absence of force is returned as a constructed list of zeros,
76  // rather than a null pointer
77  static const bool fillFields_ = true;
78 
79  //- Phase model 1
81 
82  //- Phase model 2
84 
85 
86 public:
87 
88  //- Runtime type information
89  TypeName("twoPhaseSystem");
90 
91  // Declare runtime construction
92 
94  (
95  autoPtr,
97  dictionary,
98  (
99  const fvMesh& mesh
100  ),
101  (mesh)
102  );
103 
104 
105  // Constructors
106 
107  //- Construct from fvMesh
108  twoPhaseSystem(const fvMesh&);
109 
110 
111  //- Destructor
112  virtual ~twoPhaseSystem();
113 
114 
115  // Selectors
116 
118  (
119  const fvMesh& mesh
120  );
121 
122 
123  // Member Functions
124 
125  using phaseSystem::sigma;
126  using phaseSystem::dmdts;
127 
128  //- Return phase model 1
129  const phaseModel& phase1() const;
130 
131  //- Access phase model 1
132  phaseModel& phase1();
133 
134  //- Return phase model 2
135  const phaseModel& phase2() const;
136 
137  //- Access phase model 2
138  phaseModel& phase2();
139 
140  //- Return the phase not given as an argument
141  const phaseModel& otherPhase(const phaseModel& phase) const;
142 
143  //- Return the surface tension coefficient
144  tmp<volScalarField> sigma() const;
145 
146  //- Return the drag coefficient
147  tmp<volScalarField> Kd() const;
148 
149  //- Return the face drag coefficient
151 
152  //- Return the virtual mass coefficient
153  tmp<volScalarField> Vm() const;
154 
155  //- Solve for the phase fractions
156  virtual void solve();
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #include "twoPhaseSystemI.H"
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
phaseModel & phase1_
Phase model 1.
const phaseModel & phase1() const
Return phase model 1.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
tmp< volScalarField > sigma() const
Return the surface tension coefficient.
tmp< volScalarField > sigma(const phasePairKey &key) const
Return the surface tension coefficient for a pair.
const fvMesh & mesh() const
Return the mesh.
declareRunTimeSelectionTable(autoPtr, twoPhaseSystem, dictionary,(const fvMesh &mesh),(mesh))
Class which solves the volume fraction equations for two phases.
tmp< volScalarField > Kd() const
Return the drag coefficient.
const phaseModel & phase2() const
Return phase model 2.
TypeName("twoPhaseSystem")
Runtime type information.
phaseModel & phase2_
Phase model 2.
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:67
twoPhaseSystem(const fvMesh &)
Construct from fvMesh.
tmp< surfaceScalarField > Kdf() const
Return the face drag coefficient.
virtual PtrList< volScalarField > dmdts() const
Return the mass transfer rates for each phase.
const phaseModel & otherPhase(const phaseModel &phase) const
Return the phase not given as an argument.
virtual void solve()
Solve for the phase fractions.
virtual ~twoPhaseSystem()
Destructor.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phase.H:52
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
static autoPtr< twoPhaseSystem > New(const fvMesh &mesh)
A class for managing temporary objects.
Definition: PtrList.H:53
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:53
Namespace for OpenFOAM.
tmp< volScalarField > Vm() const
Return the virtual mass coefficient.