1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
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
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/>.
28 A namespace for various incompressible viscosityModel implementations.
34 An abstract base class for incompressible viscosityModels.
36 The strain rate is defined by:
45 \*---------------------------------------------------------------------------*/
47 #ifndef viscosityModel_H
48 #define viscosityModel_H
50 #include "IOdictionary.H"
52 #include "runTimeSelectionTables.H"
53 #include "volFieldsFwd.H"
54 #include "surfaceFieldsFwd.H"
55 #include "dimensionedScalar.H"
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 /*---------------------------------------------------------------------------*\
65 Class viscosityModel Declaration
66 \*---------------------------------------------------------------------------*/
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&);
93 //- Runtime type information
94 TypeName("viscosityModel");
97 // Declare run-time constructor selection table
99 declareRunTimeSelectionTable
106 const dictionary& viscosityProperties,
107 const volVectorField& U,
108 const surfaceScalarField& phi
110 (name, viscosityProperties, U, phi)
116 //- Return a reference to the selected viscosity model
117 static autoPtr<viscosityModel> New
120 const dictionary& viscosityProperties,
121 const volVectorField& U,
122 const surfaceScalarField& phi
128 //- Construct from components
132 const dictionary& viscosityProperties,
133 const volVectorField& U,
134 const surfaceScalarField& phi
139 virtual ~viscosityModel()
145 //- Return the phase transport properties dictionary
146 const dictionary& viscosityProperties() const
148 return viscosityProperties_;
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 // ************************************************************************* //