constantViscosityModel.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) 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 Class
25  Foam::viscosityModels::constant
26 
27 Description
28  A uniform constant Newtonian viscosity model.
29 
30 SourceFiles
31  constantViscosityModel.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef constantViscosityModel_H
36 #define constantViscosityModel_H
37 
38 #include "viscosityModel.H"
39 #include "volFields.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 namespace viscosityModels
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class constant Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class constant
53 :
54  public viscosityModel
55 {
56  // Private Data
57 
58  //- Uniform constant Newtonian viscosity value
59  dimensionedScalar nu0_;
60 
61  //- Uniform constant Newtonian viscosity field
62  volScalarField nu_;
63 
64 
65 public:
66 
67  //- Runtime type information
68  TypeName("constant");
69 
70 
71  // Constructors
72 
73  //- Construct from components
74  constant(const fvMesh& mesh, const word& group);
75 
76 
77  //- Destructor
78  virtual ~constant()
79  {}
80 
81 
82  // Member Functions
83 
84  //- Return the laminar viscosity
85  virtual tmp<volScalarField> nu() const
86  {
87  return nu_;
88  }
89 
90  //- Return the laminar viscosity for patch
91  virtual tmp<scalarField> nu(const label patchi) const
92  {
93  return nu_.boundaryField()[patchi];
94  }
95 
96  //- Correct the laminar viscosity (not appropriate, viscosity constant)
97  virtual void correct()
98  {}
99 
100  //- Read transportProperties dictionary
101  virtual bool read();
102 };
103 
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 } // End namespace viscosityModels
108 } // End namespace Foam
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 #endif
113 
114 // ************************************************************************* //
Generic GeometricField class.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
word group() const
Return group (extension part of name)
Definition: IOobject.C:324
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
A class for managing temporary objects.
Definition: tmp.H:55
An abstract base class for Newtonian viscosity models.
A uniform constant Newtonian viscosity model.
constant(const fvMesh &mesh, const word &group)
Construct from components.
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
virtual void correct()
Correct the laminar viscosity (not appropriate, viscosity constant)
TypeName("constant")
Runtime type information.
virtual bool read()
Read transportProperties dictionary.
A class for handling words, derived from string.
Definition: word.H:62
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