Casson.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) 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::Casson
29 
30 Description
31  An incompressible Casson non-Newtonian viscosity model.
32 
33  References:
34  \verbatim
35  Casson, N. (1959).
36  Rheology of disperse systems.
37  In Proceedings of a Conference Organized by the
38  British Society of Rheology.
39  Pergamon Press, New York.
40 
41  Fournier, R. L. (2011).
42  Basic transport phenomena in biomedical engineering.
43  CRC Press.
44  \endverbatim
45 
46  Example specification for blood:
47  \verbatim
48  transportModel Casson;
49 
50  CassonCoeffs
51  {
52  m 3.934986e-6;
53  tau0 2.9032e-6;
54  nuMax 13.3333e-6;
55  nuMin 3.9047e-6;
56  }
57  \endverbatim
58 
59 SourceFiles
60  Casson.C
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef Casson_H
65 #define Casson_H
66 
67 #include "viscosityModel.H"
68 #include "dimensionedScalar.H"
69 #include "volFields.H"
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 namespace viscosityModels
76 {
77 
78 
79 /*---------------------------------------------------------------------------*\
80  Class Casson Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 class Casson
84 :
85  public viscosityModel
86 {
87  // Private data
88 
89  dictionary CassonCoeffs_;
90 
92  dimensionedScalar tau0_;
93  dimensionedScalar nuMin_;
94  dimensionedScalar nuMax_;
95 
96 
97 
98 protected:
99 
100  // Protected data
101 
103 
104 
105  // Protected Member Functions
106 
107  //- Calculate and return the laminar viscosity
108  tmp<volScalarField> calcNu() const;
109 
110 
111 public:
112 
113  //- Runtime type information
114  TypeName("Casson");
115 
116 
117  // Constructors
118 
119  //- Construct from components
120  Casson
121  (
122  const word& name,
124  const volVectorField& U,
125  const surfaceScalarField& phi
126  );
127 
128 
129  //- Destructor
130  virtual ~Casson() = default;
131 
132 
133  // Member Functions
134 
135  //- Return the laminar viscosity
136  virtual tmp<volScalarField> nu() const
137  {
138  return nu_;
139  }
140 
141  //- Return the laminar viscosity for patch
142  virtual tmp<scalarField> nu(const label patchi) const
143  {
144  return nu_.boundaryField()[patchi];
145  }
146 
147  //- Correct the laminar viscosity
148  virtual void correct()
149  {
150  nu_ = calcNu();
151  }
152 
153  //- Read transportProperties dictionary
154  virtual bool read(const dictionary& viscosityProperties);
155 };
156 
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace viscosityModels
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
volFields.H
Foam::viscosityModels::Casson::correct
virtual void correct()
Correct the laminar viscosity.
Definition: Casson.H:147
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::viscosityModels::Casson::nu
virtual tmp< scalarField > nu(const label patchi) const
Return the laminar viscosity for patch.
Definition: Casson.H:141
Foam::viscosityModels::Casson::TypeName
TypeName("Casson")
Runtime type information.
Foam::viscosityModel::viscosityProperties
const dictionary & viscosityProperties() const
Return the phase transport properties dictionary.
Definition: viscosityModel.H:144
Foam::viscosityModels::Casson::read
virtual bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
Definition: Casson.C:112
Foam::viscosityModels::Casson::calcNu
tmp< volScalarField > calcNu() const
Calculate and return the laminar viscosity.
Definition: Casson.C:53
Foam::viscosityModels::Casson::Casson
Casson(const word &name, const dictionary &viscosityProperties, const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
Definition: Casson.C:81
Foam::viscosityModels::Casson::~Casson
virtual ~Casson()=default
Destructor.
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::viscosityModels::Casson
An incompressible Casson non-Newtonian viscosity model.
Definition: Casson.H:82
Foam::dimensioned< scalar >
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::viscosityModels::Casson::nu_
volScalarField nu_
Definition: Casson.H:101
dimensionedScalar.H
U
U
Definition: pEqn.H:72
Foam::viscosityModels::Casson::nu
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
Definition: Casson.H:135
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::GeometricField::boundaryField
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Definition: GeometricFieldI.H:62