twoPhaseMixture.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) 2011-2022 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::twoPhaseMixture
26 
27 Description
28  Class to represent a mixture of two phases
29 
30 SourceFiles
31  twoPhaseMixture.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef twoPhaseMixture_H
36 #define twoPhaseMixture_H
37 
38 #include "IOdictionary.H"
39 #include "volFields.H"
40 #include "twoPhases.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class twoPhaseMixture Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class twoPhaseMixture
52 :
53  public IOdictionary,
54  virtual public twoPhases
55 {
56  // Private data
57 
58  word phase1Name_;
59 
60  word phase2Name_;
61 
62  volScalarField alpha1_;
63 
64  volScalarField alpha2_;
65 
66 
67  // Private Member Functions
68 
69  static typeIOobject<IOdictionary> readPhasePropertiesDict
70  (
71  const objectRegistry& obr
72  );
73 
74 
75 public:
76 
77  TypeName("twoPhaseMixture");
78 
79 
80  // Constructors
81 
82  //- Construct from components
83  twoPhaseMixture(const fvMesh& mesh);
84 
85 
86  //- Destructor
88  {}
89 
90 
91  // Member Functions
92 
93  const word& phase1Name() const
94  {
95  return phase1Name_;
96  }
97 
98  const word& phase2Name() const
99  {
100  return phase2Name_;
101  }
102 
103  //- Return the phase-fraction of phase 1
104  const volScalarField& alpha1() const
105  {
106  return alpha1_;
107  }
108 
109  //- Return the phase-fraction of phase 1
111  {
112  return alpha1_;
113  }
114 
115  //- Return the phase-fraction of phase 2
116  const volScalarField& alpha2() const
117  {
118  return alpha2_;
119  }
120 
121  //- Return the phase-fraction of phase 2
123  {
124  return alpha2_;
125  }
126 
127  //- Return the mixture density
128  virtual const volScalarField& rho() const = 0;
129 
130  //- Interface fraction in a cell
132 
133  //- Correct the mixture properties
134  virtual void correct() = 0;
135 
136  //- Read base phaseProperties dictionary
137  virtual bool read() = 0;
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #endif
148 
149 // ************************************************************************* //
Generic GeometricField class.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
Registry of regIOobjects.
A class for managing temporary objects.
Definition: tmp.H:55
Class to represent a mixture of two phases.
twoPhaseMixture(const fvMesh &mesh)
Construct from components.
TypeName("twoPhaseMixture")
virtual bool read()=0
Read base phaseProperties dictionary.
const word & phase2Name() const
virtual void correct()=0
Correct the mixture properties.
const volScalarField & alpha1() const
Return the phase-fraction of phase 1.
const volScalarField & alpha2() const
Return the phase-fraction of phase 2.
~twoPhaseMixture()
Destructor.
virtual const volScalarField & rho() const =0
Return the mixture density.
const word & phase1Name() const
tmp< volScalarField::Internal > interfaceFraction() const
Interface fraction in a cell.
Interface to two phases.
Definition: twoPhases.H:49
const fvMesh & mesh() const
Access the mesh.
Definition: twoPhases.H:71
Templated form of IOobject providing type information for file reading and header type checking.
Definition: IOobject.H:531
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.