FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::twoPhaseMixture
00026 
00027 Description
00028     A two-phase incompressible transportModel
00029 
00030 SourceFiles
00031     twoPhaseMixture.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef twoPhaseMixture_H
00036 #define twoPhaseMixture_H
00037 
00038 #include <incompressibleTransportModels/transportModel.H>
00039 #include <incompressibleTransportModels/viscosityModel.H>
00040 #include <OpenFOAM/dimensionedScalar.H>
00041 #include <finiteVolume/volFields.H>
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 /*---------------------------------------------------------------------------*\
00049                       Class twoPhaseMixture Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 class twoPhaseMixture
00053 :
00054     public transportModel
00055 {
00056 protected:
00057 
00058     // Protected data
00059 
00060         word phase1Name_;
00061         word phase2Name_;
00062 
00063         autoPtr<viscosityModel> nuModel1_;
00064         autoPtr<viscosityModel> nuModel2_;
00065 
00066         dimensionedScalar rho1_;
00067         dimensionedScalar rho2_;
00068 
00069         const volVectorField& U_;
00070         const surfaceScalarField& phi_;
00071 
00072         const volScalarField& alpha1_;
00073 
00074         volScalarField nu_;
00075 
00076 
00077     // Private Member Functions
00078 
00079         //- Calculate and return the laminar viscosity
00080         void calcNu();
00081 
00082 
00083 public:
00084 
00085     // Constructors
00086 
00087         //- Construct from components
00088         twoPhaseMixture
00089         (
00090             const volVectorField& U,
00091             const surfaceScalarField& phi,
00092             const word& alpha1Name = "alpha1"
00093         );
00094 
00095 
00096     // Destructor
00097 
00098         ~twoPhaseMixture()
00099         {}
00100 
00101 
00102     // Member Functions
00103 
00104         const word phase1Name() const
00105         {
00106             return phase1Name_;
00107         }
00108 
00109         const word phase2Name() const
00110         {
00111             return phase2Name_;
00112         }
00113 
00114         //- Return const-access to phase1 viscosityModel
00115         const viscosityModel& nuModel1() const
00116         {
00117             return nuModel1_();
00118         }
00119 
00120         //- Return const-access to phase2 viscosityModel
00121         const viscosityModel& nuModel2() const
00122         {
00123             return nuModel2_();
00124         }
00125 
00126         //- Return const-access to phase1 density
00127         const dimensionedScalar& rho1() const
00128         {
00129             return rho1_;
00130         }
00131 
00132         //- Return const-access to phase2 density
00133         const dimensionedScalar& rho2() const
00134         {
00135             return rho2_;
00136         };
00137 
00138         //- Return the dynamic laminar viscosity
00139         tmp<volScalarField> mu() const;
00140 
00141         //- Return the face-interpolated dynamic laminar viscosity
00142         tmp<surfaceScalarField> muf() const;
00143 
00144         //- Return the kinematic laminar viscosity
00145         virtual tmp<volScalarField> nu() const
00146         {
00147             return nu_;
00148         }
00149 
00150         //- Return the face-interpolated kinematic laminar viscosity
00151         tmp<surfaceScalarField> nuf() const;
00152 
00153         //- Correct the laminar viscosity
00154         virtual void correct()
00155         {
00156             calcNu();
00157         }
00158 
00159         //- Read base transportProperties dictionary
00160         virtual bool read();
00161 };
00162 
00163 
00164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00165 
00166 } // End namespace Foam
00167 
00168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00169 
00170 #endif
00171 
00172 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines