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