Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::incompressibleTwoPhaseMixture
29
30Description
31 A two-phase incompressible transportModel
32
33SourceFiles
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
49namespace Foam
50{
52/*---------------------------------------------------------------------------*\
53 Class incompressibleTwoPhaseMixture Declaration
54\*---------------------------------------------------------------------------*/
55
57:
58 public IOdictionary,
59 public transportModel,
60 public twoPhaseMixture
62protected:
63
64 // Protected data
71
72 const volVectorField& U_;
74
76
77
78 // Protected Member Functions
79
80 //- Calculate and return the laminar viscosity
81 void calcNu();
82
84public:
85
86 TypeName("incompressibleTwoPhaseMixture");
87
88
89 // Constructors
90
91 //- Construct from components
93 (
94 const volVectorField& U,
96 );
97
98
99 //- Destructor
100 virtual ~incompressibleTwoPhaseMixture() = default;
102
103 // Member Functions
104
105 //- Return const-access to phase1 viscosityModel
106 const viscosityModel& nuModel1() const
107 {
108 return *nuModel1_;
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
126 return rho2_;
127 };
128
129 //- Return const-access to the mixture velocity
130 const volVectorField& U() const
131 {
132 return U_;
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 Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
IOdictionary(const IOobject &io, const dictionary *fallback=nullptr)
Construct given an IOobject and optional fallback dictionary content.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
tmp< surfaceScalarField > muf() const
Return the face-interpolated dynamic laminar viscosity.
tmp< surfaceScalarField > nuf() const
Return the face-interpolated kinematic laminar viscosity.
const volVectorField & U() const
Return const-access to the mixture velocity.
const dimensionedScalar & rho1() const
Return const-access to phase1 density.
tmp< volScalarField > mu() const
Return the dynamic laminar viscosity.
virtual ~incompressibleTwoPhaseMixture()=default
Destructor.
const viscosityModel & nuModel1() const
Return const-access to phase1 viscosityModel.
const dimensionedScalar & rho2() const
Return const-access to phase2 density.
void calcNu()
Calculate and return the laminar viscosity.
virtual void correct()
Correct the laminar viscosity.
const viscosityModel & nuModel2() const
Return const-access to phase2 viscosityModel.
virtual tmp< volScalarField > nu() const
Return the kinematic laminar viscosity.
incompressibleTwoPhaseMixture(const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
virtual tmp< scalarField > nu(const label patchi) const
Return the laminar viscosity for patch.
TypeName("incompressibleTwoPhaseMixture")
virtual bool read()
Read base transportProperties dictionary.
A class for managing temporary objects.
Definition tmp.H:75
twoPhaseMixture(const fvMesh &mesh, const dictionary &dict)
Construct from components.
An abstract base class for incompressible viscosityModels.
Namespace for OpenFOAM.
GeometricField< vector, fvPatchField, volMesh > volVectorField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68