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-2025 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"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class incompressibleTwoPhaseVoFMixture Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 :
54  public twoPhaseVoFMixture,
55  virtual public incompressibleTwoPhases,
56  public viscosity
57 {
58  // Private Data
59 
60  //- Viscosity model for phase 1
61  autoPtr<viscosityModel> nuModel1_;
62 
63  //- Viscosity model for phase 2
64  autoPtr<viscosityModel> nuModel2_;
65 
66  //- Constant density of phase 1
67  uniformDimensionedScalarField rho1_;
68 
69  //- Constant density of phase 2
70  uniformDimensionedScalarField rho2_;
71 
72  //- Mixture density
73  volScalarField rho_;
74 
75  //- Mixture viscosity
76  volScalarField nu_;
77 
78 
79 public:
80 
81  TypeName("incompressibleTwoPhaseVoFMixture");
82 
83 
84  // Constructors
85 
86  //- Construct from a mesh
88 
89 
90  //- Destructor
92  {}
93 
94 
95  // Member Functions
96 
97  //- Return const-access to phase1 viscosityModel
98  const viscosityModel& nuModel1() const
99  {
100  return nuModel1_();
101  }
102 
103  //- Return const-access to phase2 viscosityModel
104  const viscosityModel& nuModel2() const
105  {
106  return nuModel2_();
107  }
108 
109  //- Return const-access to phase1 density
110  const dimensionedScalar& rho1() const
111  {
112  return rho1_;
113  }
114 
115  //- Return const-access to phase2 density
116  const dimensionedScalar& rho2() const
117  {
118  return rho2_;
119  };
120 
121  //- Return the mixture density
122  virtual const volScalarField& rho() const
123  {
124  return rho_;
125  }
126 
127  //- Return the kinematic laminar viscosity
128  virtual tmp<volScalarField> nu() const
129  {
130  return nu_;
131  }
132 
133  //- Return the laminar viscosity for patch
134  virtual tmp<scalarField> nu(const label patchi) const
135  {
136  return nu_.boundaryField()[patchi];
137  }
138 
139  //- Correct the mixture density and laminar viscosity
140  virtual void correct();
141 
142  //- Read base phaseProperties dictionary
143  virtual bool read();
144 };
145 
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 } // End namespace Foam
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 #endif
154 
155 // ************************************************************************* //
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:98
Class to represent a mixture of two constant density phases.
const viscosityModel & nuModel1() const
Return const-access to phase1 viscosityModel.
TypeName("incompressibleTwoPhaseVoFMixture")
virtual void correct()
Correct the mixture density and 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
Typedefs for UniformDimensionedField.