multiphaseInterFoam: cache the mixture kinematic viscosity for use in fvOptions etc.

This commit is contained in:
Henry
2014-05-13 10:34:33 +01:00
committed by Andrew Heather
parent 813b693696
commit 49c5519be8
2 changed files with 19 additions and 4 deletions

View File

@ -112,6 +112,17 @@ Foam::multiphaseMixture::multiphaseMixture
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName
), ),
nu_
(
IOobject
(
"nu",
mesh_.time().timeName(),
mesh_
),
mu()/rho()
),
sigmas_(lookup("sigmas")), sigmas_(lookup("sigmas")),
dimSigma_(1, 0, -2, 0, 0), dimSigma_(1, 0, -2, 0, 0),
deltaN_ deltaN_
@ -218,14 +229,14 @@ Foam::multiphaseMixture::muf() const
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField>
Foam::multiphaseMixture::nu() const Foam::multiphaseMixture::nu() const
{ {
return mu()/rho(); return nu_;
} }
Foam::tmp<Foam::scalarField> Foam::tmp<Foam::scalarField>
Foam::multiphaseMixture::nu(const label patchi) const Foam::multiphaseMixture::nu(const label patchi) const
{ {
return mu(patchi)/rho(patchi); return nu_.boundaryField()[patchi];
} }
@ -340,6 +351,9 @@ void Foam::multiphaseMixture::solve()
{ {
solveAlphas(cAlpha); solveAlphas(cAlpha);
} }
// Update the mixture kinematic viscosity
nu_ = mu()/rho();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -141,9 +141,10 @@ private:
const surfaceScalarField& phi_; const surfaceScalarField& phi_;
surfaceScalarField rhoPhi_; surfaceScalarField rhoPhi_;
volScalarField alphas_; volScalarField alphas_;
volScalarField nu_;
typedef HashTable<scalar, interfacePair, interfacePair::hash> typedef HashTable<scalar, interfacePair, interfacePair::hash>
sigmaTable; sigmaTable;