twoPhaseMixture: Added support for named phases

e.g. in transportProperties

phases (air water);
This commit is contained in:
Henry
2012-04-16 11:46:35 +01:00
parent 25504bf856
commit aa7c66a3ff
5 changed files with 54 additions and 66 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -59,8 +59,8 @@ Foam::twoPhaseMixture::twoPhaseMixture
:
transportModel(U, phi),
phase1Name_("phase1"),
phase2Name_("phase2"),
phase1Name_(found("phases") ? wordList(lookup("phases"))[0] : "phase1"),
phase2Name_(found("phases") ? wordList(lookup("phases"))[1] : "phase2"),
nuModel1_
(
@ -89,7 +89,18 @@ Foam::twoPhaseMixture::twoPhaseMixture
U_(U),
phi_(phi),
alpha1_(U_.db().lookupObject<const volScalarField> (alpha1Name)),
alpha1_
(
IOobject
(
found("phases") ? word("alpha" + phase1Name_) : alpha1Name,
U_.time().timeName(),
U_.db(),
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
U_.mesh()
),
nu_
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -69,7 +69,7 @@ protected:
const volVectorField& U_;
const surfaceScalarField& phi_;
const volScalarField& alpha1_;
volScalarField alpha1_;
volScalarField nu_;
@ -110,6 +110,18 @@ public:
return phase2Name_;
}
//- Return the phase-fraction of phase 1
const volScalarField& alpha1() const
{
return alpha1_;
}
//- Return the phase-fraction of phase 1
volScalarField& alpha1()
{
return alpha1_;
}
//- Return const-access to phase1 viscosityModel
const viscosityModel& nuModel1() const
{