47 lines
984 B
C
47 lines
984 B
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
|
||
|
);
|
||
|
|
||
|
phi = (fvc::interpolate(U) & mesh.Sf());
|
||
|
|
||
|
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||
|
{
|
||
|
fvScalarMatrix pcorrEqn
|
||
|
(
|
||
|
fvm::laplacian(rUA, pcorr) == fvc::div(phi)
|
||
|
);
|
||
|
|
||
|
pcorrEqn.setReference(pRefCell, pRefValue);
|
||
|
pcorrEqn.solve();
|
||
|
|
||
|
if (nonOrth == nNonOrthCorr)
|
||
|
{
|
||
|
phi -= pcorrEqn.flux();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#include "continuityErrs.H"
|