initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / transportModels / incompressible / viscosityModels / viscosityModel / viscosityModel.H
blob7e6a00d5d7136e55f4cbde5ba764525a81917b3a
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Namespace
26     Foam::viscosityModels
28 Description
29     A namespace for various incompressible viscosityModel implementations.
31 Class
32     Foam::viscosityModel
34 Description
35     An abstract base class for incompressible viscosityModels
37 SourceFiles
38     viscosityModel.C
39     newViscosityModel.C
41 \*---------------------------------------------------------------------------*/
43 #ifndef viscosityModel_H
44 #define viscosityModel_H
46 #include "IOdictionary.H"
47 #include "typeInfo.H"
48 #include "runTimeSelectionTables.H"
49 #include "volFieldsFwd.H"
50 #include "surfaceFieldsFwd.H"
51 #include "dimensionedScalar.H"
52 #include "tmp.H"
53 #include "autoPtr.H"
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 namespace Foam
60 /*---------------------------------------------------------------------------*\
61                 Class viscosityModel Declaration
62 \*---------------------------------------------------------------------------*/
64 class viscosityModel
67 protected:
69     // Protected data
71         word name_;
72         dictionary viscosityProperties_;
74         const volVectorField& U_;
75         const surfaceScalarField& phi_;
78     // Private Member Functions
80         //- Disallow copy construct
81         viscosityModel(const viscosityModel&);
83         //- Disallow default bitwise assignment
84         void operator=(const viscosityModel&);
87 public:
89     //- Runtime type information
90     TypeName("viscosityModel");
93     // Declare run-time constructor selection table
95         declareRunTimeSelectionTable
96         (
97             autoPtr,
98             viscosityModel,
99             dictionary,
100             (
101                 const word& name,
102                 const dictionary& viscosityProperties,
103                 const volVectorField& U,
104                 const surfaceScalarField& phi
105             ),
106             (name, viscosityProperties, U, phi)
107         );
110     // Selectors
112         //- Return a reference to the selected viscosity model
113         static autoPtr<viscosityModel> New
114         (
115             const word& name,
116             const dictionary& viscosityProperties,
117             const volVectorField& U,
118             const surfaceScalarField& phi
119         );
122     // Constructors
124         //- Construct from components
125         viscosityModel
126         (
127             const word& name,
128             const dictionary& viscosityProperties,
129             const volVectorField& U,
130             const surfaceScalarField& phi
131         );
134     // Destructor
136         virtual ~viscosityModel()
137         {}
140     // Member Functions
142         //- Return the phase transport properties dictionary
143         const dictionary& viscosityProperties() const
144         {
145             return viscosityProperties_;
146         }
148         //- Return the strain rate mag(grad(U))
149         tmp<volScalarField> strainRate() const;
151         //- Return the laminar viscosity
152         virtual tmp<volScalarField> nu() const = 0;
154         //- Correct the laminar viscosity
155         virtual void correct() = 0;
157         //- Read transportProperties dictionary
158         virtual bool read(const dictionary& viscosityProperties) = 0;
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 } // End namespace Foam
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 #endif
170 // ************************************************************************* //