Commit d4d0b889 authored by henry's avatar henry
Browse files

fvData: New database (dictionary) held on the fvMesh to store residual information etc.

This data can be used for convergence testing e.g. by a functionObject.
Other data could also be stored, e.g. global continuity errors and other reduced results.
parent 90189b35
......@@ -34,12 +34,7 @@
{
pZones.addResistance(UEqn());
eqnResidual = solve
(
UEqn() == -fvc::grad(p)
). initialResidual();
maxResidual = max(eqnResidual, maxResidual);
solve(UEqn() == -fvc::grad(p));
trAU = 1.0/UEqn().A();
trAU().rename("rAU");
......
// check convergence
if (maxResidual < convergenceCriterion)
{
Info<< "reached convergence criterion: " << convergenceCriterion << endl;
runTime.writeAndEnd();
Info<< "latestTime = " << runTime.timeName() << endl;
}
......@@ -13,8 +13,7 @@
hEqn.relax();
eqnResidual = hEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
hEqn.solve();
thermo.correct();
}
// initialize values for convergence checks
scalar eqnResidual = 1, maxResidual = 0;
scalar convergenceCriterion = 0;
simple.readIfPresent("convergence", convergenceCriterion);
......@@ -29,8 +29,7 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
// retain the residual from the first iteration
if (nonOrth == 0)
{
eqnResidual = tpEqn().solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
tpEqn().solve();
}
else
{
......
......@@ -54,7 +54,6 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
#include "initConvergenceCheck.H"
p.storePrevIter();
rho.storePrevIter();
......@@ -72,8 +71,6 @@ int main(int argc, char *argv[])
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
#include "convergenceCheck.H"
}
Info<< "End\n" << endl;
......
......@@ -8,9 +8,4 @@
UEqn().relax();
eqnResidual = solve
(
UEqn() == -fvc::grad(p)
).initialResidual();
maxResidual = max(eqnResidual, maxResidual);
solve(UEqn() == -fvc::grad(p));
// check convergence
if (maxResidual < convergenceCriterion)
{
Info<< "reached convergence criterion: " << convergenceCriterion << endl;
runTime.writeAndEnd();
Info<< "latestTime = " << runTime.timeName() << endl;
}
......@@ -11,8 +11,7 @@
hEqn.relax();
eqnResidual = hEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
hEqn.solve();
thermo.correct();
}
// initialize values for convergence checks
scalar eqnResidual = 1, maxResidual = 0;
scalar convergenceCriterion = 0;
simple.readIfPresent("convergence", convergenceCriterion);
......@@ -33,8 +33,7 @@ if (transonic)
// Retain the residual from the first iteration
if (nonOrth == 0)
{
eqnResidual = pEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
pEqn.solve();
}
else
{
......@@ -64,8 +63,7 @@ else
// Retain the residual from the first iteration
if (nonOrth == 0)
{
eqnResidual = pEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
pEqn.solve();
}
else
{
......
......@@ -53,7 +53,6 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
#include "initConvergenceCheck.H"
p.storePrevIter();
rho.storePrevIter();
......@@ -72,8 +71,6 @@ int main(int argc, char *argv[])
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
#include "convergenceCheck.H"
}
Info<< "End\n" << endl;
......
......@@ -8,9 +8,4 @@
UEqn().relax();
eqnResidual = solve
(
UEqn() == -fvc::grad(p)
).initialResidual();
maxResidual = max(eqnResidual, maxResidual);
solve(UEqn() == -fvc::grad(p));
......@@ -11,8 +11,7 @@
hEqn.relax();
eqnResidual = hEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
hEqn.solve();
thermo.correct();
......
......@@ -41,8 +41,7 @@ if (transonic)
// Retain the residual from the first iteration
if (nonOrth == 0)
{
eqnResidual = pEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
pEqn.solve();
}
else
{
......@@ -75,8 +74,7 @@ else
// Retain the residual from the first iteration
if (nonOrth == 0)
{
eqnResidual = pEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
pEqn.solve();
}
else
{
......
......@@ -55,7 +55,6 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
#include "initConvergenceCheck.H"
p.storePrevIter();
......@@ -78,8 +77,6 @@ int main(int argc, char *argv[])
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
#include "convergenceCheck.H"
}
Info<< "End\n" << endl;
......
......@@ -14,8 +14,7 @@
TEqn.relax();
eqnResidual = TEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
TEqn.solve();
rhok = 1.0 - beta*(T - TRef);
}
......@@ -8,7 +8,7 @@
UEqn().relax();
eqnResidual = solve
solve
(
UEqn()
==
......@@ -19,6 +19,4 @@
- fvc::snGrad(p)*mesh.magSf()
)
)
).initialResidual();
maxResidual = max(eqnResidual, maxResidual);
);
......@@ -69,7 +69,6 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
#include "initConvergenceCheck.H"
p.storePrevIter();
......@@ -87,8 +86,6 @@ int main(int argc, char *argv[])
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
#include "convergenceCheck.H"
}
Info<< "End\n" << endl;
......
// check convergence
if (maxResidual < convergenceCriterion)
{
Info<< "reached convergence criterion: " << convergenceCriterion << endl;
runTime.writeAndEnd();
Info<< "latestTime = " << runTime.timeName() << endl;
}
Markdown is supported
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