OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

twoPhaseMixture.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::twoPhaseMixture
00027 
00028 Description
00029     A two-phase incompressible transportModel
00030 
00031 SourceFiles
00032     twoPhaseMixture.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef twoPhaseMixture_H
00037 #define twoPhaseMixture_H
00038 
00039 #include "incompressible/transportModel/transportModel.H"
00040 #include "incompressible/viscosityModels/viscosityModel/viscosityModel.H"
00041 #include "dimensionedScalar.H"
00042 #include "volFields.H"
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 /*---------------------------------------------------------------------------*\
00050                       Class twoPhaseMixture Declaration
00051 \*---------------------------------------------------------------------------*/
00052 
00053 class twoPhaseMixture
00054 :
00055     public transportModel
00056 {
00057 protected:
00058 
00059     // Protected data
00060 
00061         word phase1Name_;
00062         word phase2Name_;
00063 
00064         autoPtr<viscosityModel> nuModel1_;
00065         autoPtr<viscosityModel> nuModel2_;
00066 
00067         dimensionedScalar rho1_;
00068         dimensionedScalar rho2_;
00069 
00070         const volVectorField& U_;
00071         const surfaceScalarField& phi_;
00072 
00073         const volScalarField& alpha1_;
00074 
00075         volScalarField nu_;
00076 
00077 
00078     // Private Member Functions
00079 
00080         //- Calculate and return the laminar viscosity
00081         void calcNu();
00082 
00083 
00084 public:
00085 
00086     // Constructors
00087 
00088         //- Construct from components
00089         twoPhaseMixture
00090         (
00091             const volVectorField& U,
00092             const surfaceScalarField& phi,
00093             const word& alpha1Name = "alpha1"
00094         );
00095 
00096 
00097     // Destructor
00098 
00099         ~twoPhaseMixture()
00100         {}
00101 
00102 
00103     // Member Functions
00104 
00105         const word phase1Name() const
00106         {
00107             return phase1Name_;
00108         }
00109 
00110         const word phase2Name() const
00111         {
00112             return phase2Name_;
00113         }
00114 
00115         //- Return const-access to phase1 viscosityModel
00116         const viscosityModel& nuModel1() const
00117         {
00118             return nuModel1_();
00119         }
00120 
00121         //- Return const-access to phase2 viscosityModel
00122         const viscosityModel& nuModel2() const
00123         {
00124             return nuModel2_();
00125         }
00126 
00127         //- Return const-access to phase1 density
00128         const dimensionedScalar& rho1() const
00129         {
00130             return rho1_;
00131         }
00132 
00133         //- Return const-access to phase2 density
00134         const dimensionedScalar& rho2() const
00135         {
00136             return rho2_;
00137         };
00138 
00139         //- Return the dynamic laminar viscosity
00140         tmp<volScalarField> mu() const;
00141 
00142         //- Return the face-interpolated dynamic laminar viscosity
00143         tmp<surfaceScalarField> muf() const;
00144 
00145         //- Return the kinematic laminar viscosity
00146         virtual tmp<volScalarField> nu() const
00147         {
00148             return nu_;
00149         }
00150 
00151         //- Return the face-interpolated dynamic laminar viscosity
00152         tmp<surfaceScalarField> nuf() const;
00153 
00154         //- Correct the laminar viscosity
00155         virtual void correct()
00156         {
00157             calcNu();
00158         }
00159 
00160         //- Read base transportProperties dictionary
00161         virtual bool read();
00162 };
00163 
00164 
00165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00166 
00167 } // End namespace Foam
00168 
00169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00170 
00171 #endif
00172 
00173 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd