OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

BirdCarreau.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 #include "BirdCarreau.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 #include "surfaceFields.H"
00030 
00031 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00032 
00033 namespace Foam
00034 {
00035 namespace viscosityModels
00036 {
00037     defineTypeNameAndDebug(BirdCarreau, 0);
00038     addToRunTimeSelectionTable
00039     (
00040         viscosityModel,
00041         BirdCarreau,
00042         dictionary
00043     );
00044 }
00045 }
00046 
00047 
00048 // * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
00049 
00050 Foam::tmp<Foam::volScalarField>
00051 Foam::viscosityModels::BirdCarreau::calcNu() const
00052 {
00053     return
00054         nuInf_
00055       + (nu0_ - nuInf_)
00056        *pow(scalar(1) + sqr(k_*strainRate()), (n_ - 1.0)/2.0);
00057 }
00058 
00059 
00060 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00061 
00062 Foam::viscosityModels::BirdCarreau::BirdCarreau
00063 (
00064     const word& name,
00065     const dictionary& viscosityProperties,
00066     const volVectorField& U,
00067     const surfaceScalarField& phi
00068 )
00069 :
00070     viscosityModel(name, viscosityProperties, U, phi),
00071     BirdCarreauCoeffs_(viscosityProperties.subDict(typeName + "Coeffs")),
00072     nu0_(BirdCarreauCoeffs_.lookup("nu0")),
00073     nuInf_(BirdCarreauCoeffs_.lookup("nuInf")),
00074     k_(BirdCarreauCoeffs_.lookup("k")),
00075     n_(BirdCarreauCoeffs_.lookup("n")),
00076     nu_
00077     (
00078         IOobject
00079         (
00080             "nu",
00081             U_.time().timeName(),
00082             U_.db(),
00083             IOobject::NO_READ,
00084             IOobject::AUTO_WRITE
00085         ),
00086         calcNu()
00087     )
00088 {}
00089 
00090 
00091 // * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
00092 
00093 bool Foam::viscosityModels::BirdCarreau::read
00094 (
00095     const dictionary& viscosityProperties
00096 )
00097 {
00098     viscosityModel::read(viscosityProperties);
00099 
00100     BirdCarreauCoeffs_ = viscosityProperties.subDict(typeName + "Coeffs");
00101 
00102     BirdCarreauCoeffs_.lookup("nu0") >> nu0_;
00103     BirdCarreauCoeffs_.lookup("nuInf") >> nuInf_;
00104     BirdCarreauCoeffs_.lookup("k") >> k_;
00105     BirdCarreauCoeffs_.lookup("n") >> n_;
00106 
00107     return true;
00108 }
00109 
00110 
00111 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd