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