All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
viscosityModel.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Namespace
25  Foam::viscosityModels
26 
27 Description
28  A namespace for various incompressible viscosityModel implementations.
29 
30 Class
31  Foam::viscosityModel
32 
33 Description
34  An abstract base class for incompressible viscosityModels.
35 
36  The strain rate is defined by:
37 
38  mag(symm(grad(U)))
39 
40 
41 SourceFiles
42  viscosityModel.C
43  viscosityModelNew.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef viscosityModel_H
48 #define viscosityModel_H
49 
50 #include "dictionary.H"
51 #include "volFieldsFwd.H"
52 #include "surfaceFieldsFwd.H"
53 #include "dimensionedScalar.H"
54 #include "runTimeSelectionTables.H"
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace Foam
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class viscosityModel Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 class viscosityModel
66 {
67 
68 protected:
69 
70  // Protected data
71 
74 
76  const surfaceScalarField& phi_;
77 
78 
79 public:
80 
81  //- Runtime type information
82  TypeName("viscosityModel");
83 
84 
85  // Declare run-time constructor selection table
86 
88  (
89  autoPtr,
91  dictionary,
92  (
93  const word& name,
95  const volVectorField& U,
96  const surfaceScalarField& phi
97  ),
98  (name, viscosityProperties, U, phi)
99  );
100 
101 
102  // Constructors
103 
104  //- Construct from components
106  (
107  const word& name,
108  const dictionary& viscosityProperties,
109  const volVectorField& U,
110  const surfaceScalarField& phi
111  );
112 
113  //- Disallow default bitwise copy construction
115 
116 
117  // Selectors
118 
119  //- Return a reference to the selected viscosity model
121  (
122  const word& name,
123  const dictionary& viscosityProperties,
124  const volVectorField& U,
125  const surfaceScalarField& phi
126  );
127 
128 
129  //- Destructor
130  virtual ~viscosityModel()
131  {}
132 
133 
134  // Member Functions
135 
136  //- Return the phase transport properties dictionary
137  const dictionary& viscosityProperties() const
138  {
139  return viscosityProperties_;
140  }
141 
142  //- Return the strain rate
144 
145  //- Return the laminar viscosity
146  virtual tmp<volScalarField> nu() const = 0;
147 
148  //- Return the laminar viscosity for patch
149  virtual tmp<scalarField> nu(const label patchi) const = 0;
150 
151  //- Correct the laminar viscosity
152  virtual void correct() = 0;
153 
154  //- Read transportProperties dictionary
155  virtual bool read(const dictionary& viscosityProperties) = 0;
156 
157 
158  // Member Operators
159 
160  //- Disallow default bitwise assignment
161  void operator=(const viscosityModel&) = delete;
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
tmp< volScalarField > strainRate() const
Return the strain rate.
Generic GeometricField class.
const volVectorField & U_
An abstract base class for incompressible viscosityModels.
viscosityModel(const word &name, const dictionary &viscosityProperties, const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
const dictionary & viscosityProperties() const
Return the phase transport properties dictionary.
virtual ~viscosityModel()
Destructor.
virtual tmp< volScalarField > nu() const =0
Return the laminar viscosity.
virtual bool read(const dictionary &viscosityProperties)=0
Read transportProperties dictionary.
A class for handling words, derived from string.
Definition: word.H:59
phi
Definition: correctPhi.H:3
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
label patchi
U
Definition: pEqn.H:72
declareRunTimeSelectionTable(autoPtr, viscosityModel, dictionary,(const word &name, const dictionary &viscosityProperties, const volVectorField &U, const surfaceScalarField &phi),(name, viscosityProperties, U, phi))
static autoPtr< viscosityModel > New(const word &name, const dictionary &viscosityProperties, const volVectorField &U, const surfaceScalarField &phi)
Return a reference to the selected viscosity model.
virtual void correct()=0
Correct the laminar viscosity.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Macros to ease declaration of run-time selection tables.
const surfaceScalarField & phi_
TypeName("viscosityModel")
Runtime type information.
A class for managing temporary objects.
Definition: PtrList.H:53
dictionary viscosityProperties_
void operator=(const viscosityModel &)=delete
Disallow default bitwise assignment.
Namespace for OpenFOAM.