1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::multiphaseMixture
29 Incompressible multi-phase mixture with built in solution for the
30 phase fractions with interface compression for interface-capturing.
32 Derived from transportModel so that it can be unsed in conjunction with
33 the incompressible turbulence models.
35 Surface tension and contact-angle is handled for the interface
36 between each phase-pair.
41 \*---------------------------------------------------------------------------*/
43 #ifndef multiphaseMixture_H
44 #define multiphaseMixture_H
46 #include "incompressible/transportModel/transportModel.H"
48 #include "PtrDictionary.H"
49 #include "volFields.H"
50 #include "surfaceFields.H"
51 #include "multivariateSurfaceInterpolationScheme.H"
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 /*---------------------------------------------------------------------------*\
60 Class multiphaseMixture Declaration
61 \*---------------------------------------------------------------------------*/
63 class multiphaseMixture
77 public Hash<interfacePair>
84 label operator()(const interfacePair& key) const
86 return word::hash()(key.first()) + word::hash()(key.second());
91 const interfacePair& key,
95 return mag(operator()(key)) % tableSize;
105 interfacePair(const word& alpha1Name, const word& alpha2Name)
107 Pair<word>(alpha1Name, alpha2Name)
110 interfacePair(const phase& alpha1, const phase& alpha2)
112 Pair<word>(alpha1.name(), alpha2.name())
118 friend bool operator==
120 const interfacePair& a,
121 const interfacePair& b
126 ((a.first() == b.first()) && (a.second() == b.second()))
127 || ((a.first() == b.second()) && (a.second() == b.first()))
131 friend bool operator!=
133 const interfacePair& a,
134 const interfacePair& b
146 //- Dictionary of phases
147 PtrDictionary<phase> phases_;
149 //- The phase chosen as reference, the one which is derived from
150 // the others such thatr they sum to 1
154 const volVectorField& U_;
155 const surfaceScalarField& phi_;
158 surfaceScalarField rhoPhi_;
160 volScalarField alphas_;
162 typedef HashTable<scalar, interfacePair, interfacePair::hash>
166 dimensionSet dimSigma_;
168 //- Stabilisation for normalisation of the interface normal
169 const dimensionedScalar deltaN_;
171 //- Conversion factor for degrees into radians
172 static const scalar convertToRad;
174 //- Phase-fraction field table for multivariate discretisation
175 multivariateSurfaceInterpolationScheme<scalar>::fieldTable alphaTable_;
178 // Private member functions
184 const label nAlphaCorr,
185 const bool cycleAlpha,
189 tmp<surfaceVectorField> nHatfv
191 const volScalarField& alpha1,
192 const volScalarField& alpha2
195 tmp<surfaceScalarField> nHatf
197 const volScalarField& alpha1,
198 const volScalarField& alpha2
201 void correctContactAngle
205 surfaceVectorField::GeometricBoundaryField& nHatb
208 tmp<volScalarField> K(const phase& alpha1, const phase& alpha2) const;
215 //- Construct from components
218 const volVectorField& U,
219 const surfaceScalarField& phi
231 //- Return the phases
232 const PtrDictionary<phase>& phases() const
237 //- Return the velocity
238 const volVectorField& U() const
243 //- Return the volumetric flux
244 const surfaceScalarField& phi() const
249 const surfaceScalarField& rhoPhi() const
254 //- Return the mixture density
255 tmp<volScalarField> rho() const;
257 //- Return the dynamic laminar viscosity
258 tmp<volScalarField> mu() const;
260 //- Return the face-interpolated dynamic laminar viscosity
261 tmp<surfaceScalarField> muf() const;
263 //- Return the kinematic laminar viscosity
264 const volScalarField& nu() const;
266 //- Return the face-interpolated dynamic laminar viscosity
267 tmp<surfaceScalarField> nuf() const;
269 tmp<surfaceScalarField> surfaceTensionForce() const;
271 //- Correct the mixture properties
274 //- Read base transportProperties dictionary
279 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
281 } // End namespace Foam
283 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
287 // ************************************************************************* //