d870fbf964
Merged with setFlux fix.
49 lines
1.1 KiB
C
49 lines
1.1 KiB
C
{
|
|
wordList pcorrTypes(p.boundaryField().types());
|
|
|
|
for (label i=0; i<p.boundaryField().size(); i++)
|
|
{
|
|
if (p.boundaryField()[i].fixesValue())
|
|
{
|
|
pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
|
|
}
|
|
}
|
|
|
|
volScalarField pcorr
|
|
(
|
|
IOobject
|
|
(
|
|
"pcorr",
|
|
runTime.timeName(),
|
|
mesh,
|
|
IOobject::NO_READ,
|
|
IOobject::NO_WRITE
|
|
),
|
|
mesh,
|
|
dimensionedScalar("pcorr", p.dimensions(), 0.0),
|
|
pcorrTypes
|
|
);
|
|
|
|
mesh.schemesDict().setFluxRequired(pcorr.name());
|
|
|
|
while (piso.correctNonOrthogonal())
|
|
{
|
|
fvScalarMatrix pcorrEqn
|
|
(
|
|
fvm::laplacian(rAU, pcorr) == fvc::div(phi)
|
|
);
|
|
|
|
pcorrEqn.setReference(pRefCell, pRefValue);
|
|
pcorrEqn.solve();
|
|
|
|
if (piso.finalNonOrthogonalIter())
|
|
{
|
|
phi -= pcorrEqn.flux();
|
|
}
|
|
|
|
// Fluxes are corrected to absolute velocity and further corrected
|
|
// later. HJ, 6/Feb/2009
|
|
}
|
|
}
|
|
|
|
#include "continuityErrs.H"
|