incompressibleDriftFluxMixture.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::incompressibleDriftFluxMixture
26 
27 Description
28  Class to represent a mixture of two constant density phases
29 
30 SourceFiles
31  incompressibleDriftFluxMixture.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef incompressibleDriftFluxMixture_H
36 #define incompressibleDriftFluxMixture_H
37 
38 #include "twoPhaseVoFMixture.H"
40 #include "viscosityModel.H"
41 #include "mixtureViscosityModel.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class incompressibleDriftFluxMixture Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 :
54  public twoPhaseVoFMixture,
55  virtual public incompressibleTwoPhases,
56  public viscosity
57 {
58  // Private Data
59 
60  //- Continuous phase viscosity model
61  autoPtr<viscosityModel> nucModel_;
62 
63  //- Mixture viscosity model
65 
66  //- Dispersed phase density
67  dimensionedScalar rhod_;
68 
69  //- Continuous phase density
70  dimensionedScalar rhoc_;
71 
72  //- Optional maximum dispersed phase-fraction (e.g. packing limit)
73  scalar alphaMax_;
74 
75  //- Mixture density
76  volScalarField rho_;
77 
78  //- Mixture kinematic viscosity
79  volScalarField nu_;
80 
81  //- Pointer to the mixture velocity field
82  // Set by the initialise(U) function
83  const volVectorField* Uptr_;
84 
85 
86 public:
87 
88  TypeName("incompressibleDriftFluxMixture");
89 
90 
91  // Constructors
92 
93  //- Construct from a mesh
95 
96 
97  //- Destructor
99  {}
100 
101 
102  // Member Functions
103 
104  //- Return const-access to the dispersed phase-fraction
105  const volScalarField& alphad() const
106  {
107  return alpha1();
108  }
109 
110  //- Return const-access to the continuous phase-fraction
111  const volScalarField& alphac() const
112  {
113  return alpha2();
114  }
115 
116  //- Return const-access to the dispersed-phase density
117  const dimensionedScalar& rhod() const
118  {
119  return rhod_;
120  }
121 
122  //- Return const-access to continuous-phase density
123  const dimensionedScalar& rhoc() const
124  {
125  return rhoc_;
126  }
127 
128  //- Return const-access to the dispersed-phase density
129  const dimensionedScalar& rho1() const
130  {
131  return rhod_;
132  }
133 
134  //- Return const-access to continuous-phase density
135  const dimensionedScalar& rho2() const
136  {
137  return rhoc_;
138  }
139 
140  //- Optional maximum phase-fraction (e.g. packing limit)
141  // Defaults to 1
142  scalar alphaMax() const
143  {
144  return alphaMax_;
145  }
146 
147  //- Return the mixture density
148  virtual const volScalarField& rho() const
149  {
150  return rho_;
151  }
152 
153  //- Return the mixture viscosity
154  virtual tmp<volScalarField> nu() const
155  {
156  return nu_;
157  }
158 
159  //- Return the mixture viscosity for patch
160  virtual tmp<scalarField> nu(const label patchi) const
161  {
162  return nu_.boundaryField()[patchi];
163  }
164 
165  //- Return the mixture velocity field
166  const volVectorField& U() const
167  {
168  return *Uptr_;
169  }
170 
171  //- Correct the laminar viscosity
173 
174  //- Correct the density and mixture viscosity
175  virtual void correct();
176 
177  //- Read base phaseProperties dictionary
178  virtual bool read();
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #endif
189 
190 // ************************************************************************* //
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.
TypeName("incompressibleDriftFluxMixture")
incompressibleDriftFluxMixture(const fvMesh &mesh)
Construct from a mesh.
virtual void correct()
Correct the density and mixture viscosity.
const dimensionedScalar & rhoc() const
Return const-access to continuous-phase density.
scalar alphaMax() const
Optional maximum phase-fraction (e.g. packing limit)
const volVectorField & U() const
Return the mixture velocity field.
const dimensionedScalar & rhod() const
Return const-access to the dispersed-phase density.
virtual tmp< volScalarField > nu() const
Return the mixture viscosity.
const dimensionedScalar & rho1() const
Return const-access to the dispersed-phase density.
const volScalarField & alphad() const
Return const-access to the dispersed phase-fraction.
virtual const volScalarField & rho() const
Return the mixture density.
const dimensionedScalar & rho2() const
Return const-access to continuous-phase density.
const volScalarField & alphac() const
Return const-access to the continuous phase-fraction.
incompressibleDriftFluxMixture & initialise(const volVectorField &U)
Correct the laminar viscosity.
virtual bool read()
Read base phaseProperties dictionary.
Interface to two constant density phases.
A class for managing temporary objects.
Definition: tmp.H:55
const volScalarField & alpha1() const
Return the phase-fraction of phase 1.
const volScalarField & alpha2() const
Return the phase-fraction of phase 2.
Class to represent a VoF mixture.
const fvMesh & mesh() const
Access the mesh.
Definition: twoPhases.H:71
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