OpenFOAM logo
Open Source CFD Toolkit

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