mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Updated tutorials
This commit is contained in:
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -69,6 +69,13 @@ solvers
|
||||
SIMPLE
|
||||
{
|
||||
nNonOrthogonalCorrectors 0;
|
||||
|
||||
residualControl
|
||||
{
|
||||
p 1e-2;
|
||||
U 1e-3;
|
||||
"(k|epsilon|omega)" 1e-3;
|
||||
}
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -69,6 +69,13 @@ solvers
|
||||
SIMPLE
|
||||
{
|
||||
nNonOrthogonalCorrectors 0;
|
||||
|
||||
residualControl
|
||||
{
|
||||
p 1e-2;
|
||||
U 1e-3;
|
||||
"(k|epsilon|omega)" 1e-3;
|
||||
}
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
|
||||
@ -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));
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
// initialize values for convergence checks
|
||||
scalar eqnResidual = 1, maxResidual = 0;
|
||||
scalar convergenceCriterion = 0;
|
||||
|
||||
simple.readIfPresent("convergence", convergenceCriterion);
|
||||
@ -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();
|
||||
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user