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/multiphase/MRFInterFoam/pEqn.H

49 lines
1.1 KiB
C++
Raw Normal View History

2013-09-17 15:04:22 +00:00
{
volScalarField rUA = 1.0/UEqn.A();
surfaceScalarField rUAf = fvc::interpolate(rUA);
U = rUA*UEqn.H();
2017-01-11 11:57:48 +00:00
// Update boundary velocity for consistency with the flux
mrfZones.correctBoundaryVelocity(U);
2013-09-17 15:04:22 +00:00
surfaceScalarField phiU
(
"phiU",
(fvc::interpolate(U) & mesh.Sf())
//+ fvc::ddtPhiCorr(rUA, rho, U, phi)
);
mrfZones.relativeFlux(phiU);
phi = phiU +
(
fvc::interpolate(interface.sigmaK())*
fvc::snGrad(alpha1)*mesh.magSf()
+ fvc::interpolate(rho)*(g & mesh.Sf())
)*rUAf;
adjustPhi(phi, U, p);
while (pimple.correctNonOrthogonal())
2013-09-17 15:04:22 +00:00
{
fvScalarMatrix pdEqn
(
fvm::laplacian(rUAf, pd) == fvc::div(phi)
);
pdEqn.setReference(pdRefCell, pdRefValue);
pdEqn.solve
(
mesh.solutionDict().solver(pd.select(pimple.finalInnerIter()))
);
2013-09-17 15:04:22 +00:00
if (pimple.finalNonOrthogonalIter())
2013-09-17 15:04:22 +00:00
{
phi -= pdEqn.flux();
}
}
U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
U.correctBoundaryConditions();
}