incompressibleTwoPhaseInteractingMixture.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) 2014-2015 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::incompressibleTwoPhaseInteractingMixture
29
30Description
31 A two-phase incompressible transportModel for interacting phases
32 requiring the direct evaluation of the mixture viscosity,
33 e.g. activated sludge or slurry.
34
35SourceFiles
36 incompressibleTwoPhaseInteractingMixture.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef incompressibleTwoPhaseInteractingMixture_H
41#define incompressibleTwoPhaseInteractingMixture_H
42
46#include "twoPhaseMixture.H"
47#include "IOdictionary.H"
48
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52namespace Foam
53{
54
55/*---------------------------------------------------------------------------*\
56 Class incompressibleTwoPhaseInteractingMixture Declaration
57\*---------------------------------------------------------------------------*/
60:
61 public IOdictionary,
63 public twoPhaseMixture
64{
65protected:
66
67 // Protected data
74
75 //- Optional diameter of the dispersed phase particles
77
78 //- Optional maximum dispersed phase-fraction (e.g. packing limit)
79 scalar alphaMax_;
85
86
87public:
89 TypeName("incompressibleTwoPhaseInteractingMixture");
90
91
92 // Constructors
93
94 //- Construct from components
96 (
97 const volVectorField& U,
99 );
100
101
102 //- Destructor
104
105
106 // Member Functions
107
108 //- Return const-access to the mixture viscosityModel
109 const mixtureViscosityModel& muModel() const
110 {
111 return *muModel_;
112 }
113
114 //- Return const-access to the continuous-phase viscosityModel
115 const viscosityModel& nucModel() const
116 {
117 return *nucModel_;
118 }
119
120 //- Return const-access to the dispersed-phase density
121 const dimensionedScalar& rhod() const
122 {
123 return rhod_;
124 }
125
126 //- Return const-access to continuous-phase density
127 const dimensionedScalar& rhoc() const
128 {
129 return rhoc_;
130 };
131
132 //- Return the diameter of the dispersed-phase particles
133 const dimensionedScalar& dd() const
134 {
135 return dd_;
136 }
137
138 //- Optional maximum phase-fraction (e.g. packing limit)
139 // Defaults to 1
140 scalar alphaMax() const
141 {
142 return alphaMax_;
143 }
144
145 //- Return const-access to the mixture velocity
146 const volVectorField& U() const
147 {
148 return U_;
149 }
150
151 //- Return the dynamic mixture viscosity
152 tmp<volScalarField> mu() const
153 {
154 return mu_;
155 }
156
157 //- Return the dynamic mixture viscosity for patch
158 virtual tmp<scalarField> mu(const label patchi) const
159 {
160 return mu_.boundaryField()[patchi];
161 }
162
163 //- Return the mixture density
164 virtual tmp<volScalarField> rho() const
165 {
166 return alpha1_*rhod_ + alpha2_*rhoc_;
167 }
168
169 //- Return the mixture density for patch
170 virtual tmp<scalarField> rho(const label patchi) const
171 {
172 return
173 alpha1_.boundaryField()[patchi]*rhod_.value()
174 + alpha2_.boundaryField()[patchi]*rhoc_.value();
175 }
176
177 //- Return the mixture viscosity
178 virtual tmp<volScalarField> nu() const
179 {
180 return mu_/rho();
181 }
182
183 //- Return the mixture viscosity for patch
184 virtual tmp<scalarField> nu(const label patchi) const
185 {
186 return mu_.boundaryField()[patchi]/rho(patchi);
187 }
188
189 //- Correct the laminar viscosity
190 virtual void correct()
191 {
192 mu_ = muModel_->mu(rhoc_*nucModel_->nu());
193 }
194
195 //- Read base transportProperties dictionary
196 virtual bool read();
197};
198
199
200// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201
202} // End namespace Foam
203
204// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205
206#endif
207
208// ************************************************************************* //
surfaceScalarField & phi
const Boundary & boundaryField() const
Return const-reference to the boundary field.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Base-class for all transport models used by the compressible turbulence models.
const Type & value() const
Return const reference to value.
A two-phase incompressible transportModel for interacting phases requiring the direct evaluation of t...
const volVectorField & U() const
Return const-access to the mixture velocity.
incompressibleTwoPhaseInteractingMixture(const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
virtual tmp< scalarField > mu(const label patchi) const
Return the dynamic mixture viscosity for patch.
virtual tmp< volScalarField > rho() const
Return the mixture density.
const viscosityModel & nucModel() const
Return const-access to the continuous-phase viscosityModel.
dimensionedScalar dd_
Optional diameter of the dispersed phase particles.
virtual tmp< scalarField > rho(const label patchi) const
Return the mixture density for patch.
const dimensionedScalar & rhod() const
Return const-access to the dispersed-phase density.
scalar alphaMax() const
Optional maximum phase-fraction (e.g. packing limit)
scalar alphaMax_
Optional maximum dispersed phase-fraction (e.g. packing limit)
tmp< volScalarField > mu() const
Return the dynamic mixture viscosity.
const dimensionedScalar & rhoc() const
Return const-access to continuous-phase density.
virtual bool read()
Read base transportProperties dictionary.
TypeName("incompressibleTwoPhaseInteractingMixture")
virtual tmp< volScalarField > nu() const
Return the mixture viscosity.
virtual ~incompressibleTwoPhaseInteractingMixture()=default
Destructor.
virtual tmp< scalarField > nu(const label patchi) const
Return the mixture viscosity for patch.
const dimensionedScalar & dd() const
Return the diameter of the dispersed-phase particles.
const mixtureViscosityModel & muModel() const
Return const-access to the mixture viscosityModel.
An abstract base class for incompressible mixtureViscosityModels.
A class for managing temporary objects.
Definition: tmp.H:65
A two-phase mixture model.
volScalarField alpha2_
volScalarField alpha1_
An abstract base class for incompressible viscosityModels.
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73