This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/surfaceTracking/bubbleInterTrackFoam/scaleSpacePhi.H

25 lines
671 B
C
Raw Normal View History

if(runTime.timeIndex() > 1)
{
fvsPatchScalarField& spacePhi = phi.boundaryField()[spacePatchID];
scalar inletFlux = gSum(neg(spacePhi)*spacePhi);
scalar outletFlux = gSum(pos(spacePhi)*spacePhi);
if(outletFlux < VSMALL)
{
outletFlux = VSMALL;
}
scalar outflowScaling = -inletFlux/outletFlux;
spacePhi += pos(spacePhi)*spacePhi*(outflowScaling - 1.0);
2012-11-15 10:30:06 +00:00
// Info<< "Space patch continuity: "
// << gSum(phi.boundaryField()[spacePatchID]) << endl;
// U.boundaryField()[spacePatchID] ==
// U.boundaryField()[spacePatchID]
// + pos(spacePhi)*U.boundaryField()[spacePatchID]*(outflowScaling - 1.0);
}