Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / transportModels / incompressible / viscosityModels / viscosityModel / viscosityModel.H
blobffe7cdb643bb166741e14c3f52fea9177a8ab497
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-2010 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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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, see <http://www.gnu.org/licenses/>.
24 Namespace
25     Foam::viscosityModels
27 Description
28     A namespace for various incompressible viscosityModel implementations.
30 Class
31     Foam::viscosityModel
33 Description
34     An abstract base class for incompressible viscosityModels.
36     The strain rate is defined by:
38         mag(symm(grad(U)))
41 SourceFiles
42     viscosityModel.C
43     viscosityModelNew.C
45 \*---------------------------------------------------------------------------*/
47 #ifndef viscosityModel_H
48 #define viscosityModel_H
50 #include "IOdictionary.H"
51 #include "typeInfo.H"
52 #include "runTimeSelectionTables.H"
53 #include "volFieldsFwd.H"
54 #include "surfaceFieldsFwd.H"
55 #include "dimensionedScalar.H"
56 #include "tmp.H"
57 #include "autoPtr.H"
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 namespace Foam
64 /*---------------------------------------------------------------------------*\
65                 Class viscosityModel Declaration
66 \*---------------------------------------------------------------------------*/
68 class viscosityModel
71 protected:
73     // Protected data
75         word name_;
76         dictionary viscosityProperties_;
78         const volVectorField& U_;
79         const surfaceScalarField& phi_;
82     // Private Member Functions
84         //- Disallow copy construct
85         viscosityModel(const viscosityModel&);
87         //- Disallow default bitwise assignment
88         void operator=(const viscosityModel&);
91 public:
93     //- Runtime type information
94     TypeName("viscosityModel");
97     // Declare run-time constructor selection table
99         declareRunTimeSelectionTable
100         (
101             autoPtr,
102             viscosityModel,
103             dictionary,
104             (
105                 const word& name,
106                 const dictionary& viscosityProperties,
107                 const volVectorField& U,
108                 const surfaceScalarField& phi
109             ),
110             (name, viscosityProperties, U, phi)
111         );
114     // Selectors
116         //- Return a reference to the selected viscosity model
117         static autoPtr<viscosityModel> New
118         (
119             const word& name,
120             const dictionary& viscosityProperties,
121             const volVectorField& U,
122             const surfaceScalarField& phi
123         );
126     // Constructors
128         //- Construct from components
129         viscosityModel
130         (
131             const word& name,
132             const dictionary& viscosityProperties,
133             const volVectorField& U,
134             const surfaceScalarField& phi
135         );
138     //- Destructor
139     virtual ~viscosityModel()
140     {}
143     // Member Functions
145         //- Return the phase transport properties dictionary
146         const dictionary& viscosityProperties() const
147         {
148             return viscosityProperties_;
149         }
151         //- Return the strain rate
152         tmp<volScalarField> strainRate() const;
154         //- Return the laminar viscosity
155         virtual tmp<volScalarField> nu() const = 0;
157         //- Correct the laminar viscosity
158         virtual void correct() = 0;
160         //- Read transportProperties dictionary
161         virtual bool read(const dictionary& viscosityProperties) = 0;
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 } // End namespace Foam
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 #endif
173 // ************************************************************************* //