compressibleTwoPhases.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) 2022-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::compressibleTwoPhaseMixture
26 
27 Description
28  Interface to two rhoThermo-based phases
29 
30 SourceFiles
31  compressibleTwoPhases.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef compressibleTwoPhases_H
36 #define compressibleTwoPhases_H
37 
38 #include "twoPhases.H"
39 #include "rhoThermo.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class compressibleTwoPhases Declaration
48 \*---------------------------------------------------------------------------*/
49 
51 :
52  virtual public twoPhases
53 {
54 public:
55 
56  //- Runtime type information
57  TypeName("compressibleTwoPhases");
58 
59 
60  // Constructors
61 
62  //- Default construct
64  {}
65 
66 
67  //- Destructor
68  virtual ~compressibleTwoPhases()
69  {}
70 
71 
72  // Member Functions
73 
74  //- Return the thermo for phase 1
75  virtual const rhoThermo& thermo1() const = 0;
76 
77  //- Return the thermo for phase 2
78  virtual const rhoThermo& thermo2() const = 0;
79 
80  //- Return the density of a given phase
81  inline const rhoThermo& thermo(const bool index) const
82  {
83  return index ? thermo2() : thermo1();
84  }
85 
86  //- Return the density of phase 1
87  virtual const volScalarField& rho1() const = 0;
88 
89  //- Return the density of phase 2
90  virtual const volScalarField& rho2() const = 0;
91 
92  //- Return the density of a given phase
93  inline const volScalarField& rho(const bool index) const
94  {
95  return index ? rho2() : rho1();
96  }
97 };
98 
99 
100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101 
102 } // End namespace Foam
103 
104 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105 
106 #endif
107 
108 // ************************************************************************* //
Generic GeometricField class.
virtual const volScalarField & rho1() const =0
Return the density of phase 1.
const volScalarField & rho(const bool index) const
Return the density of a given phase.
TypeName("compressibleTwoPhases")
Runtime type information.
virtual const rhoThermo & thermo1() const =0
Return the thermo for phase 1.
virtual ~compressibleTwoPhases()
Destructor.
const rhoThermo & thermo(const bool index) const
Return the density of a given phase.
compressibleTwoPhases()
Default construct.
virtual const volScalarField & rho2() const =0
Return the density of phase 2.
virtual const rhoThermo & thermo2() const =0
Return the thermo for phase 2.
Base-class for fluid thermodynamic properties based on density.
Definition: rhoThermo.H:55
Interface to two phases.
Definition: twoPhases.H:49
bool index(const word &name) const
Return the index associated with a given phase name.
Definition: twoPhases.H:77
Namespace for OpenFOAM.