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

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