Merge branch 'master' of ssh://noisy/home/noisy2/OpenFOAM/OpenFOAM-dev

This commit is contained in:
andy
2008-06-19 18:05:09 +01:00
5 changed files with 26 additions and 12 deletions

View File

@ -123,13 +123,13 @@ Foam::tmp<Foam::volScalarField> Foam::SchaefferFrictionalStress::muf
) )
); );
volScalarField& muf_ = tmuf(); volScalarField& muff = tmuf();
forAll (D, celli) forAll (D, celli)
{ {
if (alpha[celli] > alphaMax.value()-5e-2) if (alpha[celli] > alphaMax.value()-5e-2)
{ {
muf_[celli] = muff[celli] =
0.5*pf[celli]*sin(phi.value()) 0.5*pf[celli]*sin(phi.value())
/( /(
sqrt(1.0/6.0*(sqr(D[celli].xx() - D[celli].yy()) sqrt(1.0/6.0*(sqr(D[celli].xx() - D[celli].yy())
@ -141,7 +141,7 @@ Foam::tmp<Foam::volScalarField> Foam::SchaefferFrictionalStress::muf
} }
} }
return muf_; return tmuf;
} }

View File

@ -51,9 +51,23 @@ namespace viscosityModels
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField>
Foam::viscosityModels::powerLaw::calcNu() const Foam::viscosityModels::powerLaw::calcNu() const
{ {
dimensionedScalar tone("tone", dimTime, 1.0); return max
return (max(numin_, min(numax_, k_ (
* pow(tone * strainRate(), n_.value()- scalar(1.0))))); nuMin_,
min
(
nuMax_,
k_*pow
(
max
(
dimensionedScalar("one", dimTime, 1.0)*strainRate(),
dimensionedScalar("VSMALL", dimless, VSMALL)
),
n_.value() - scalar(1.0)
)
)
);
} }
@ -71,8 +85,8 @@ Foam::viscosityModels::powerLaw::powerLaw
powerLawCoeffs_(viscosityProperties.subDict(typeName + "Coeffs")), powerLawCoeffs_(viscosityProperties.subDict(typeName + "Coeffs")),
k_(powerLawCoeffs_.lookup("k")), k_(powerLawCoeffs_.lookup("k")),
n_(powerLawCoeffs_.lookup("n")), n_(powerLawCoeffs_.lookup("n")),
numin_(powerLawCoeffs_.lookup("numin")), nuMin_(powerLawCoeffs_.lookup("nuMin")),
numax_(powerLawCoeffs_.lookup("numax")), nuMax_(powerLawCoeffs_.lookup("nuMax")),
nu_ nu_
( (
IOobject IOobject
@ -101,8 +115,8 @@ bool Foam::viscosityModels::powerLaw::read
powerLawCoeffs_.lookup("k") >> k_; powerLawCoeffs_.lookup("k") >> k_;
powerLawCoeffs_.lookup("n") >> n_; powerLawCoeffs_.lookup("n") >> n_;
powerLawCoeffs_.lookup("numin") >> numin_; powerLawCoeffs_.lookup("nuMin") >> nuMin_;
powerLawCoeffs_.lookup("numax") >> numax_; powerLawCoeffs_.lookup("nuMax") >> nuMax_;
return true; return true;
} }

View File

@ -61,8 +61,8 @@ class powerLaw
dimensionedScalar k_; dimensionedScalar k_;
dimensionedScalar n_; dimensionedScalar n_;
dimensionedScalar numin_; dimensionedScalar nuMin_;
dimensionedScalar numax_; dimensionedScalar nuMax_;
volScalarField nu_; volScalarField nu_;