Float overflow at des/cfnewvalues.f:539 running SQP simulation

Dear Experts!
During DEM-SQP simulation, after 155 sec the following error prompt. But I can’t figure it out.
Need insight to solve it.

image
sqp.mfx (11.4 KB)

Please try to use the Hertzian collision model instead of the Linear spring dashpot. You will need to run this simulation in parallel (dmp), otherwise it will be too slow on a single core.

  1. Please use a more descriptive topic title so that other users may search the forum for answers. Instead of “MFiX Solver crashed” something like “Float overflow in DEM-SQP case” (I modified the topic title already)

  2. As we have been learning (see the SQP Megathread), the superquadric code tends to produce extremely large numeric values, often leading to overflows. This, I believe, is largely due to “overshoots” in the Newton-Raphson successive-approximation scheme used to detect particle-particle and particle-wall contact.

In general MFiX tries to catch all FPEs (floating-point exceptions: zero divisions, overflows, and invalid operations like sqrt of negative values) because these are most often due to coding errors, especially with UDF code. However, it may be that the Superquadric code is one place where we are better off allowing numeric overflows to return Inf (IEEE-defined special value) rather than triggering an FPE. We will address this in the next MFiX release, either by adding user controls to turn on/off FPE checks (potentially masking other errors) or just automatically disabling the checks in the SQP force calculations.

In the meanwhile, you can turn overflow checks off yourself:

  1. Activate the MFiX environment
    $ conda activate mfix-23.1

  2. Locate the file gfortran_init.c
    $ cd $CONDA_PREFIX/share/mfix/src/model
    or on Windows
    C:> cd %CONDA_PREFIX%\share\mfix\src\model

Using the editor of your choice, open the file gfortran_init.c
$ nano gfortran_init.c

  1. Comment out line 12:
//   _gfortran_set_fpe(13)
  1. Rebuild the solver and try again.

Note that copying this file to the project directory WILL NOT work, due to the fact that the source-file-override feature only looks for Fortran files, not C. (Will also fix this in the next release). If you edit the “master copy” of gfortran_init.c this will affect not just this case but any other custom solvers you build with that line commented out. (This is not necessarily a problem, just something to be aware of.)

1 Like