Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 #include "BirdCarreau.H"
00027 #include <OpenFOAM/addToRunTimeSelectionTable.H>
00028 #include <finiteVolume/surfaceFields.H>
00029 
00030 
00031 
00032 namespace Foam
00033 {
00034 namespace viscosityModels
00035 {
00036     defineTypeNameAndDebug(BirdCarreau, 0);
00037     addToRunTimeSelectionTable
00038     (
00039         viscosityModel,
00040         BirdCarreau,
00041         dictionary
00042     );
00043 }
00044 }
00045 
00046 
00047 
00048 
00049 Foam::tmp<Foam::volScalarField>
00050 Foam::viscosityModels::BirdCarreau::calcNu() const
00051 {
00052     return
00053         nuInf_
00054       + (nu0_ - nuInf_)
00055        *pow(scalar(1) + sqr(k_*strainRate()), (n_ - 1.0)/2.0);
00056 }
00057 
00058 
00059 
00060 
00061 Foam::viscosityModels::BirdCarreau::BirdCarreau
00062 (
00063     const word& name,
00064     const dictionary& viscosityProperties,
00065     const volVectorField& U,
00066     const surfaceScalarField& phi
00067 )
00068 :
00069     viscosityModel(name, viscosityProperties, U, phi),
00070     BirdCarreauCoeffs_(viscosityProperties.subDict(typeName + "Coeffs")),
00071     nu0_(BirdCarreauCoeffs_.lookup("nu0")),
00072     nuInf_(BirdCarreauCoeffs_.lookup("nuInf")),
00073     k_(BirdCarreauCoeffs_.lookup("k")),
00074     n_(BirdCarreauCoeffs_.lookup("n")),
00075     nu_
00076     (
00077         IOobject
00078         (
00079             "nu",
00080             U_.time().timeName(),
00081             U_.db(),
00082             IOobject::NO_READ,
00083             IOobject::AUTO_WRITE
00084         ),
00085         calcNu()
00086     )
00087 {}
00088 
00089 
00090 
00091 
00092 bool Foam::viscosityModels::BirdCarreau::read
00093 (
00094     const dictionary& viscosityProperties
00095 )
00096 {
00097     viscosityModel::read(viscosityProperties);
00098 
00099     BirdCarreauCoeffs_ = viscosityProperties.subDict(typeName + "Coeffs");
00100 
00101     BirdCarreauCoeffs_.lookup("nu0") >> nu0_;
00102     BirdCarreauCoeffs_.lookup("nuInf") >> nuInf_;
00103     BirdCarreauCoeffs_.lookup("k") >> k_;
00104     BirdCarreauCoeffs_.lookup("n") >> n_;
00105 
00106     return true;
00107 }
00108 
00109 
00110