1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 Foam::multiphaseMixture
28 Incompressible multi-phase mixture with built in solution for the
29 phase fractions with interface compression for interface-capturing.
31 Derived from transportModel so that it can be unsed in conjunction with
32 the incompressible turbulence models.
34 Surface tension and contact-angle is handled for the interface
35 between each phase-pair.
40 \*---------------------------------------------------------------------------*/
42 #ifndef multiphaseMixture_H
43 #define multiphaseMixture_H
45 #include "incompressible/transportModel/transportModel.H"
47 #include "PtrDictionary.H"
48 #include "volFields.H"
49 #include "surfaceFields.H"
50 #include "multivariateSurfaceInterpolationScheme.H"
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 /*---------------------------------------------------------------------------*\
59 Class multiphaseMixture Declaration
60 \*---------------------------------------------------------------------------*/
62 class multiphaseMixture
76 public Hash<interfacePair>
83 label operator()(const interfacePair& key) const
85 return word::hash()(key.first()) + word::hash()(key.second());
90 const interfacePair& key,
94 return mag(operator()(key)) % tableSize;
104 interfacePair(const word& alpha1Name, const word& alpha2Name)
106 Pair<word>(alpha1Name, alpha2Name)
109 interfacePair(const phase& alpha1, const phase& alpha2)
111 Pair<word>(alpha1.name(), alpha2.name())
117 friend bool operator==
119 const interfacePair& a,
120 const interfacePair& b
125 ((a.first() == b.first()) && (a.second() == b.second()))
126 || ((a.first() == b.second()) && (a.second() == b.first()))
130 friend bool operator!=
132 const interfacePair& a,
133 const interfacePair& b
145 //- Dictionary of phases
146 PtrDictionary<phase> phases_;
148 //- The phase chosen as reference, the one which is derived from
149 // the others such thatr they sum to 1
153 const volVectorField& U_;
154 const surfaceScalarField& phi_;
157 surfaceScalarField rhoPhi_;
159 volScalarField alphas_;
161 typedef HashTable<scalar, interfacePair, interfacePair::hash>
165 dimensionSet dimSigma_;
167 //- Stabilisation for normalisation of the interface normal
168 const dimensionedScalar deltaN_;
170 //- Conversion factor for degrees into radians
171 static const scalar convertToRad;
173 //- Phase-fraction field table for multivariate discretisation
174 multivariateSurfaceInterpolationScheme<scalar>::fieldTable alphaTable_;
177 // Private member functions
183 const label nAlphaCorr,
184 const bool cycleAlpha,
188 tmp<surfaceVectorField> nHatfv
190 const volScalarField& alpha1,
191 const volScalarField& alpha2
194 tmp<surfaceScalarField> nHatf
196 const volScalarField& alpha1,
197 const volScalarField& alpha2
200 void correctContactAngle
204 surfaceVectorField::GeometricBoundaryField& nHatb
207 tmp<volScalarField> K(const phase& alpha1, const phase& alpha2) const;
214 //- Construct from components
217 const volVectorField& U,
218 const surfaceScalarField& phi
230 //- Return the phases
231 const PtrDictionary<phase>& phases() const
236 //- Return the velocity
237 const volVectorField& U() const
242 //- Return the volumetric flux
243 const surfaceScalarField& phi() const
248 const surfaceScalarField& rhoPhi() const
253 //- Return the mixture density
254 tmp<volScalarField> rho() const;
256 //- Return the dynamic laminar viscosity
257 tmp<volScalarField> mu() const;
259 //- Return the face-interpolated dynamic laminar viscosity
260 tmp<surfaceScalarField> muf() const;
262 //- Return the kinematic laminar viscosity
263 const volScalarField& nu() const;
265 //- Return the face-interpolated dynamic laminar viscosity
266 tmp<surfaceScalarField> nuf() const;
268 tmp<surfaceScalarField> surfaceTensionForce() const;
270 //- Correct the mixture properties
273 //- Read base transportProperties dictionary
278 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
280 } // End namespace Foam
282 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
286 // ************************************************************************* //