Commit 5f36999c authored by mattijs's avatar mattijs
Browse files

BUG: correctPhi: reference cells could become -1. Part fix for #507.

parent f4ee314e
......@@ -86,9 +86,25 @@ if (mesh.changing())
fvm::laplacian(rAUf, pcorr) == fvc::div(phi)
);
//pcorrEqn.setReference(refCellI2, 0.0, true);
scalarList values(nZones, 0.0);
pcorrEqn.setReferences(refCells, values, true);
// Only set reference for cells that are CALCULATED
{
DynamicList<label> validCells(refCells.size());
forAll(refCells, zoneId)
{
if (refCells[zoneId] != -1)
{
validCells.append(refCells[zoneId]);
}
}
pcorrEqn.setReferences
(
validCells,
scalarList(validCells.size(), 0.0),
true
);
}
const dictionary& d = mesh.solver
(
......@@ -97,6 +113,7 @@ if (mesh.changing())
pimple.finalInnerIter()
)
);
//Bypass virtual layer
mesh.fvMesh::solve(pcorrEqn, d);
if (pimple.finalNonOrthogonalIter())
......
......@@ -96,9 +96,25 @@
fvm::laplacian(rAUf, pcorr) == fvc::div(phi)
);
//pcorrEqn.setReference(refCellI2, 0, true);
scalarList values(nZones, 0.0);
pcorrEqn.setReferences(refCells, values, true);
// Only set reference for cells that are CALCULATED
{
DynamicList<label> validCells(refCells.size());
forAll(refCells, zoneId)
{
if (refCells[zoneId] != -1)
{
validCells.append(refCells[zoneId]);
}
}
pcorrEqn.setReferences
(
validCells,
scalarList(validCells.size(), 0.0),
true
);
}
const dictionary& d = mesh.solver
(
......@@ -117,9 +133,9 @@
}
}
if (runTime.outputTime())
{
volScalarField("contPhiPcorr", fvc::div(phi)).write();
pcorr.write();
}
//if (runTime.outputTime())
//{
// volScalarField("contPhiPcorr", fvc::div(phi)).write();
// pcorr.write();
//}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment