twoPhaseEulerFoam: Update only the fixed-value phi patch fields before constructing the pressure eqn

Avoids small continuity error in parallel
This commit is contained in:
Henry
2015-05-08 09:51:36 +01:00
parent 3ebeea2be5
commit 6b2fb4664c
3 changed files with 46 additions and 18 deletions

View File

@ -22,8 +22,6 @@ volScalarField rAU2
)
);
//surfaceScalarField alpharAUf1(fvc::interpolate(alpha1*rAU1));
//surfaceScalarField alpharAUf2(fvc::interpolate(alpha2*rAU2));
surfaceScalarField alpharAUf1
(
fvc::interpolate(max(alpha1, fluid.residualAlpha(phase1))*rAU1)
@ -94,10 +92,26 @@ while (pimple.correct())
#include "correctContErrs.H"
// Correct flux BCs to be consistent with the velocity BCs
phi1.boundaryField() ==
mrfZones.relative(mesh.Sf().boundaryField() & U1.boundaryField());
phi2.boundaryField() ==
mrfZones.relative(mesh.Sf().boundaryField() & U2.boundaryField());
forAll(mesh.boundary(), patchi)
{
if (isA<fixedValueFvsPatchScalarField>(phi1.boundaryField()[patchi]))
{
phi1.boundaryField()[patchi] ==
mrfZones.relative
(
mesh.Sf().boundaryField() & U1.boundaryField()
)()[patchi];
}
if (isA<fixedValueFvsPatchScalarField>(phi2.boundaryField()[patchi]))
{
phi2.boundaryField()[patchi] ==
mrfZones.relative
(
mesh.Sf().boundaryField() & U2.boundaryField()
)()[patchi];
}
}
volVectorField HbyA1
(
@ -227,12 +241,9 @@ while (pimple.correct())
p_rgh.boundaryField(),
(
phiHbyA.boundaryField()
- mrfZones.relative
(
alphaf1.boundaryField()
*(mesh.Sf().boundaryField() & U1.boundaryField())
+ alphaf2.boundaryField()
*(mesh.Sf().boundaryField() & U2.boundaryField())
- (
alphaf1.boundaryField()*phi1.boundaryField()
+ alphaf2.boundaryField()*phi2.boundaryField()
)
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
);

View File

@ -98,11 +98,27 @@ while (pimple.correct())
surfaceScalarField rhof1(fvc::interpolate(rho1));
surfaceScalarField rhof2(fvc::interpolate(rho2));
// Correct flux BCs to be consistent with the velocity BCs
phi1.boundaryField() ==
mrfZones.relative(mesh.Sf().boundaryField() & U1.boundaryField());
phi2.boundaryField() ==
mrfZones.relative(mesh.Sf().boundaryField() & U2.boundaryField());
// Correct fixed-flux BCs to be consistent with the velocity BCs
forAll(mesh.boundary(), patchi)
{
if (isA<fixedValueFvsPatchScalarField>(phi1.boundaryField()[patchi]))
{
phi1.boundaryField()[patchi] ==
mrfZones.relative
(
mesh.Sf().boundaryField() & U1.boundaryField()
)()[patchi];
}
if (isA<fixedValueFvsPatchScalarField>(phi2.boundaryField()[patchi]))
{
phi2.boundaryField()[patchi] ==
mrfZones.relative
(
mesh.Sf().boundaryField() & U2.boundaryField()
)()[patchi];
}
}
surfaceScalarField alpharAUf1
(

View File

@ -30,6 +30,7 @@ License
#include "PhaseCompressibleTurbulenceModel.H"
#include "dragModel.H"
#include "heatTransferModel.H"
#include "fixedValueFvsPatchFields.H"
#include "fixedValueFvPatchFields.H"
#include "slipFvPatchFields.H"
#include "partialSlipFvPatchFields.H"
@ -151,7 +152,7 @@ Foam::phaseModel::phaseModel
|| isA<partialSlipFvPatchVectorField>(U_.boundaryField()[i])
)
{
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
phiTypes[i] = fixedValueFvsPatchScalarField::typeName;
}
}