incompressibleTwoPhaseVoFMixture.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-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::incompressibleTwoPhaseVoFMixture
26 
27 Description
28  Class to represent a mixture of two constant density phases
29 
30 SourceFiles
31  incompressibleTwoPhaseVoFMixture.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef incompressibleTwoPhaseVoFMixture_H
36 #define incompressibleTwoPhaseVoFMixture_H
37 
38 #include "twoPhaseVoFMixture.H"
40 #include "viscosityModel.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class incompressibleTwoPhaseVoFMixture Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 :
53  public twoPhaseVoFMixture,
54  virtual public incompressibleTwoPhases,
55  public viscosity
56 {
57  // Private Data
58 
59  //- Viscosity model for phase 1
60  autoPtr<viscosityModel> nuModel1_;
61 
62  //- Viscosity model for phase 2
63  autoPtr<viscosityModel> nuModel2_;
64 
65  //- Constant density of phase 1
66  dimensionedScalar rho1_;
67 
68  //- Constant density of phase 2
69  dimensionedScalar rho2_;
70 
71  //- Mixture density
72  volScalarField rho_;
73 
74  //- Mixture viscosity
75  volScalarField nu_;
76 
77 
78 public:
79 
80  TypeName("incompressibleTwoPhaseVoFMixture");
81 
82 
83  // Constructors
84 
85  //- Construct from a mesh
87 
88 
89  //- Destructor
91  {}
92 
93 
94  // Member Functions
95 
96  //- Return const-access to phase1 viscosityModel
97  const viscosityModel& nuModel1() const
98  {
99  return nuModel1_();
100  }
101 
102  //- Return const-access to phase2 viscosityModel
103  const viscosityModel& nuModel2() const
104  {
105  return nuModel2_();
106  }
107 
108  //- Return const-access to phase1 density
109  const dimensionedScalar& rho1() const
110  {
111  return rho1_;
112  }
113 
114  //- Return const-access to phase2 density
115  const dimensionedScalar& rho2() const
116  {
117  return rho2_;
118  };
119 
120  //- Return the mixture density
121  virtual const volScalarField& rho() const
122  {
123  return rho_;
124  }
125 
126  //- Return the dynamic laminar viscosity
127  tmp<volScalarField> mu() const;
128 
129  //- Return the face-interpolated dynamic laminar viscosity
131 
132  //- Return the kinematic laminar viscosity
133  virtual tmp<volScalarField> nu() const
134  {
135  return nu_;
136  }
137 
138  //- Return the laminar viscosity for patch
139  virtual tmp<scalarField> nu(const label patchi) const
140  {
141  return nu_.boundaryField()[patchi];
142  }
143 
144  //- Return the face-interpolated kinematic laminar viscosity
146 
147  //- Correct the mixture density and laminar viscosity
148  virtual void correct();
149 
150  //- Read base phaseProperties dictionary
151  virtual bool read();
152 };
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 } // End namespace Foam
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #endif
162 
163 // ************************************************************************* //
Generic GeometricField class.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
Class to represent a mixture of two constant density phases.
tmp< surfaceScalarField > muf() const
Return the face-interpolated dynamic laminar viscosity.
const viscosityModel & nuModel1() const
Return const-access to phase1 viscosityModel.
tmp< surfaceScalarField > nuf() const
Return the face-interpolated kinematic laminar viscosity.
TypeName("incompressibleTwoPhaseVoFMixture")
virtual void correct()
Correct the mixture density and laminar viscosity.
tmp< volScalarField > mu() const
Return the dynamic laminar viscosity.
virtual tmp< volScalarField > nu() const
Return the kinematic laminar viscosity.
const viscosityModel & nuModel2() const
Return const-access to phase2 viscosityModel.
const dimensionedScalar & rho1() const
Return const-access to phase1 density.
virtual const volScalarField & rho() const
Return the mixture density.
const dimensionedScalar & rho2() const
Return const-access to phase2 density.
incompressibleTwoPhaseVoFMixture(const fvMesh &mesh)
Construct from a mesh.
virtual bool read()
Read base phaseProperties dictionary.
Interface to two constant density phases.
A class for managing temporary objects.
Definition: tmp.H:55
Class to represent a VoF mixture.
const fvMesh & mesh() const
Access the mesh.
Definition: twoPhases.H:71
An abstract base class for Newtonian viscosity models.
Abstract base class for all fluid physical properties.
Definition: viscosity.H:50
label patchi
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59