Backported potentialFoam and potentialDyMFoam (setFluxRequired, solutionControls) from vanilla 3.0.1

This commit is contained in:
Vanja Skuric 2016-05-07 09:34:33 +02:00
parent 70a11cfd85
commit 3f49ab0d2f
4 changed files with 14 additions and 6 deletions

View file

@ -48,3 +48,4 @@
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -34,6 +34,7 @@ Author
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "pisoControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,6 +46,9 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
# include "createDynamicFvMesh.H"
pisoControl piso(mesh);
# include "createFields.H"
# include "initTotalVolume.H"
@ -54,7 +58,6 @@ int main(int argc, char *argv[])
while (runTime.loop())
{
# include "readPISOControls.H"
# include "checkTotalVolume.H"
Info<< "Time = " << runTime.timeName() << nl << endl;
@ -75,7 +78,7 @@ int main(int argc, char *argv[])
// Solve potential flow equations
adjustPhi(phi, U, p);
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
while (piso.correctNonOrthogonal())
{
p.storePrevIter();
@ -98,7 +101,7 @@ int main(int argc, char *argv[])
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
if (piso.finalNonOrthogonalIter())
{
phi -= pEqn.flux();
}

View file

@ -50,3 +50,4 @@
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -31,6 +31,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -43,8 +44,10 @@ int main(int argc, char *argv[])
# include "createTime.H"
# include "createMesh.H"
simpleControl simple(mesh);
# include "createFields.H"
# include "readSIMPLEControls.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -52,7 +55,7 @@ int main(int argc, char *argv[])
adjustPhi(phi, U, p);
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
while (simple.correctNonOrthogonal())
{
p.storePrevIter();
@ -75,7 +78,7 @@ int main(int argc, char *argv[])
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
if (simple.finalNonOrthogonalIter())
{
phi -= pEqn.flux();
}