incompressibleTwoPhaseMixture.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-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::incompressibleTwoPhaseMixture
26 
27 Description
28  A two-phase incompressible transportModel
29 
30 SourceFiles
31  incompressibleTwoPhaseMixture.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef incompressibleTwoPhaseMixture_H
36 #define incompressibleTwoPhaseMixture_H
37 
38 #include "twoPhaseMixture.H"
39 #include "viscosityModel.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class incompressibleTwoPhaseMixture Declaration
48 \*---------------------------------------------------------------------------*/
49 
51 :
52  public twoPhaseMixture,
53  public viscosity
54 {
55  // Private Data
56 
57  autoPtr<viscosityModel> nuModel1_;
58  autoPtr<viscosityModel> nuModel2_;
59 
60  dimensionedScalar rho1_;
61  dimensionedScalar rho2_;
62 
63  const volVectorField& U_;
64 
65  volScalarField nu_;
66 
67 
68 public:
69 
70  TypeName("incompressibleTwoPhaseMixture");
71 
72 
73  // Constructors
74 
75  //- Construct from components
77  (
78  const volVectorField& U,
79  const surfaceScalarField& phi
80  );
81 
82 
83  //- Destructor
85  {}
86 
87 
88  // Member Functions
89 
90  //- Return const-access to phase1 viscosityModel
91  const viscosityModel& nuModel1() const
92  {
93  return nuModel1_();
94  }
95 
96  //- Return const-access to phase2 viscosityModel
97  const viscosityModel& nuModel2() const
98  {
99  return nuModel2_();
100  }
101 
102  //- Return const-access to phase1 density
103  const dimensionedScalar& rho1() const
104  {
105  return rho1_;
106  }
107 
108  //- Return const-access to phase2 density
109  const dimensionedScalar& rho2() const
110  {
111  return rho2_;
112  };
113 
114  //- Return const-access to the mixture velocity
115  const volVectorField& U() const
116  {
117  return U_;
118  }
119 
120  //- Return the mixture density
121  tmp<volScalarField> rho() const;
122 
123  //- Return the dynamic laminar viscosity
124  tmp<volScalarField> mu() const;
125 
126  //- Return the face-interpolated dynamic laminar viscosity
128 
129  //- Return the kinematic laminar viscosity
130  virtual tmp<volScalarField> nu() const
131  {
132  return nu_;
133  }
134 
135  //- Return the laminar viscosity for patch
136  virtual tmp<scalarField> nu(const label patchi) const
137  {
138  return nu_.boundaryField()[patchi];
139  }
140 
141  //- Return the face-interpolated kinematic laminar viscosity
143 
144  //- Correct the laminar viscosity
145  virtual void correct();
146 
147  //- Read base phaseProperties dictionary
148  virtual bool read();
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #endif
159 
160 // ************************************************************************* //
const dimensionedScalar & rho2() const
Return const-access to phase2 density.
tmp< surfaceScalarField > nuf() const
Return the face-interpolated kinematic laminar viscosity.
A two-phase incompressible transportModel.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
virtual tmp< volScalarField > nu() const
Return the kinematic laminar viscosity.
incompressibleTwoPhaseMixture(const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
tmp< volScalarField > rho() const
Return the mixture density.
An abstract base class for Newtonian viscosity models.
tmp< surfaceScalarField > muf() const
Return the face-interpolated dynamic laminar viscosity.
const volVectorField & U() const
Return const-access to the mixture velocity.
phi
Definition: correctPhi.H:3
tmp< volScalarField > mu() const
Return the dynamic laminar viscosity.
Abstract base class for all fluid physical properties.
Definition: viscosity.H:49
const viscosityModel & nuModel1() const
Return const-access to phase1 viscosityModel.
virtual void correct()
Correct the laminar viscosity.
label patchi
const viscosityModel & nuModel2() const
Return const-access to phase2 viscosityModel.
TypeName("incompressibleTwoPhaseMixture")
A two-phase mixture model.
virtual bool read()
Read base phaseProperties dictionary.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.
const dimensionedScalar & rho1() const
Return const-access to phase1 density.