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

phase.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::phase
00027 
00028 Description
00029     Single incompressible phase derived from the phase-fraction.
00030     Used as part of the multiPhaseMixture for interface-capturing multi-phase
00031     simulations.
00032 
00033 SourceFiles
00034     phase.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef phase_H
00039 #define phase_H
00040 
00041 #include "volFields.H"
00042 #include "dictionaryEntry.H"
00043 #include "incompressible/viscosityModels/viscosityModel/viscosityModel.H"
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 /*---------------------------------------------------------------------------*\
00051                            Class phase Declaration
00052 \*---------------------------------------------------------------------------*/
00053 
00054 class phase
00055 :
00056     public volScalarField
00057 {
00058     // Private data
00059 
00060         word name_;
00061         dictionary phaseDict_;
00062         autoPtr<viscosityModel> nuModel_;
00063         dimensionedScalar rho_;
00064 
00065 
00066 public:
00067 
00068     // Constructors
00069 
00070         //- Construct from components
00071         phase
00072         (
00073             const word& name,
00074             const dictionary& phaseDict,
00075             const volVectorField& U,
00076             const surfaceScalarField& phi
00077         );
00078 
00079         //- Return clone
00080         autoPtr<phase> clone() const;
00081 
00082         //- Return a pointer to a new phase created on freestore
00083         //  from Istream
00084         class iNew
00085         {
00086             const volVectorField& U_;
00087             const surfaceScalarField& phi_;
00088 
00089         public:
00090 
00091             iNew
00092             (
00093                 const volVectorField& U,
00094                 const surfaceScalarField& phi
00095             )
00096             :
00097                 U_(U),
00098                 phi_(phi)
00099             {}
00100 
00101             autoPtr<phase> operator()(Istream& is) const
00102             {
00103                 dictionaryEntry ent(dictionary::null, is);
00104                 return autoPtr<phase>(new phase(ent.keyword(), ent, U_, phi_));
00105             }
00106         };
00107 
00108 
00109     // Member Functions
00110 
00111         const word& name() const
00112         {
00113             return name_;
00114         }
00115 
00116         const word& keyword() const
00117         {
00118             return name();
00119         }
00120 
00121         //- Return const-access to phase1 viscosityModel
00122         const viscosityModel& nuModel() const
00123         {
00124             return nuModel_();
00125         }
00126 
00127         //- Return the kinematic laminar viscosity
00128         tmp<volScalarField> nu() const
00129         {
00130             return nuModel_->nu();
00131         }
00132 
00133         //- Return const-access to phase1 density
00134         const dimensionedScalar& rho() const
00135         {
00136             return rho_;
00137         }
00138 
00139         //- Correct the phase properties
00140         void correct();
00141 
00142         //- Read base transportProperties dictionary
00143         bool read(const dictionary& phaseDict);
00144 };
00145 
00146 
00147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00148 
00149 } // End namespace Foam
00150 
00151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00152 
00153 #endif
00154 
00155 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd