BUG: basicSpecieMixture: Removed duplicated molecular weight mixing

Mixture molecular weight is now evaluated in heThermo like everything
else, relying on the low level specie mixing rules. Units have also been
corrected.

SpecieMixture: Pure virtual definition for W to prevent Clang warning
This commit is contained in:
Will Bainbridge
2017-12-01 14:21:28 +00:00
committed by Andrew Heather
parent d9afa508e1
commit f180ab7249
12 changed files with 104 additions and 46 deletions

View File

@ -275,6 +275,12 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::CpByCpv
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::W() const
{
return alpha1()*thermo1_->W() + alpha2()*thermo1_->W();
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::nu() const
{
return mu()/(alpha1()*thermo1_->rho() + alpha2()*thermo2_->rho());

View File

@ -242,6 +242,9 @@ public:
const label patchi
) const;
//- Molecular weight [kg/kmol]
virtual tmp<volScalarField> W() const;
// Fields derived from transport state variables

View File

@ -519,6 +519,21 @@ Foam::tmp<Foam::scalarField> Foam::multiphaseMixtureThermo::CpByCpv
}
Foam::tmp<Foam::volScalarField> Foam::multiphaseMixtureThermo::W() const
{
PtrDictionary<phaseModel>::const_iterator phasei = phases_.begin();
tmp<volScalarField> tW(phasei()*phasei().thermo().W());
for (++phasei; phasei != phases_.end(); ++phasei)
{
tW.ref() += phasei()*phasei().thermo().W();
}
return tW;
}
Foam::tmp<Foam::volScalarField> Foam::multiphaseMixtureThermo::nu() const
{
return mu()/rho();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -362,6 +362,9 @@ public:
const label patchi
) const;
//- Molecular weight [kg/kmol]
virtual tmp<volScalarField> W() const;
// Fields derived from transport state variables

View File

@ -32,10 +32,14 @@ Foam::tmp<Foam::volScalarField>
Foam::interfaceCompositionModels::Saturated<Thermo, OtherThermo>::
wRatioByP() const
{
return
const dimensionedScalar Wi
(
"W",
dimMass/dimMoles,
this->thermo_.composition().W(saturatedIndex_)
/this->thermo_.composition().W()
/this->thermo_.p();
);
return Wi/this->thermo_.W()/this->thermo_.p();
}