1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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
29 A namespace for various incompressible viscosityModel implementations.
35 An abstract base class for incompressible viscosityModels
41 \*---------------------------------------------------------------------------*/
43 #ifndef viscosityModel_H
44 #define viscosityModel_H
46 #include "IOdictionary.H"
48 #include "runTimeSelectionTables.H"
49 #include "volFieldsFwd.H"
50 #include "surfaceFieldsFwd.H"
51 #include "dimensionedScalar.H"
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 /*---------------------------------------------------------------------------*\
61 Class viscosityModel Declaration
62 \*---------------------------------------------------------------------------*/
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&);
89 //- Runtime type information
90 TypeName("viscosityModel");
93 // Declare run-time constructor selection table
95 declareRunTimeSelectionTable
102 const dictionary& viscosityProperties,
103 const volVectorField& U,
104 const surfaceScalarField& phi
106 (name, viscosityProperties, U, phi)
112 //- Return a reference to the selected viscosity model
113 static autoPtr<viscosityModel> New
116 const dictionary& viscosityProperties,
117 const volVectorField& U,
118 const surfaceScalarField& phi
124 //- Construct from components
128 const dictionary& viscosityProperties,
129 const volVectorField& U,
130 const surfaceScalarField& phi
136 virtual ~viscosityModel()
142 //- Return the phase transport properties dictionary
143 const dictionary& viscosityProperties() const
145 return viscosityProperties_;
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 // ************************************************************************* //