viscosityModel.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011 OpenFOAM Foundation
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Namespace
28 Foam::viscosityModels
29
30Description
31 A namespace for various incompressible viscosityModel implementations.
32
33Class
34 Foam::viscosityModel
35
36Description
37 An abstract base class for incompressible viscosityModels.
38
39 The strain rate is defined by:
40
41 mag(symm(grad(U)))
42
43
44SourceFiles
45 viscosityModel.C
46 viscosityModelNew.C
47
48\*---------------------------------------------------------------------------*/
49
50#ifndef viscosityModel_H
51#define viscosityModel_H
52
53#include "dictionary.H"
54#include "volFieldsFwd.H"
55#include "surfaceFieldsFwd.H"
56#include "dimensionedScalar.H"
58
59// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60
61namespace Foam
62{
63
64/*---------------------------------------------------------------------------*\
65 Class viscosityModel Declaration
66\*---------------------------------------------------------------------------*/
69{
70
71protected:
72
73 // Protected data
80
81
82 // Private Member Functions
83
84 //- No copy construct
85 viscosityModel(const viscosityModel&) = delete;
86
87 //- No copy assignment
88 void operator=(const viscosityModel&) = delete;
89
90
91public:
92
93 //- Runtime type information
94 TypeName("viscosityModel");
95
96
97 // Declare run-time constructor selection table
100 (
101 autoPtr,
104 (
105 const word& name,
107 const volVectorField& U,
109 ),
111 );
112
113
114 // Selectors
115
116 //- Return a reference to the selected viscosity model
118 (
119 const word& name,
121 const volVectorField& U,
123 );
124
125
126 // Constructors
127
128 //- Construct from components
130 (
131 const word& name,
133 const volVectorField& U,
135 );
136
137
138 //- Destructor
139 virtual ~viscosityModel() = default;
140
141
142 // Member Functions
143
144 //- Return the phase transport properties dictionary
145 const dictionary& viscosityProperties() const
146 {
148 }
149
150 //- Return the strain rate
152
153 //- Return the laminar viscosity
154 virtual tmp<volScalarField> nu() const = 0;
155
156 //- Return the laminar viscosity for patch
157 virtual tmp<scalarField> nu(const label patchi) const = 0;
158
159 //- Correct the laminar viscosity
160 virtual void correct() = 0;
161
162 //- Read transportProperties dictionary
163 virtual bool read(const dictionary& viscosityProperties) = 0;
164};
165
166
167// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168
169} // End namespace Foam
170
171// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172
173#endif
174
175// ************************************************************************* //
surfaceScalarField & phi
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A class for managing temporary objects.
Definition: tmp.H:65
An abstract base class for incompressible viscosityModels.
virtual tmp< volScalarField > nu() const =0
Return the laminar viscosity.
declareRunTimeSelectionTable(autoPtr, viscosityModel, dictionary,(const word &name, const dictionary &viscosityProperties, const volVectorField &U, const surfaceScalarField &phi),(name, viscosityProperties, U, phi))
const surfaceScalarField & phi_
virtual tmp< scalarField > nu(const label patchi) const =0
Return the laminar viscosity for patch.
const volVectorField & U_
tmp< volScalarField > strainRate() const
Return the strain rate.
viscosityModel(const viscosityModel &)=delete
No copy construct.
virtual void correct()=0
Correct the laminar viscosity.
void operator=(const viscosityModel &)=delete
No copy assignment.
virtual ~viscosityModel()=default
Destructor.
TypeName("viscosityModel")
Runtime type information.
static autoPtr< viscosityModel > New(const word &name, const dictionary &viscosityProperties, const volVectorField &U, const surfaceScalarField &phi)
Return a reference to the selected viscosity model.
const dictionary & viscosityProperties() const
Return the phase transport properties dictionary.
virtual bool read(const dictionary &viscosityProperties)=0
Read transportProperties dictionary.
dictionary viscosityProperties_
A class for handling words, derived from Foam::string.
Definition: word.H:68
U
Definition: pEqn.H:72
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73