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-2020 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 "IOdictionary.H"
44 
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class incompressibleTwoPhaseInteractingMixture Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 :
57  public IOdictionary,
58  public twoPhaseMixture
59 {
60 protected:
61 
62  // Protected data
63 
66 
69 
70  //- Optional diameter of the dispersed phase particles
72 
73  //- Optional maximum dispersed phase-fraction (e.g. packing limit)
74  scalar alphaMax_;
75 
77  const surfaceScalarField& phi_;
78 
80 
81 
82 public:
83 
84  TypeName("incompressibleTwoPhaseInteractingMixture");
85 
86 
87  // Constructors
88 
89  //- Construct from components
91  (
92  const volVectorField& U,
93  const surfaceScalarField& phi
94  );
95 
96 
97  //- Destructor
99  {}
100 
101 
102  // Member Functions
103 
104  //- Return const-access to the mixture viscosityModel
105  const mixtureViscosityModel& muModel() const
106  {
107  return muModel_();
108  }
109 
110  //- Return const-access to the continuous-phase viscosityModel
111  const viscosityModel& nucModel() const
112  {
113  return nucModel_();
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 the diameter of the dispersed-phase particles
129  const dimensionedScalar& dd() const
130  {
131  return dd_;
132  }
133 
134  //- Optional maximum phase-fraction (e.g. packing limit)
135  // Defaults to 1
136  scalar alphaMax() const
137  {
138  return alphaMax_;
139  }
140 
141  //- Return const-access to the mixture velocity
142  const volVectorField& U() const
143  {
144  return U_;
145  }
146 
147  //- Return the dynamic mixture viscosity
148  tmp<volScalarField> mu() const
149  {
150  return mu_;
151  }
152 
153  //- Return the dynamic mixture viscosity for patch
154  virtual tmp<scalarField> mu(const label patchi) const
155  {
156  return mu_.boundaryField()[patchi];
157  }
158 
159  //- Return the mixture density
160  virtual tmp<volScalarField> rho() const
161  {
162  return alpha1_*rhod_ + alpha2_*rhoc_;
163  }
164 
165  //- Return the mixture density for patch
166  virtual tmp<scalarField> rho(const label patchi) const
167  {
168  return
169  alpha1_.boundaryField()[patchi]*rhod_.value()
170  + alpha2_.boundaryField()[patchi]*rhoc_.value();
171  }
172 
173  //- Return the mixture viscosity
174  virtual tmp<volScalarField> nu() const
175  {
176  return mu_/rho();
177  }
178 
179  //- Return the mixture viscosity for patch
180  virtual tmp<scalarField> nu(const label patchi) const
181  {
182  return mu_.boundaryField()[patchi]/rho(patchi);
183  }
184 
185  //- Correct the laminar viscosity
186  virtual void correct()
187  {
188  mu_ = muModel_->mu(rhoc_*nucModel_->nu());
189  }
190 
191  //- Read base transportProperties dictionary
192  virtual bool read();
193 };
194 
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 } // End namespace Foam
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 #endif
203 
204 // ************************************************************************* //
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)
phi
Definition: pEqn.H:104
TypeName("incompressibleTwoPhaseInteractingMixture")
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:52
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)
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.