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