1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
27 #include "addToRunTimeSelectionTable.H"
28 #include "surfaceFields.H"
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 namespace viscosityModels
36 defineTypeNameAndDebug(powerLaw, 0);
38 addToRunTimeSelectionTable
48 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
50 Foam::tmp<Foam::volScalarField>
51 Foam::viscosityModels::powerLaw::calcNu() const
63 dimensionedScalar("one", dimTime, 1.0)*strainRate(),
64 dimensionedScalar("VSMALL", dimless, VSMALL)
66 n_.value() - scalar(1.0)
73 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
75 Foam::viscosityModels::powerLaw::powerLaw
78 const dictionary& viscosityProperties,
79 const volVectorField& U,
80 const surfaceScalarField& phi
83 viscosityModel(name, viscosityProperties, U, phi),
84 powerLawCoeffs_(viscosityProperties.subDict(typeName + "Coeffs")),
85 k_(powerLawCoeffs_.lookup("k")),
86 n_(powerLawCoeffs_.lookup("n")),
87 nuMin_(powerLawCoeffs_.lookup("nuMin")),
88 nuMax_(powerLawCoeffs_.lookup("nuMax")),
104 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
106 bool Foam::viscosityModels::powerLaw::read
108 const dictionary& viscosityProperties
111 viscosityModel::read(viscosityProperties);
113 powerLawCoeffs_ = viscosityProperties.subDict(typeName + "Coeffs");
115 powerLawCoeffs_.lookup("k") >> k_;
116 powerLawCoeffs_.lookup("n") >> n_;
117 powerLawCoeffs_.lookup("nuMin") >> nuMin_;
118 powerLawCoeffs_.lookup("nuMax") >> nuMax_;
124 // ************************************************************************* //