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

viscosityModel.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 Namespace
00025     Foam::viscosityModels
00026 
00027 Description
00028     A namespace for various incompressible viscosityModel implementations.
00029 
00030 Class
00031     Foam::viscosityModel
00032 
00033 Description
00034     An abstract base class for incompressible viscosityModels
00035 
00036 SourceFiles
00037     viscosityModel.C
00038     newViscosityModel.C
00039 
00040 \*---------------------------------------------------------------------------*/
00041 
00042 #ifndef viscosityModel_H
00043 #define viscosityModel_H
00044 
00045 #include <OpenFOAM/IOdictionary.H>
00046 #include <OpenFOAM/typeInfo.H>
00047 #include <OpenFOAM/runTimeSelectionTables.H>
00048 #include <finiteVolume/volFieldsFwd.H>
00049 #include <finiteVolume/surfaceFieldsFwd.H>
00050 #include <OpenFOAM/dimensionedScalar.H>
00051 #include <OpenFOAM/tmp.H>
00052 #include <OpenFOAM/autoPtr.H>
00053 
00054 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00055 
00056 namespace Foam
00057 {
00058 
00059 /*---------------------------------------------------------------------------*\
00060                 Class viscosityModel Declaration
00061 \*---------------------------------------------------------------------------*/
00062 
00063 class viscosityModel
00064 {
00065 
00066 protected:
00067 
00068     // Protected data
00069 
00070         word name_;
00071         dictionary viscosityProperties_;
00072 
00073         const volVectorField& U_;
00074         const surfaceScalarField& phi_;
00075 
00076 
00077     // Private Member Functions
00078 
00079         //- Disallow copy construct
00080         viscosityModel(const viscosityModel&);
00081 
00082         //- Disallow default bitwise assignment
00083         void operator=(const viscosityModel&);
00084 
00085 
00086 public:
00087 
00088     //- Runtime type information
00089     TypeName("viscosityModel");
00090 
00091 
00092     // Declare run-time constructor selection table
00093 
00094         declareRunTimeSelectionTable
00095         (
00096             autoPtr,
00097             viscosityModel,
00098             dictionary,
00099             (
00100                 const word& name,
00101                 const dictionary& viscosityProperties,
00102                 const volVectorField& U,
00103                 const surfaceScalarField& phi
00104             ),
00105             (name, viscosityProperties, U, phi)
00106         );
00107 
00108 
00109     // Selectors
00110 
00111         //- Return a reference to the selected viscosity model
00112         static autoPtr<viscosityModel> New
00113         (
00114             const word& name,
00115             const dictionary& viscosityProperties,
00116             const volVectorField& U,
00117             const surfaceScalarField& phi
00118         );
00119 
00120 
00121     // Constructors
00122 
00123         //- Construct from components
00124         viscosityModel
00125         (
00126             const word& name,
00127             const dictionary& viscosityProperties,
00128             const volVectorField& U,
00129             const surfaceScalarField& phi
00130         );
00131 
00132 
00133     // Destructor
00134 
00135         virtual ~viscosityModel()
00136         {}
00137 
00138 
00139     // Member Functions
00140 
00141         //- Return the phase transport properties dictionary
00142         const dictionary& viscosityProperties() const
00143         {
00144             return viscosityProperties_;
00145         }
00146 
00147         //- Return the strain rate mag(grad(U))
00148         tmp<volScalarField> strainRate() const;
00149 
00150         //- Return the laminar viscosity
00151         virtual tmp<volScalarField> nu() const = 0;
00152 
00153         //- Correct the laminar viscosity
00154         virtual void correct() = 0;
00155 
00156         //- Read transportProperties dictionary
00157         virtual bool read(const dictionary& viscosityProperties) = 0;
00158 };
00159 
00160 
00161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00162 
00163 } // End namespace Foam
00164 
00165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00166 
00167 #endif
00168 
00169 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines