mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: correctPhi: reference cells could become -1. Part fix for #507.
This commit is contained in:
@ -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();
|
||||
//}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user