Skip to content
Snippets Groups Projects
Commit 0175bc36 authored by Henry's avatar Henry
Browse files

multiphase: Ensure that phi at fixedValue U BCs are up to date

parent 9e79d990
Branches
Tags
No related merge requests found
...@@ -58,8 +58,6 @@ ...@@ -58,8 +58,6 @@
dimensionedScalar("phiHbyA", dimArea*dimVelocity, 0) dimensionedScalar("phiHbyA", dimArea*dimVelocity, 0)
); );
phi = dimensionedScalar("phi", phi.dimensions(), 0);
phasei = 0; phasei = 0;
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter) forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
{ {
...@@ -100,8 +98,6 @@ ...@@ -100,8 +98,6 @@
); );
mrfZones.relativeFlux(phiHbyAs[phasei]); mrfZones.relativeFlux(phiHbyAs[phasei]);
phi += alphafs[phasei]*phiHbyAs[phasei];
phiHbyAs[phasei] += phiHbyAs[phasei] +=
rAlphaAUfs[phasei] rAlphaAUfs[phasei]
*( *(
...@@ -161,6 +157,9 @@ ...@@ -161,6 +157,9 @@
phasei++; phasei++;
} }
// Reset phi BCs
phi.boundaryField() = 0;
phasei = 0; phasei = 0;
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter) forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
{ {
...@@ -172,6 +171,10 @@ ...@@ -172,6 +171,10 @@
mrfZones.relativeFlux(phase.phi().oldTime()); mrfZones.relativeFlux(phase.phi().oldTime());
mrfZones.relativeFlux(phase.phi()); mrfZones.relativeFlux(phase.phi());
// Update phi BCs before pEqn
phi.boundaryField() +=
alphafs[phasei].boundaryField()*phase.phi().boundaryField();
phasei++; phasei++;
} }
......
...@@ -8,9 +8,12 @@ ...@@ -8,9 +8,12 @@
surfaceScalarField rAlphaAU1f(fvc::interpolate(alpha1*rAU1)); surfaceScalarField rAlphaAU1f(fvc::interpolate(alpha1*rAU1));
surfaceScalarField rAlphaAU2f(fvc::interpolate(alpha2*rAU2)); surfaceScalarField rAlphaAU2f(fvc::interpolate(alpha2*rAU2));
// Update the phi BCs from U before p BCs are updated // Update the phi BCs from Us before p BCs are updated
phi1.boundaryField() == (mesh.Sf().boundaryField() & U1.boundaryField()); phi.boundaryField() =
phi2.boundaryField() == (mesh.Sf().boundaryField() & U2.boundaryField()); alpha1f.boundaryField()
*(mesh.Sf().boundaryField() & U1.boundaryField())
+ alpha2f.boundaryField()
*(mesh.Sf().boundaryField() & U2.boundaryField());
volVectorField HbyA1 volVectorField HbyA1
( (
...@@ -174,8 +177,14 @@ ...@@ -174,8 +177,14 @@
{ {
surfaceScalarField mSfGradp(pEqnIncomp.flux()/Dp); surfaceScalarField mSfGradp(pEqnIncomp.flux()/Dp);
phi1.boundaryField() ==
(mesh.Sf().boundaryField() & U1.boundaryField());
phi1 = phiHbyA1 + rAlphaAU1f*mSfGradp/fvc::interpolate(rho1); phi1 = phiHbyA1 + rAlphaAU1f*mSfGradp/fvc::interpolate(rho1);
phi2.boundaryField() ==
(mesh.Sf().boundaryField() & U2.boundaryField());
phi2 = phiHbyA2 + rAlphaAU2f*mSfGradp/fvc::interpolate(rho2); phi2 = phiHbyA2 + rAlphaAU2f*mSfGradp/fvc::interpolate(rho2);
phi = alpha1f*phi1 + alpha2f*phi2; phi = alpha1f*phi1 + alpha2f*phi2;
dgdt = dgdt =
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment