compressibleTwoPhaseMixture.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-2021 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  Thermophysical properties class for a mixture of two rhoThermo including
29  interfaceProperties for VoF for use in compressibleInterFoam.
30 
31 SourceFiles
32  compressibleTwoPhaseMixtureI.H
33  compressibleTwoPhaseMixture.C
34  compressibleTwoPhaseMixtureIO.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef compressibleTwoPhaseMixture_H
39 #define compressibleTwoPhaseMixture_H
40 
41 #include "rhoThermo.H"
42 #include "twoPhaseMixture.H"
43 #include "interfaceProperties.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class compressibleTwoPhaseMixture Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
56  public twoPhaseMixture,
57  public interfaceProperties,
58  public viscosity
59 {
60  // Private Data
61 
62  //- Switch to choose between solving for internal energy
63  // or total internal energy which is the default
64  Switch totalInternalEnergy_;
65 
66  //- Pressure
67  volScalarField p_;
68 
69  //- Mixture temperature
70  volScalarField T_;
71 
72  //- Thermo-package of phase 1
73  autoPtr<rhoThermo> thermo1_;
74 
75  //- Thermo-package of phase 2
76  autoPtr<rhoThermo> thermo2_;
77 
78  //- Mixture density
79  volScalarField rho_;
80 
81  //- Mass-fraction of phase 1
82  volScalarField Alpha1_;
83 
84  //- Mass-fraction of phase 2
85  volScalarField Alpha2_;
86 
87 
88 public:
89 
90  //- Runtime type information
91  TypeName("compressibleTwoPhaseMixture");
92 
93 
94  // Constructors
95 
96  //- Construct from components
98  (
99  const volVectorField& U,
100  const surfaceScalarField& phi
101  );
102 
103 
104  //- Destructor
106 
107 
108  // Member Functions
109 
110  //- Return true to solve for total internal energy
111  // return false to solve for internal energy
112  bool totalInternalEnergy() const
113  {
114  return totalInternalEnergy_;
115  }
116 
117  //- Return pressure [Pa]
118  volScalarField& p()
119  {
120  return p_;
121  }
122 
123  //- Return mixture temperature [K]
124  volScalarField& T()
125  {
126  return T_;
127  }
128 
129  //- Return the thermo for phase 1
130  const rhoThermo& thermo1() const
131  {
132  return thermo1_();
133  }
134 
135  //- Return the thermo for phase 2
136  const rhoThermo& thermo2() const
137  {
138  return thermo2_();
139  }
140 
141  //- Return the thermo for phase 1
142  rhoThermo& thermo1()
143  {
144  return thermo1_();
145  }
146 
147  //- Return the thermo for phase 2
148  rhoThermo& thermo2()
149  {
150  return thermo2_();
151  }
152 
153  //- Return the density of phase 1
154  const volScalarField& rho1() const
155  {
156  return thermo1_->rho();
157  }
158 
159  //- Return the density of phase 2
160  const volScalarField& rho2() const
161  {
162  return thermo2_->rho();
163  }
164 
165  //- Return mixture density [kg/m^3]
166  const volScalarField& rho() const
167  {
168  return rho_;
169  }
170 
171  //- Correct the thermodynamics of each phase
172  virtual void correctThermo();
173 
174  //- Update mixture properties
175  virtual void correct();
176 
177  //- Kinematic viscosity of mixture [m^2/s]
178  virtual tmp<volScalarField> nu() const;
179 
180  //- Kinematic viscosity of mixture for patch [m^2/s]
181  virtual tmp<scalarField> nu(const label patchi) const;
182 
183 
184  // IO
185 
186  //- Read base phaseProperties dictionary
187  virtual bool read();
188 };
189 
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #endif
198 
199 // ************************************************************************* //
bool totalInternalEnergy() const
Return true to solve for total internal energy.
virtual tmp< volScalarField > nu() const
Kinematic viscosity of mixture [m^2/s].
U
Definition: pEqn.H:72
volScalarField & p()
Return pressure [Pa].
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
Definition: Switch.H:60
virtual void correctThermo()
Correct the thermodynamics of each phase.
virtual void correct()
Update mixture properties.
Contains the interface properties.
const volScalarField & rho2() const
Return the density of phase 2.
compressibleTwoPhaseMixture(const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
phi
Definition: correctPhi.H:3
virtual ~compressibleTwoPhaseMixture()
Destructor.
TypeName("compressibleTwoPhaseMixture")
Runtime type information.
const volScalarField & rho() const
Return mixture density [kg/m^3].
volScalarField & T()
Return mixture temperature [K].
virtual bool read()
Read base phaseProperties dictionary.
const rhoThermo & thermo2() const
Return the thermo for phase 2.
Abstract base class for all fluid physical properties.
Definition: viscosity.H:49
label patchi
const volScalarField & rho1() const
Return the density of phase 1.
Base-class for fluid thermodynamic properties based on density.
Definition: rhoThermo.H:52
A two-phase mixture model.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Thermophysical properties class for a mixture of two rhoThermo including interfaceProperties for VoF ...
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.
const rhoThermo & thermo1() const
Return the thermo for phase 1.