ENH: Updated SIMPLE solvers to new simpleControl framework

This commit is contained in:
andy
2011-10-26 14:31:57 +01:00
parent 3f53a04f09
commit ca3ec6ebcb
14 changed files with 37 additions and 61 deletions

View File

@ -120,7 +120,7 @@ int main(int argc, char *argv[])
adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
while (simple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
@ -130,7 +130,7 @@ int main(int argc, char *argv[])
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
if (nonOrth == simple.nNonOrthCorr())
if (simple.finalNonOrthogonalIter())
{
phi -= pEqn.flux();
}
@ -181,7 +181,7 @@ int main(int argc, char *argv[])
adjustPhi(phia, Ua, pa);
// Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
while (simple.correctNonOrthogonal())
{
fvScalarMatrix paEqn
(
@ -191,7 +191,7 @@ int main(int argc, char *argv[])
paEqn.setReference(paRefCell, paRefValue);
paEqn.solve();
if (nonOrth == simple.nNonOrthCorr())
if (simple.finalNonOrthogonalIter())
{
phia -= paEqn.flux();
}

View File

@ -10,7 +10,7 @@
adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
while (simple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
@ -20,7 +20,7 @@
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
if (nonOrth == simple.nNonOrthCorr())
if (simple.finalNonOrthogonalIter())
{
phi -= pEqn.flux();
}

View File

@ -9,7 +9,7 @@
adjustPhi(phi, Urel, p);
// Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
while (simple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
@ -20,7 +20,7 @@
pEqn.solve();
if (nonOrth == simple.nNonOrthCorr())
if (simple.finalNonOrthogonalIter())
{
phi -= pEqn.flux();
}

View File

@ -9,7 +9,7 @@
adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
while (simple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
@ -20,7 +20,7 @@
pEqn.solve();
if (nonOrth == simple.nNonOrthCorr())
if (simple.finalNonOrthogonalIter())
{
phi -= pEqn.flux();
}

View File

@ -11,7 +11,7 @@ UEqn.clear();
phi = fvc::interpolate(U) & mesh.Sf();
adjustPhi(phi, U, p);
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
while (simple.correctNonOrthogonal())
{
tmp<fvScalarMatrix> tpEqn;
@ -25,17 +25,10 @@ for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
}
tpEqn().setReference(pRefCell, pRefValue);
// retain the residual from the first iteration
if (nonOrth == 0)
{
tpEqn().solve();
}
else
{
tpEqn().solve();
}
if (nonOrth == simple.nNonOrthCorr())
tpEqn().solve();
if (simple.finalNonOrthogonalIter())
{
phi -= tpEqn().flux();
}