Loading...
Searching...
No Matches
BirdCarreau.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) 2018-2020 OpenFOAM Foundation
9 Copyright (C) 2017 OpenCFD Ltd
10-------------------------------------------------------------------------------
11License
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 "BirdCarreau.H"
30#include "volFields.H"
33// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35namespace Foam
36{
37namespace laminarModels
38{
40{
43 (
47 );
49}
50}
51
52
53// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
54
57(
58 const dictionary& viscosityProperties
59)
60:
61 generalizedNewtonianViscosityModel(viscosityProperties),
62 BirdCarreauCoeffs_
63 (
64 viscosityProperties.optionalSubDict(typeName + "Coeffs")
65 ),
66 nuInf_("nuInf", dimViscosity, BirdCarreauCoeffs_),
67 k_("k", dimTime, BirdCarreauCoeffs_),
68 n_("n", dimless, BirdCarreauCoeffs_),
69 a_
70 (
71 BirdCarreauCoeffs_.getOrDefault
72 (
73 "a",
75 )
76 )
77{}
78
79
80// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
81
83read
84(
85 const dictionary& viscosityProperties
86)
87{
89
90 BirdCarreauCoeffs_ =
91 viscosityProperties.optionalSubDict(typeName + "Coeffs");
92
93 BirdCarreauCoeffs_.readEntry("nuInf", nuInf_);
94 BirdCarreauCoeffs_.readEntry("k", k_);
95 BirdCarreauCoeffs_.readEntry("n", n_);
96
97 a_ = BirdCarreauCoeffs_.getOrDefault
98 (
99 "a",
101 );
102
103 return true;
104}
105
106
109nu
110(
111 const volScalarField& nu0,
112 const volScalarField& strainRate
113) const
114{
115 return
116 (
117 nuInf_
118 + (nu0 - nuInf_)
119 * pow
120 (
121 scalar(1)
122 + pow
123 (
124 k_*strainRate,
125 a_
126 ),
127 (n_ - scalar(1))/a_
128 )
129 );
130}
131
132
133// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
const dictionary & optionalSubDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary, otherwise return this dictionary.
Definition dictionary.C:560
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect,...
An abstract base class for generalized Newtonian viscosity models.
generalizedNewtonianViscosityModel(const generalizedNewtonianViscosityModel &)=delete
No copy construct.
const dictionary & viscosityProperties() const
Return the phase transport properties dictionary.
virtual bool read(const dictionary &viscosityProperties)=0
Read transportProperties dictionary.
An incompressible Bird-Carreau non-Newtonian viscosity model.
Definition BirdCarreau.H:65
virtual bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
Definition BirdCarreau.C:77
BirdCarreau(const dictionary &viscosityProperties)
Construct from dictionary (components).
Definition BirdCarreau.C:50
virtual tmp< volScalarField > nu(const volScalarField &nu0, const volScalarField &strainRate) const
Return the laminar viscosity.
A class for managing temporary objects.
Definition tmp.H:75
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
A namespace for various generalized Newtonian viscosity model implementations.
Definition BirdCarreau.C:33
Namespace for OpenFOAM.
const dimensionSet dimViscosity
const dimensionSet dimless
Dimensionless.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.