Newtonian.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-2016 OpenFOAM Foundation
9  Copyright (C) 2017-2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::viscosityModels::Newtonian
29 
30 Description
31  An incompressible Newtonian viscosity model.
32 
33 SourceFiles
34  Newtonian.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Newtonian_H
39 #define Newtonian_H
40 
41 #include "viscosityModel.H"
42 #include "dimensionedScalar.H"
43 #include "volFields.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 namespace viscosityModels
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class Newtonian Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class Newtonian
57 :
58  public viscosityModel
59 {
60  // Private data
61 
62  dimensionedScalar nu0_;
63 
64 
65 public:
66 
67  // Protected data
68 
70 
71 
72  //- Runtime type information
73  TypeName("Newtonian");
74 
75 
76  // Constructors
77 
78  //- Construct from components
79  Newtonian
80  (
81  const word& name,
83  const volVectorField& U,
84  const surfaceScalarField& phi
85  );
86 
87 
88  //- Destructor
89  virtual ~Newtonian() = default;
90 
91 
92  // Member Functions
93 
94  //- Return the laminar viscosity
95  virtual tmp<volScalarField> nu() const
96  {
97  return nu_;
98  }
99 
100  //- Return the laminar viscosity for patch
101  virtual tmp<scalarField> nu(const label patchi) const
102  {
103  return nu_.boundaryField()[patchi];
104  }
105 
106  //- Correct the laminar viscosity (not appropriate, viscosity constant)
107  virtual void correct()
108  {}
109 
110  //- Read transportProperties dictionary
111  virtual bool read(const dictionary& viscosityProperties);
112 };
113 
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 } // End namespace viscosityModels
118 } // End namespace Foam
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 #endif
123 
124 // ************************************************************************* //
Foam::viscosityModels::Newtonian::read
virtual bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
Definition: Newtonian.C:76
volFields.H
Foam::viscosityModel
An abstract base class for incompressible viscosityModels.
Definition: viscosityModel.H:67
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::viscosityModel::viscosityProperties
const dictionary & viscosityProperties() const
Return the phase transport properties dictionary.
Definition: viscosityModel.H:144
Foam::viscosityModels::Newtonian::correct
virtual void correct()
Correct the laminar viscosity (not appropriate, viscosity constant)
Definition: Newtonian.H:106
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::dimensioned< scalar >
Foam::viscosityModels::Newtonian::nu
virtual tmp< scalarField > nu(const label patchi) const
Return the laminar viscosity for patch.
Definition: Newtonian.H:100
Foam::viscosityModels::Newtonian::TypeName
TypeName("Newtonian")
Runtime type information.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::viscosityModels::Newtonian::Newtonian
Newtonian(const word &name, const dictionary &viscosityProperties, const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
Definition: Newtonian.C:48
Foam::viscosityModels::Newtonian::~Newtonian
virtual ~Newtonian()=default
Destructor.
dimensionedScalar.H
U
U
Definition: pEqn.H:72
Foam::viscosityModels::Newtonian::nu_
volScalarField nu_
Definition: Newtonian.H:68
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::viscosityModels::Newtonian::nu
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
Definition: Newtonian.H:94
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::GeometricField::boundaryField
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Definition: GeometricFieldI.H:62
Foam::viscosityModels::Newtonian
An incompressible Newtonian viscosity model.
Definition: Newtonian.H:55