incompressibleThreePhaseMixture.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) 2011-2015 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::incompressibleThreePhaseMixture
28 
29 Description
30 
31 SourceFiles
32  incompressibleThreePhaseMixture.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef incompressibleThreePhaseMixture_H
37 #define incompressibleThreePhaseMixture_H
38 
40 #include "IOdictionary.H"
42 #include "dimensionedScalar.H"
43 #include "volFields.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class incompressibleThreePhaseMixture Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
56  public IOdictionary,
57  public transportModel
58 {
59  // Private data
60 
61  word phase1Name_;
62  word phase2Name_;
63  word phase3Name_;
64 
65  volScalarField alpha1_;
66  volScalarField alpha2_;
67  volScalarField alpha3_;
68 
69  const volVectorField& U_;
70  const surfaceScalarField& phi_;
71 
72  volScalarField nu_;
73 
74  autoPtr<viscosityModel> nuModel1_;
75  autoPtr<viscosityModel> nuModel2_;
76  autoPtr<viscosityModel> nuModel3_;
77 
78  dimensionedScalar rho1_;
79  dimensionedScalar rho2_;
80  dimensionedScalar rho3_;
81 
82 
83  // Private Member Functions
84 
85  //- Calculate and return the laminar viscosity
86  void calcNu();
87 
88 
89 public:
90 
91  // Constructors
92 
93  //- Construct from components
95  (
96  const volVectorField& U,
97  const surfaceScalarField& phi
98  );
99 
100 
101  //- Destructor
103  {}
104 
105 
106  // Member Functions
107 
108  const word phase1Name() const
109  {
110  return phase1Name_;
111  }
112 
113  const word phase2Name() const
114  {
115  return phase2Name_;
116  }
117 
118  const word phase3Name() const
119  {
120  return phase3Name_;
121  }
122 
123  const volScalarField& alpha1() const
124  {
125  return alpha1_;
126  }
127 
129  {
130  return alpha1_;
131  }
132 
133  const volScalarField& alpha2() const
134  {
135  return alpha2_;
136  }
137 
139  {
140  return alpha2_;
141  }
142 
143  const volScalarField& alpha3() const
144  {
145  return alpha3_;
146  }
147 
149  {
150  return alpha3_;
151  }
152 
153  //- Return const-access to phase1 density
154  const dimensionedScalar& rho1() const
155  {
156  return rho1_;
157  }
158 
159  //- Return const-access to phase2 density
160  const dimensionedScalar& rho2() const
161  {
162  return rho2_;
163  };
164 
165  //- Return const-access to phase3 density
166  const dimensionedScalar& rho3() const
167  {
168  return rho3_;
169  };
170 
171  //- Return the velocity
172  const volVectorField& U() const
173  {
174  return U_;
175  }
176 
177  //- Return the flux
178  const surfaceScalarField& phi() const
179  {
180  return phi_;
181  }
182 
183  //- Return const-access to phase1 viscosityModel
184  const viscosityModel& nuModel1() const
185  {
186  return *nuModel1_;
187  }
188 
189  //- Return const-access to phase2 viscosityModel
190  const viscosityModel& nuModel2() const
191  {
192  return *nuModel2_;
193  }
194 
195  //- Return const-access to phase3 viscosityModel
196  const viscosityModel& nuModel3() const
197  {
198  return *nuModel3_;
199  }
200 
201  //- Return the dynamic laminar viscosity
202  tmp<volScalarField> mu() const;
203 
204  //- Return the face-interpolated dynamic laminar viscosity
206 
207  //- Return the kinematic laminar viscosity
208  tmp<volScalarField> nu() const
209  {
210  return nu_;
211  }
212 
213  //- Return the laminar viscosity for patch
214  tmp<scalarField> nu(const label patchi) const
215  {
216  return nu_.boundaryField()[patchi];
217  }
218 
219  //- Return the face-interpolated dynamic laminar viscosity
221 
222  //- Correct the laminar viscosity
223  void correct()
224  {
225  calcNu();
226  }
227 
228  //- Read base transportProperties dictionary
229  bool read();
230 };
231 
232 
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 
235 } // End namespace Foam
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 #endif
240 
241 // ************************************************************************* //
Foam::incompressibleThreePhaseMixture::incompressibleThreePhaseMixture
incompressibleThreePhaseMixture(const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
volFields.H
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:54
Foam::incompressibleThreePhaseMixture::alpha3
const volScalarField & alpha3() const
Definition: incompressibleThreePhaseMixture.H:142
Foam::viscosityModel
An abstract base class for incompressible viscosityModels.
Definition: viscosityModel.H:67
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::incompressibleThreePhaseMixture::nu
tmp< scalarField > nu(const label patchi) const
Return the laminar viscosity for patch.
Definition: incompressibleThreePhaseMixture.H:213
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::incompressibleThreePhaseMixture::nuf
tmp< surfaceScalarField > nuf() const
Return the face-interpolated dynamic laminar viscosity.
Foam::incompressibleThreePhaseMixture::U
const volVectorField & U() const
Return the velocity.
Definition: incompressibleThreePhaseMixture.H:171
Foam::incompressibleThreePhaseMixture::rho1
const dimensionedScalar & rho1() const
Return const-access to phase1 density.
Definition: incompressibleThreePhaseMixture.H:153
Foam::incompressibleThreePhaseMixture::correct
void correct()
Correct the laminar viscosity.
Definition: incompressibleThreePhaseMixture.H:222
Foam::incompressibleThreePhaseMixture::phi
const surfaceScalarField & phi() const
Return the flux.
Definition: incompressibleThreePhaseMixture.H:177
Foam::incompressibleThreePhaseMixture::rho3
const dimensionedScalar & rho3() const
Return const-access to phase3 density.
Definition: incompressibleThreePhaseMixture.H:165
Foam::incompressibleThreePhaseMixture::rho2
const dimensionedScalar & rho2() const
Return const-access to phase2 density.
Definition: incompressibleThreePhaseMixture.H:159
Foam::incompressibleThreePhaseMixture::alpha2
volScalarField & alpha2()
Definition: incompressibleThreePhaseMixture.H:137
Foam::incompressibleThreePhaseMixture::~incompressibleThreePhaseMixture
~incompressibleThreePhaseMixture()
Destructor.
Definition: incompressibleThreePhaseMixture.H:101
Foam::incompressibleThreePhaseMixture::phase2Name
const word phase2Name() const
Definition: incompressibleThreePhaseMixture.H:112
transportModel.H
Foam::incompressibleThreePhaseMixture::alpha1
volScalarField & alpha1()
Definition: incompressibleThreePhaseMixture.H:127
Foam::incompressibleThreePhaseMixture::nu
tmp< volScalarField > nu() const
Return the kinematic laminar viscosity.
Definition: incompressibleThreePhaseMixture.H:207
Foam::incompressibleThreePhaseMixture::nuModel1
const viscosityModel & nuModel1() const
Return const-access to phase1 viscosityModel.
Definition: incompressibleThreePhaseMixture.H:183
Foam::dimensioned< scalar >
Foam::incompressibleThreePhaseMixture::alpha3
volScalarField & alpha3()
Definition: incompressibleThreePhaseMixture.H:147
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::incompressibleThreePhaseMixture::mu
tmp< volScalarField > mu() const
Return the dynamic laminar viscosity.
Foam::transportModel
Base-class for all transport models used by the incompressible turbulence models.
Definition: transportModel.H:53
viscosityModel.H
Foam::incompressibleThreePhaseMixture::phase3Name
const word phase3Name() const
Definition: incompressibleThreePhaseMixture.H:117
Foam::incompressibleThreePhaseMixture::phase1Name
const word phase1Name() const
Definition: incompressibleThreePhaseMixture.H:107
dimensionedScalar.H
IOdictionary.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::incompressibleThreePhaseMixture::read
bool read()
Read base transportProperties dictionary.
Foam::incompressibleThreePhaseMixture::nuModel2
const viscosityModel & nuModel2() const
Return const-access to phase2 viscosityModel.
Definition: incompressibleThreePhaseMixture.H:189
Foam::incompressibleThreePhaseMixture::nuModel3
const viscosityModel & nuModel3() const
Return const-access to phase3 viscosityModel.
Definition: incompressibleThreePhaseMixture.H:195
Foam::incompressibleThreePhaseMixture::muf
tmp< surfaceScalarField > muf() const
Return the face-interpolated dynamic laminar viscosity.
Foam::incompressibleThreePhaseMixture
Definition: incompressibleThreePhaseMixture.H:53
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::incompressibleThreePhaseMixture::alpha2
const volScalarField & alpha2() const
Definition: incompressibleThreePhaseMixture.H:132
Foam::GeometricField::boundaryField
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Definition: GeometricFieldI.H:62
Foam::incompressibleThreePhaseMixture::alpha1
const volScalarField & alpha1() const
Definition: incompressibleThreePhaseMixture.H:122