incompressibleTwoPhaseMixture.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::incompressibleTwoPhaseMixture
29 
30 Description
31  A two-phase incompressible transportModel
32 
33 SourceFiles
34  incompressibleTwoPhaseMixture.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef incompressibleTwoPhaseMixture_H
39 #define incompressibleTwoPhaseMixture_H
40 
43 #include "twoPhaseMixture.H"
44 #include "IOdictionary.H"
45 
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class incompressibleTwoPhaseMixture Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 :
58  public IOdictionary,
59  public transportModel,
60  public twoPhaseMixture
61 {
62 protected:
63 
64  // Protected data
65 
68 
71 
72  const volVectorField& U_;
73  const surfaceScalarField& phi_;
74 
76 
77 
78  // Protected Member Functions
79 
80  //- Calculate and return the laminar viscosity
81  void calcNu();
82 
83 
84 public:
85 
86  TypeName("incompressibleTwoPhaseMixture");
87 
88 
89  // Constructors
90 
91  //- Construct from components
93  (
94  const volVectorField& U,
95  const surfaceScalarField& phi
96  );
97 
98 
99  //- Destructor
100  virtual ~incompressibleTwoPhaseMixture() = default;
101 
102 
103  // Member Functions
104 
105  //- Return const-access to phase1 viscosityModel
106  const viscosityModel& nuModel1() const
107  {
108  return *nuModel1_;
109  }
110 
111  //- Return const-access to phase2 viscosityModel
112  const viscosityModel& nuModel2() const
113  {
114  return *nuModel2_;
115  }
116 
117  //- Return const-access to phase1 density
118  const dimensionedScalar& rho1() const
119  {
120  return rho1_;
121  }
122 
123  //- Return const-access to phase2 density
124  const dimensionedScalar& rho2() const
125  {
126  return rho2_;
127  };
128 
129  //- Return const-access to the mixture velocity
130  const volVectorField& U() const
131  {
132  return U_;
133  }
134 
135  //- Return the dynamic laminar viscosity
136  tmp<volScalarField> mu() const;
137 
138  //- Return the dynamic laminar viscosity on patch
139  tmp<scalarField> mu(const label patchI) const;
140 
141  //- Return the face-interpolated dynamic laminar viscosity
143 
144  //- Return the kinematic laminar viscosity
145  virtual tmp<volScalarField> nu() const
146  {
147  return nu_;
148  }
149 
150  //- Return the laminar viscosity for patch
151  virtual tmp<scalarField> nu(const label patchi) const
152  {
153  return nu_.boundaryField()[patchi];
154  }
155 
156  //- Return the face-interpolated kinematic laminar viscosity
157  tmp<surfaceScalarField> nuf() const;
158 
159  //- Correct the laminar viscosity
160  virtual void correct()
161  {
162  calcNu();
163  }
165  //- Read base transportProperties dictionary
166  virtual bool read();
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace Foam
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #endif
177 
178 // ************************************************************************* //
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.
virtual tmp< volScalarField > nu() const
Return the kinematic laminar viscosity.
incompressibleTwoPhaseMixture(const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
An abstract base class for incompressible viscosityModels.
tmp< surfaceScalarField > muf() const
Return the face-interpolated dynamic laminar viscosity.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:50
const volVectorField & U() const
Return const-access to the mixture velocity.
tmp< volScalarField > mu() const
Return the dynamic laminar viscosity.
virtual ~incompressibleTwoPhaseMixture()=default
Destructor.
virtual void correct()
Correct the laminar viscosity.
const viscosityModel & nuModel1() const
Return const-access to phase1 viscosityModel.
const viscosityModel & nuModel2() const
Return const-access to phase2 viscosityModel.
TypeName("incompressibleTwoPhaseMixture")
Base-class for all transport models used by the incompressible turbulence models. ...
A two-phase mixture model.
virtual bool read()
Read base transportProperties dictionary.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
void calcNu()
Calculate and return the laminar viscosity.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
Namespace for OpenFOAM.
const dimensionedScalar & rho1() const
Return const-access to phase1 density.