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/include/spacePatchFlowRateScaling.H

18 lines
423 B
C
Raw Normal View History

if(spacePatchID != -1)
{
fvsPatchScalarField& spacePhi = phi.boundaryField()[spacePatchID];
scalar outflowScaling =
(
- sum(neg(spacePhi)*spacePhi) + SMALL
)/
(
sum(pos(spacePhi)*spacePhi) + SMALL
);
spacePhi += pos(spacePhi)*spacePhi*(outflowScaling - 1.0);
U.boundaryField()[spacePatchID] +=
pos(spacePhi)*U.boundaryField()[spacePatchID]*(outflowScaling - 1.0);
}