mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
twoPhaseEulerFoam::twoPhaseSystem: Ensure inlet flow of BOTH phases matches the BCs
Previously the inlet flow of phase 1 (the phase solved for) is corrected to match the inlet specification for that phase. However, if the second phase is also constrained at inlets the inlet flux must also be corrected to match the inlet specification.
This commit is contained in:
@ -248,4 +248,30 @@ bool Foam::phaseModel::read(const dictionary& phaseProperties)
|
||||
}
|
||||
|
||||
|
||||
void Foam::phaseModel::correctInflowFlux(surfaceScalarField& alphaPhi) const
|
||||
{
|
||||
surfaceScalarField::Boundary& alphaPhiBf = alphaPhi.boundaryFieldRef();
|
||||
|
||||
// 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];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
Reference in New Issue
Block a user