OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen 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-2007 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     twoPhaseMixture
00027 
00028 Description
00029 
00030 SourceFiles
00031     twoPhaseMixture.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef twoPhaseMixture_H
00036 #define twoPhaseMixture_H
00037 
00038 #include "incompressible/transportModel/transportModel.H"
00039 #include "incompressible/viscosityModels/viscosityModel/viscosityModel.H"
00040 #include "dimensionedScalar.H"
00041 #include "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     // Private data
00057 
00058         word phase1Name_;
00059         word phase2Name_;
00060 
00061         autoPtr<viscosityModel> nuModel1_;
00062         autoPtr<viscosityModel> nuModel2_;
00063 
00064         dimensionedScalar rho1_;
00065         dimensionedScalar rho2_;
00066 
00067         const volVectorField& U_;
00068         const surfaceScalarField& phi_;
00069 
00070         const volScalarField& alpha1_;
00071 
00072         volScalarField nu_;
00073 
00074 
00075     // Private Member Functions
00076 
00077         //- Calculate and return the laminar viscosity
00078         void calcNu();
00079 
00080 
00081 public:
00082 
00083     // Constructors
00084 
00085         //- Construct from components
00086         twoPhaseMixture
00087         (
00088             const volVectorField& U,
00089             const surfaceScalarField& phi,
00090             const word& alpha1Name = "alpha1"
00091         );
00092 
00093 
00094     // Destructor
00095 
00096         ~twoPhaseMixture()
00097         {}
00098 
00099 
00100     // Member Functions
00101 
00102         const word phase1Name() const
00103         {
00104             return phase1Name_;
00105         }
00106 
00107         const word phase2Name() const
00108         {
00109             return phase2Name_;
00110         }
00111 
00112         //- Return const-access to phase1 viscosityModel
00113         const viscosityModel& nuModel1() const
00114         {
00115             return nuModel1_();
00116         }
00117 
00118         //- Return const-access to phase2 viscosityModel
00119         const viscosityModel& nuModel2() const
00120         {
00121             return nuModel2_();
00122         }
00123 
00124         //- Return const-access to phase1 density
00125         const dimensionedScalar& rho1() const
00126         {
00127             return rho1_;
00128         }
00129 
00130         //- Return const-access to phase2 density
00131         const dimensionedScalar& rho2() const
00132         {
00133             return rho2_;
00134         };
00135 
00136         //- Return the dynamic laminar viscosity
00137         tmp<volScalarField> mu() const;
00138 
00139         //- Return the face-interpolated dynamic laminar viscosity
00140         tmp<surfaceScalarField> muf() const;
00141 
00142         //- Return the kinematic laminar viscosity
00143         tmp<volScalarField> nu() const
00144         {
00145             return nu_;
00146         }
00147 
00148         //- Return the face-interpolated dynamic laminar viscosity
00149         tmp<surfaceScalarField> nuf() const;
00150 
00151         //- Correct the laminar viscosity 
00152         void correct()
00153         {
00154             calcNu();
00155         }
00156 
00157         //- Read base transportProperties dictionary
00158         bool read();
00159 };
00160 
00161 
00162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00163 
00164 } // End namespace Foam
00165 
00166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00167 
00168 #endif
00169 
00170 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd