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 {
37  defineTypeNameAndDebug(Casson, 0);
39  (
40  generalisedNewtonianViscosityModel,
41  Casson,
42  dictionary
43  );
44 }
45 }
46 }
47 
48 
49 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
50 
52 (
53  const dictionary& viscosityProperties,
54  const Foam::viscosity& viscosity,
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 // ************************************************************************* //
const dimensionSet dimViscosity
virtual bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
Definition: Casson.C:72
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(rho0+psi *p, rhoMin);# 1 "/home/ubuntu/OpenFOAM-10/applications/solvers/multiphase/cavitatingFoam/alphavPsi.H" 1{ alphav=max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0));alphal=1.0 - alphav;Info<< "max-min alphav: "<< max(alphav).value()<< " "<< min(alphav).value()<< endl;psiModel-> correct()
Definition: pEqn.H:68
addToRunTimeSelectionTable(generalisedNewtonianViscosityModel, Newtonian, dictionary)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
const dimensionSet dimless
bool read(Istream &, const bool keepHeader=false)
Read dictionary from Istream, optionally keeping the header.
Definition: dictionaryIO.C:104
Macros for easy insertion into run-time selection tables.
const dimensionSet dimTime
bool read(const char *, int32_t &)
Definition: int32IO.C:85
const dictionary & optionalSubDict(const word &) const
Find and return a sub-dictionary if found.
Definition: dictionary.C:1060
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
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.
Abstract base class for all fluid physical properties.
Definition: viscosity.H:49
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A class for managing temporary objects.
Definition: PtrList.H:53
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
Namespace for OpenFOAM.
virtual bool read(const dictionary &viscosityProperties)=0
Read transportProperties dictionary.