Casson.C
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) 2018-2022 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 \*---------------------------------------------------------------------------*/
25 
26 #include "Casson.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace laminarModels
34 {
35 namespace generalisedNewtonianViscosityModels
36 {
39  (
41  Casson,
43  );
44 }
45 }
46 }
47 
48 
49 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
50 
52 (
53  const dictionary& viscosityProperties,
55  const volVectorField& U
56 )
57 :
58  strainRateViscosityModel(viscosityProperties, viscosity, U),
59  m_("m", dimViscosity, 0),
60  tau0_("tau0", dimViscosity/dimTime, 0),
61  nuMin_("nuMin", dimViscosity, 0),
62  nuMax_("nuMax", dimViscosity, 0)
63 {
64  read(viscosityProperties);
65  correct();
66 }
67 
68 
69 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
70 
72 (
73  const dictionary& viscosityProperties
74 )
75 {
76  strainRateViscosityModel::read(viscosityProperties);
77 
78  const dictionary& coeffs =
79  viscosityProperties.optionalSubDict(typeName + "Coeffs");
80 
81  m_.read(coeffs);
82  tau0_.read(coeffs);
83  nuMin_.read(coeffs);
84  nuMax_.read(coeffs);
85 
86  return true;
87 }
88 
89 
92 nu
93 (
94  const volScalarField& nu0,
95  const volScalarField& strainRate
96 ) const
97 {
98  return max
99  (
100  nuMin_,
101  min
102  (
103  nuMax_,
104  sqr
105  (
106  sqrt
107  (
108  tau0_
109  /max
110  (
111  strainRate,
113  )
114  ) + sqrt(m_)
115  )
116  )
117  );
118 }
119 
120 
121 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
bool read(Istream &, const bool keepHeader=false)
Read dictionary from Istream, optionally keeping the header.
Definition: dictionaryIO.C:108
const dictionary & optionalSubDict(const word &) const
Find and return a sub-dictionary if found.
Definition: dictionary.C:1076
An abstract base class for generalised Newtonian viscosity models.
virtual bool read(const dictionary &viscosityProperties)=0
Read transportProperties dictionary.
Casson generalised Newtonian viscosity model.
Definition: Casson.H:78
virtual bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
Definition: Casson.C:72
Casson(const dictionary &viscosityProperties, const Foam::viscosity &viscosity, const volVectorField &U)
Construct from components.
Definition: Casson.C:52
An abstract base class for strain-rate dependent generalised Newtonian viscosity models.
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
A class for managing temporary objects.
Definition: tmp.H:55
Abstract base class for all fluid physical properties.
Definition: viscosity.H:50
U
Definition: pEqn.H:72
addToRunTimeSelectionTable(generalisedNewtonianViscosityModel, Newtonian, dictionary)
Namespace for OpenFOAM.
const dimensionSet dimViscosity
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimless
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimTime
dimensionedScalar sqrt(const dimensionedScalar &ds)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)