1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "CrossPowerLaw.H"
28 #include "addToRunTimeSelectionTable.H"
29 #include "surfaceFields.H"
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 namespace viscosityModels
37 defineTypeNameAndDebug(CrossPowerLaw, 0);
39 addToRunTimeSelectionTable
49 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
51 Foam::tmp<Foam::volScalarField>
52 Foam::viscosityModels::CrossPowerLaw::calcNu() const
54 return (nu0_ - nuInf_)/(scalar(1) + pow(m_*strainRate(), n_)) + nuInf_;
58 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
60 Foam::viscosityModels::CrossPowerLaw::CrossPowerLaw
63 const dictionary& viscosityProperties,
64 const volVectorField& U,
65 const surfaceScalarField& phi
68 viscosityModel(name, viscosityProperties, U, phi),
69 CrossPowerLawCoeffs_(viscosityProperties.subDict(typeName + "Coeffs")),
70 nu0_(CrossPowerLawCoeffs_.lookup("nu0")),
71 nuInf_(CrossPowerLawCoeffs_.lookup("nuInf")),
72 m_(CrossPowerLawCoeffs_.lookup("m")),
73 n_(CrossPowerLawCoeffs_.lookup("n")),
89 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
91 bool Foam::viscosityModels::CrossPowerLaw::read
93 const dictionary& viscosityProperties
96 viscosityModel::read(viscosityProperties);
98 CrossPowerLawCoeffs_ = viscosityProperties.subDict(typeName + "Coeffs");
100 CrossPowerLawCoeffs_.lookup("nu0") >> nu0_;
101 CrossPowerLawCoeffs_.lookup("nuInf") >> nuInf_;
102 CrossPowerLawCoeffs_.lookup("m") >> m_;
103 CrossPowerLawCoeffs_.lookup("n") >> n_;
109 // ************************************************************************* //