Newtonian.C
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-2015 OpenFOAM Foundation
9  Copyright (C) 2017 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 \*---------------------------------------------------------------------------*/
28 
29 #include "Newtonian.H"
31 #include "surfaceFields.H"
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 namespace viscosityModels
38 {
39  defineTypeNameAndDebug(Newtonian, 0);
40  addToRunTimeSelectionTable(viscosityModel, Newtonian, dictionary);
41 }
42 }
43 
44 
45 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
46 
48 (
49  const word& name,
50  const dictionary& viscosityProperties,
51  const volVectorField& U,
52  const surfaceScalarField& phi
53 )
54 :
55  viscosityModel(name, viscosityProperties, U, phi),
56  nu0_("nu", dimViscosity, viscosityProperties_),
57  nu_
58  (
59  IOobject
60  (
61  name,
62  U_.time().timeName(),
63  U_.db(),
64  IOobject::NO_READ,
65  IOobject::NO_WRITE
66  ),
67  U_.mesh(),
68  nu0_
69  )
70 {}
71 
72 
73 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
74 
76 (
77  const dictionary& viscosityProperties
78 )
79 {
80  viscosityModel::read(viscosityProperties);
81 
82  viscosityProperties_.readEntry("nu", nu0_);
83  nu_ = nu0_;
84 
85  return true;
86 }
87 
88 
89 // ************************************************************************* //
Foam::viscosityModels::Newtonian::read
virtual bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
Definition: Newtonian.C:76
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
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
surfaceFields.H
Foam::surfaceFields.
Foam::blockMeshTools::read
void read(Istream &, label &val, const dictionary &)
In-place read with dictionary lookup.
Definition: blockMeshTools.C:57
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::viscosityModels::defineTypeNameAndDebug
defineTypeNameAndDebug(BirdCarreau, 0)
Foam::dimViscosity
const dimensionSet dimViscosity
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
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
U
U
Definition: pEqn.H:72
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::GeometricField< vector, fvPatchField, volMesh >
Foam::viscosityModels::addToRunTimeSelectionTable
addToRunTimeSelectionTable(viscosityModel, BirdCarreau, dictionary)
Newtonian.H