Interrupting the fluent simulation when field variable exceeds any user-defined limit
Sometimes a particular flow variable (Pressure, velocity, temperature etc) diverges and leaves behind unreasonable results
which are of little use. In many such cases, it helps to automatically stop/interrupt the simulations when these flow variables
exceed some reasonable limits.
The resolution is a combination of small UDF and scheme file. The UDF will loop over the cells
and will switch the flag on when any user-defined limit is exceeded. Following is a case where
we don't expect the temperature to exceed 1000K.
int x = 0;
and the SCHEME :
(rp-var-define 'interrupt/flag 0 'integer 1)
(if (> (%rp-var-value 'interrupt/flag) 0)
The procedure is:
1)The user has to read in the case/data files, the scheme and the UDF.
2) "interrupt_fcn" hooked for the Adjust Function and
3) "(interrupt)" entered in the Solve-Execute Commands panel.
After the above steps, once the fluent simulations is started, the scheme file
will interrupt the simulation if the temperature exceeds 1000K. The results can
then give useful pointers/reasons for the imminent divergence.
Note that the above procedure works for both serial and parallel simulation.