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
2013-07-18 10:15:54 +02:00

24 lines
670 B
C++

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);
// Info<< "Space patch continuity: "
// << gSum(phi.boundaryField()[spacePatchID]) << endl;
// U.boundaryField()[spacePatchID] ==
// U.boundaryField()[spacePatchID]
// + pos(spacePhi)*U.boundaryField()[spacePatchID]*(outflowScaling - 1.0);
}