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 Newtonian viscosity models.
29 
30 Class
31  Foam::viscosityModel
32 
33 Description
34  An abstract base class for Newtonian viscosity models.
35 
36 SourceFiles
37  viscosityModel.C
38  viscosityModelNew.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef viscosityModel_H
43 #define viscosityModel_H
44 
45 #include "physicalProperties.H"
46 #include "viscosity.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 // Forward declaration of classes
54 class fvMesh;
55 
56 /*---------------------------------------------------------------------------*\
57  Class viscosityModel Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 class viscosityModel
61 :
62  public physicalProperties,
63  public viscosity
64 {
65 
66 public:
67 
68  //- Runtime type information
69  TypeName("viscosityModel");
70 
71 
72  // Declare run-time constructor selection table
73 
75  (
76  autoPtr,
78  dictionary,
79  (
80  const fvMesh& mesh,
81  const word& group
82  ),
83  (mesh, group)
84  );
85 
86 
87  // Constructors
88 
89  //- Construct from components
90  viscosityModel(const fvMesh& mesh, const word& group);
91 
92  //- Disallow default bitwise copy construction
93  viscosityModel(const viscosityModel&) = delete;
94 
95 
96  // Selectors
97 
98  //- Return a reference to the selected viscosity model
100  (
101  const fvMesh& mesh,
102  const word& group = word::null
103  );
104 
105 
106  //- Destructor
107  virtual ~viscosityModel()
108  {}
109 
110 
111  // Member Functions
112 
113  //- Read physicalProperties dictionary
114  virtual bool read() = 0;
115 
116  //- Return the laminar viscosity
117  virtual tmp<volScalarField> nu() const = 0;
118 
119  //- Return the laminar viscosity for patch
120  virtual tmp<scalarField> nu(const label patchi) const = 0;
121 
122  //- Correct the laminar viscosity
123  virtual void correct() = 0;
124 
125 
126  // Member Operators
127 
128  //- Disallow default bitwise assignment
129  void operator=(const viscosityModel&) = delete;
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace Foam
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #endif
140 
141 // ************************************************************************* //
word group() const
Return group (extension part of name)
Definition: IOobject.C:324
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
A base class for physical properties.
A class for managing temporary objects.
Definition: tmp.H:55
An abstract base class for Newtonian viscosity models.
virtual bool read()=0
Read physicalProperties dictionary.
virtual void correct()=0
Correct the laminar viscosity.
void operator=(const viscosityModel &)=delete
Disallow default bitwise assignment.
virtual ~viscosityModel()
Destructor.
static autoPtr< viscosityModel > New(const fvMesh &mesh, const word &group=word::null)
Return a reference to the selected viscosity model.
TypeName("viscosityModel")
Runtime type information.
viscosityModel(const fvMesh &mesh, const word &group)
Construct from components.
virtual tmp< volScalarField > nu() const =0
Return the laminar viscosity.
declareRunTimeSelectionTable(autoPtr, viscosityModel, dictionary,(const fvMesh &mesh, const word &group),(mesh, group))
Abstract base class for all fluid physical properties.
Definition: viscosity.H:50
A class for handling words, derived from string.
Definition: word.H:62
static const word null
An empty word.
Definition: word.H:77
label patchi
Namespace for OpenFOAM.
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