ENH: Updated tutorials

This commit is contained in:
andy
2011-04-15 16:46:35 +01:00
parent 717db62583
commit 154761a3a1
55 changed files with 369 additions and 314 deletions

View File

@ -26,8 +26,7 @@ solvers
hFinal
{
solver PCG;
preconditioner DIC;
$h;
tolerance 1e-8;
relTol 0;
}
@ -37,11 +36,18 @@ solvers
solver PBiCG;
preconditioner DILU;
tolerance 1e-6;
relTol 0.1;
}
hUFinal
{
$hU;
tolerance 1e-6;
relTol 0;
}
}
PISO
PIMPLE
{
nOuterCorrectors 3;
nCorrectors 1;

View File

@ -47,21 +47,6 @@ runTimeModifiable true;
functions
{
convergenceChecks
{
type residualControl;
functionObjectLibs ("libjobControl.so");
outputControl timeStep;
outputInterval 1;
maxResiduals
{
p 1e-2;
U 1e-3;
"(k|epsilon|omega)" 1e-3;
}
}
streamLines
{
type streamLine;

View File

@ -69,6 +69,13 @@ solvers
SIMPLE
{
nNonOrthogonalCorrectors 0;
residualControl
{
p 1e-2;
U 1e-3;
"(k|epsilon|omega)" 1e-3;
}
}
relaxationFactors

View File

@ -47,21 +47,6 @@ runTimeModifiable true;
functions
{
convergenceChecks
{
type residualControl;
functionObjectLibs ("libjobControl.so");
outputControl timeStep;
outputInterval 1;
maxResiduals
{
p 1e-2;
U 1e-3;
"(k|epsilon|omega)" 1e-3;
}
}
streamLines
{
type streamLine;

View File

@ -69,6 +69,13 @@ solvers
SIMPLE
{
nNonOrthogonalCorrectors 0;
residualControl
{
p 1e-2;
U 1e-3;
"(k|epsilon|omega)" 1e-3;
}
}
relaxationFactors

View File

@ -11,9 +11,4 @@
// Add resistance on the actuation disks
actuationDisks.addSu(UEqn());
eqnResidual = solve
(
UEqn() == -fvc::grad(p)
).initialResidual();
maxResidual = max(eqnResidual, maxResidual);
solve(UEqn() == -fvc::grad(p));

View File

@ -1,5 +0,0 @@
// initialize values for convergence checks
scalar eqnResidual = 1, maxResidual = 0;
scalar convergenceCriterion = 0;
simple.readIfPresent("convergence", convergenceCriterion);

View File

@ -7,7 +7,7 @@
adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -15,23 +15,15 @@
);
pEqn.setReference(pRefCell, pRefValue);
// retain the residual from the first iteration
if (nonOrth == 0)
{
pEqn.solve();
}
else
{
pEqn.solve();
}
pEqn.solve();
if (nonOrth == nNonOrthCorr)
if (nonOrth == simple.nNonOrthCorr())
{
phi -= pEqn.flux();
}
}
# include "continuityErrs.H"
#include "continuityErrs.H"
// Explicitly relax pressure for momentum corrector
p.relax();

View File

@ -34,6 +34,7 @@ Description
#include "singlePhaseTransportModel.H"
#include "RASModel.H"
#include "IObasicSourceList.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,17 +46,16 @@ int main(int argc, char *argv[])
#include "createFields.H"
#include "initContinuityErrs.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
while (simple.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
#include "initConvergenceCheck.H"
p.storePrevIter();
// Pressure-velocity SIMPLE corrector
@ -71,9 +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;