powerLaw.C
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
00027 #include "powerLaw.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 #include "surfaceFields.H"
00030
00031
00032
00033 namespace Foam
00034 {
00035 namespace viscosityModels
00036 {
00037 defineTypeNameAndDebug(powerLaw, 0);
00038
00039 addToRunTimeSelectionTable
00040 (
00041 viscosityModel,
00042 powerLaw,
00043 dictionary
00044 );
00045 }
00046 }
00047
00048
00049
00050
00051 Foam::tmp<Foam::volScalarField>
00052 Foam::viscosityModels::powerLaw::calcNu() const
00053 {
00054 return max
00055 (
00056 nuMin_,
00057 min
00058 (
00059 nuMax_,
00060 k_*pow
00061 (
00062 max
00063 (
00064 dimensionedScalar("one", dimTime, 1.0)*strainRate(),
00065 dimensionedScalar("VSMALL", dimless, VSMALL)
00066 ),
00067 n_.value() - scalar(1.0)
00068 )
00069 )
00070 );
00071 }
00072
00073
00074
00075
00076 Foam::viscosityModels::powerLaw::powerLaw
00077 (
00078 const word& name,
00079 const dictionary& viscosityProperties,
00080 const volVectorField& U,
00081 const surfaceScalarField& phi
00082 )
00083 :
00084 viscosityModel(name, viscosityProperties, U, phi),
00085 powerLawCoeffs_(viscosityProperties.subDict(typeName + "Coeffs")),
00086 k_(powerLawCoeffs_.lookup("k")),
00087 n_(powerLawCoeffs_.lookup("n")),
00088 nuMin_(powerLawCoeffs_.lookup("nuMin")),
00089 nuMax_(powerLawCoeffs_.lookup("nuMax")),
00090 nu_
00091 (
00092 IOobject
00093 (
00094 name,
00095 U_.time().timeName(),
00096 U_.db(),
00097 IOobject::NO_READ,
00098 IOobject::AUTO_WRITE
00099 ),
00100 calcNu()
00101 )
00102 {}
00103
00104
00105
00106
00107 bool Foam::viscosityModels::powerLaw::read
00108 (
00109 const dictionary& viscosityProperties
00110 )
00111 {
00112 viscosityModel::read(viscosityProperties);
00113
00114 powerLawCoeffs_ = viscosityProperties.subDict(typeName + "Coeffs");
00115
00116 powerLawCoeffs_.lookup("k") >> k_;
00117 powerLawCoeffs_.lookup("n") >> n_;
00118 powerLawCoeffs_.lookup("nuMin") >> nuMin_;
00119 powerLawCoeffs_.lookup("nuMax") >> nuMax_;
00120
00121 return true;
00122 }
00123
00124
00125
Copyright © 2000-2009 OpenCFD Ltd