twoPhaseEulerFoam: Move the residualAlpha used for drag into the phaseModel

This is necessary to guarantee consistency between the residualAlpha
used for drag and buoyancy in a multi-phase system
This commit is contained in:
Henry
2015-06-07 18:55:24 +01:00
parent 3f62ba192f
commit 61e52b2cb4
37 changed files with 188 additions and 142 deletions

View File

@ -36,6 +36,7 @@ License
#include "partialSlipFvPatchFields.H"
#include "surfaceInterpolate.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::phaseModel::phaseModel
@ -64,6 +65,12 @@ Foam::phaseModel::phaseModel
(
phaseProperties.subDict(name_)
),
residualAlpha_
(
"residualAlpha",
dimless,
fluid.subDict(phaseName).lookup("residualAlpha")
),
alphaMax_(phaseDict_.lookupOrDefault("alphaMax", 1.0)),
thermo_(rhoThermo::New(fluid.mesh(), name_)),
U_
@ -212,23 +219,27 @@ Foam::tmp<Foam::volScalarField> Foam::phaseModel::d() const
return dPtr_().d();
}
Foam::PhaseCompressibleTurbulenceModel<Foam::phaseModel>&
Foam::phaseModel::turbulence()
{
return turbulence_();
}
const Foam::PhaseCompressibleTurbulenceModel<Foam::phaseModel>&
Foam::phaseModel::turbulence() const
{
return turbulence_();
}
void Foam::phaseModel::correct()
{
return dPtr_->correct();
}
bool Foam::phaseModel::read(const dictionary& phaseProperties)
{
phaseDict_ = phaseProperties.subDict(name_);

View File

@ -71,6 +71,10 @@ class phaseModel
dictionary phaseDict_;
//- Return the residual phase-fraction for given phase
// Used to stabilize the phase momentum as the phase-fraction -> 0
dimensionedScalar residualAlpha_;
//- Optional maximum phase-fraction (e.g. packing limit)
scalar alphaMax_;
@ -129,6 +133,13 @@ public:
//- Return the other phase in this two-phase system
const phaseModel& otherPhase() const;
//- Return the residual phase-fraction for given phase
// Used to stabilize the phase momentum as the phase-fraction -> 0
const dimensionedScalar& residualAlpha() const
{
return residualAlpha_;
}
//- Optional maximum phase-fraction (e.g. packing limit)
// Defaults to 1
scalar alphaMax() const

View File

@ -48,14 +48,6 @@ License
#include "HashPtrTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
Foam::dimensionedScalar Foam::twoPhaseSystem::zeroResidualAlpha_
(
"zeroResidualAlpha", dimless, 0
);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::twoPhaseSystem::twoPhaseSystem
@ -588,20 +580,6 @@ bool Foam::twoPhaseSystem::read()
}
const Foam::dimensionedScalar&
Foam::twoPhaseSystem::residualAlpha(const phaseModel& phase) const
{
if (drag_->hasModel(phase))
{
return drag_->phaseModel(phase).residualAlpha();
}
else
{
return zeroResidualAlpha_;
}
}
const Foam::dragModel& Foam::twoPhaseSystem::drag(const phaseModel& phase) const
{
return drag_->phaseModel(phase);

View File

@ -116,9 +116,6 @@ class twoPhaseSystem
autoPtr<BlendedInterfacialModel<turbulentDispersionModel> >
turbulentDispersion_;
//- Default residual alpha (0)
static dimensionedScalar zeroResidualAlpha_;
// Private member functions
@ -185,13 +182,6 @@ public:
// Access
//- Return the residual phase-fraction for given phase
// Used to stabilize the phase momentum as the phase-fraction -> 0
const dimensionedScalar& residualAlpha
(
const phaseModel& phase
) const;
//- Return the drag model for the given phase
const dragModel& drag(const phaseModel& phase) const;