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/include/scalePhi.H
2013-07-18 10:15:54 +02:00

28 lines
842 B
C

if(interface.twoFluids() && pNeedRef)
{
phi.boundaryField()[interface.bPatchID()] =
(
U.boundaryField()[interface.bPatchID()]
& mesh.Sf().boundaryField()[interface.bPatchID()]
);
scalarField weights =
mag(phi.boundaryField()[interface.bPatchID()]);
if(mag(gSum(weights)) > VSMALL)
{
weights /= gSum(weights);
}
phi.boundaryField()[interface.bPatchID()] -=
weights*gSum(phi.boundaryField()[interface.bPatchID()]);
// Info << "Free surface shadow flow rate: "
// << gSum(phi.boundaryField()[interface.bPatchID()]) << endl;
phi.boundaryField()[interface.bPatchID()] +=
p.boundaryField()[interface.bPatchID()].snGrad()
*mesh.magSf().boundaryField()[interface.bPatchID()]
/AU.boundaryField()[interface.bPatchID()];
}