53 lines
1.2 KiB
C
53 lines
1.2 KiB
C
{
|
|
volScalarField rUA = 1.0/UEqn.A();
|
|
surfaceScalarField rUAf = fvc::interpolate(rUA);
|
|
|
|
U = rUA*UEqn.H();
|
|
// Immersed boundary update
|
|
U.correctBoundaryConditions();
|
|
# include "limitU.H"
|
|
|
|
surfaceScalarField phiU
|
|
(
|
|
"phiU",
|
|
faceIbMask*(fvc::interpolate(U) & mesh.Sf())
|
|
);
|
|
|
|
phi = phiU
|
|
+ faceIbMask*
|
|
(
|
|
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
|
- ghf*fvc::snGrad(rho)
|
|
)*rUAf*mesh.magSf();
|
|
|
|
// Adjust immersed boundary fluxes
|
|
immersedBoundaryAdjustPhi(phi, U);
|
|
adjustPhi(phi, U, pd);
|
|
|
|
|
|
while (pimple.correctNonOrthogonal())
|
|
{
|
|
fvScalarMatrix pdEqn
|
|
(
|
|
fvm::laplacian(rUAf, pd, "laplacian(rAU,pd)") == fvc::div(phi)
|
|
);
|
|
|
|
pdEqn.setReference(pdRefCell, pdRefValue);
|
|
|
|
pdEqn.solve
|
|
(
|
|
mesh.solutionDict().solver(pd.select(pimple.finalInnerIter()))
|
|
);
|
|
|
|
if (pimple.finalNonOrthogonalIter())
|
|
{
|
|
phi -= pdEqn.flux();
|
|
}
|
|
}
|
|
|
|
// Explicitly relax pressure
|
|
pd.relax();
|
|
|
|
U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
|
|
U.correctBoundaryConditions();
|
|
}
|