The open source CFD toolbox
Run-time control

The runTimeControl function object provides a mechanism to terminate and write a calculation based on a set of run-time conditions. The set of run-time conditions comprises:

• average: average value converges to within limits;
• equationInitialResidual: equation initial residual exceeds a value;
• equationMaxIter: equation number of iterations exceeds a value;
• minMax: minimum/maximum exceeds limits;
• minTimeStep: minimum time step exceeds a value.

By default, cases will terminate if any condition is satisfied. Optionally, conditions can be grouped whereby the case will only be terminated if all group member conditions are satisfied.

The optional nWriteStep entry can be used to write all field data each time the conditions are satisfied for a specified number of steps prior to termination.

# Usage

The function object is specified using:

runTimeControl1
{
type            runTimeControl;
libs            ("libutilityFunctionObjects.so");
conditions
{
<list of conditions>
}
}


For example, to stop the calculation if:

• the momentum initial residual exceeds 0.9 (used as a divergence indicator), or
• number of the momentum solver iterations exceeds 100 (used as a divergence indicator), or
• if the average drag coefficient remains within a 0.001 range over a window of 20 steps and the maximum momentum equation residual falls below 1e-4
runTimeControl1
{
type runTimeControl;
libs ("libutilityFunctionObjects.so");
conditions
{
condition0
{
type equationInitialResidual;
fields (U);
value 0.7;
mode maximum;
}
condition1
{
type equationMaxIterCondition;
fields (U);
threshold 100;
}
condition2
{
type average;
functionObject forceCoeffs1;
fields (Cd);
tolerance 1e-3;
window 20;
groupID 1;
}
condition3
{
type equationInitialResidual;
fields (U);
value 1e-04;
mode minimum;
groupID 1;
}
}
}

# Further information

Source code:

 Would you like to suggest an improvement to this page? Create an issue