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/incompressible/porousSimpleFoam/pEqn.H

52 lines
823 B
C
Raw Normal View History

2010-08-26 14:22:03 +00:00
if (pressureImplicitPorosity)
{
U = trTU()&UEqn().H();
}
else
{
U = trAU()*UEqn().H();
}
UEqn.clear();
phi = fvc::interpolate(U) & mesh.Sf();
adjustPhi(phi, U, p);
while (simple.correctNonOrthogonal())
2010-08-26 14:22:03 +00:00
{
tmp<fvScalarMatrix> tpEqn;
if (pressureImplicitPorosity)
{
tpEqn = (fvm::laplacian(trTU(), p) == fvc::div(phi));
}
else
{
tpEqn = (fvm::laplacian(trAU(), p) == fvc::div(phi));
}
tpEqn().setReference(pRefCell, pRefValue);
tpEqn().solve();
if (simple.finalNonOrthogonalIter())
2010-08-26 14:22:03 +00:00
{
phi -= tpEqn().flux();
}
}
#include "continuityErrs.H"
// Explicitly relax pressure for momentum corrector
p.relax();
if (pressureImplicitPorosity)
{
U -= trTU()&fvc::grad(p);
}
else
{
U -= trAU()*fvc::grad(p);
}
U.correctBoundaryConditions();