Merge branch 'master' of ssh://opencfd@repo.or.cz/srv/git/OpenFOAM-1.5.x
[OpenFOAM-1.5.x.git] / src / transportModels / incompressible / incompressibleTwoPhaseMixture / twoPhaseMixture.H
blob9c44be51ba4841385edaedd4ed7459b20657cd76
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::twoPhaseMixture
28 Description
29     A two-phase incompressible transportModel
31 SourceFiles
32     twoPhaseMixture.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef twoPhaseMixture_H
37 #define twoPhaseMixture_H
39 #include "incompressible/transportModel/transportModel.H"
40 #include "incompressible/viscosityModels/viscosityModel/viscosityModel.H"
41 #include "dimensionedScalar.H"
42 #include "volFields.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                       Class twoPhaseMixture Declaration
51 \*---------------------------------------------------------------------------*/
53 class twoPhaseMixture
55     public transportModel
57 protected:
59     // Protected data
61         word phase1Name_;
62         word phase2Name_;
64         autoPtr<viscosityModel> nuModel1_;
65         autoPtr<viscosityModel> nuModel2_;
67         dimensionedScalar rho1_;
68         dimensionedScalar rho2_;
70         const volVectorField& U_;
71         const surfaceScalarField& phi_;
73         const volScalarField& alpha1_;
75         volScalarField nu_;
78     // Private Member Functions
80         //- Calculate and return the laminar viscosity
81         void calcNu();
84 public:
86     // Constructors
88         //- Construct from components
89         twoPhaseMixture
90         (
91             const volVectorField& U,
92             const surfaceScalarField& phi,
93             const word& alpha1Name = "alpha1"
94         );
97     // Destructor
99         ~twoPhaseMixture()
100         {}
103     // Member Functions
105         const word phase1Name() const
106         {
107             return phase1Name_;
108         }
110         const word phase2Name() const
111         {
112             return phase2Name_;
113         }
115         //- Return const-access to phase1 viscosityModel
116         const viscosityModel& nuModel1() const
117         {
118             return nuModel1_();
119         }
121         //- Return const-access to phase2 viscosityModel
122         const viscosityModel& nuModel2() const
123         {
124             return nuModel2_();
125         }
127         //- Return const-access to phase1 density
128         const dimensionedScalar& rho1() const
129         {
130             return rho1_;
131         }
133         //- Return const-access to phase2 density
134         const dimensionedScalar& rho2() const
135         {
136             return rho2_;
137         };
139         //- Return the dynamic laminar viscosity
140         tmp<volScalarField> mu() const;
142         //- Return the face-interpolated dynamic laminar viscosity
143         tmp<surfaceScalarField> muf() const;
145         //- Return the kinematic laminar viscosity
146         virtual tmp<volScalarField> nu() const
147         {
148             return nu_;
149         }
151         //- Return the face-interpolated dynamic laminar viscosity
152         tmp<surfaceScalarField> nuf() const;
154         //- Correct the laminar viscosity
155         virtual void correct()
156         {
157             calcNu();
158         }
160         //- Read base transportProperties dictionary
161         virtual bool read();
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 } // End namespace Foam
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 #endif
173 // ************************************************************************* //