mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Multi-phase solvers: Improved handling of inflow/outflow BCs in MULES
Avoids slight phase-fraction unboundedness at entertainment BCs and improved
robustness.
Additionally the phase-fractions in the multi-phase (rather than two-phase)
solvers are adjusted to avoid the slow growth of inconsistency ("drift") caused
by solving for all of the phase-fractions rather than deriving one from the
others.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -248,27 +248,19 @@ bool Foam::phaseModel::read(const dictionary& phaseProperties)
|
||||
}
|
||||
|
||||
|
||||
void Foam::phaseModel::correctInflowFlux(surfaceScalarField& alphaPhi) const
|
||||
void Foam::phaseModel::correctInflowOutflow(surfaceScalarField& alphaPhi) const
|
||||
{
|
||||
surfaceScalarField::Boundary& alphaPhiBf = alphaPhi.boundaryFieldRef();
|
||||
const volScalarField::Boundary& alphaBf = boundaryField();
|
||||
const surfaceScalarField::Boundary& phiBf = phi().boundaryField();
|
||||
|
||||
// Ensure that the flux at inflow BCs is preserved
|
||||
forAll(alphaPhiBf, patchi)
|
||||
{
|
||||
fvsPatchScalarField& alphaPhip = alphaPhiBf[patchi];
|
||||
|
||||
if (!alphaPhip.coupled())
|
||||
{
|
||||
const scalarField& phip = phi().boundaryField()[patchi];
|
||||
const scalarField& alphap = boundaryField()[patchi];
|
||||
|
||||
forAll(alphaPhip, facei)
|
||||
{
|
||||
if (phip[facei] < SMALL)
|
||||
{
|
||||
alphaPhip[facei] = alphap[facei]*phip[facei];
|
||||
}
|
||||
}
|
||||
alphaPhip = phiBf[patchi]*alphaBf[patchi];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -319,8 +319,8 @@ public:
|
||||
return alphaRhoPhi_;
|
||||
}
|
||||
|
||||
//- Ensure that the flux at inflow BCs is preserved
|
||||
void correctInflowFlux(surfaceScalarField& alphaPhi) const;
|
||||
//- Ensure that the flux at inflow/outflow BCs is preserved
|
||||
void correctInflowOutflow(surfaceScalarField& alphaPhi) const;
|
||||
|
||||
//- Correct the phase properties
|
||||
// other than the thermodynamics and turbulence
|
||||
|
||||
@ -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
|
||||
@ -444,7 +444,7 @@ void Foam::twoPhaseSystem::solve()
|
||||
)
|
||||
);
|
||||
|
||||
phase1_.correctInflowFlux(alphaPhic1);
|
||||
phase1_.correctInflowOutflow(alphaPhic1);
|
||||
|
||||
if (nAlphaSubCycles > 1)
|
||||
{
|
||||
@ -515,8 +515,7 @@ void Foam::twoPhaseSystem::solve()
|
||||
fvc::interpolate(phase1_.rho())*phase1_.alphaPhi();
|
||||
|
||||
phase2_.alphaPhi() = phi_ - phase1_.alphaPhi();
|
||||
alpha2 = scalar(1) - alpha1;
|
||||
phase2_.correctInflowFlux(phase2_.alphaPhi());
|
||||
phase2_.correctInflowOutflow(phase2_.alphaPhi());
|
||||
phase2_.alphaRhoPhi() =
|
||||
fvc::interpolate(phase2_.rho())*phase2_.alphaPhi();
|
||||
|
||||
@ -525,6 +524,12 @@ void Foam::twoPhaseSystem::solve()
|
||||
<< " Min(" << alpha1.name() << ") = " << min(alpha1).value()
|
||||
<< " Max(" << alpha1.name() << ") = " << max(alpha1).value()
|
||||
<< endl;
|
||||
|
||||
// Ensure the phase-fractions are bounded
|
||||
alpha1.max(0);
|
||||
alpha1.min(1);
|
||||
|
||||
alpha2 = scalar(1) - alpha1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user