Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation

Hi, here is my case. It is based on fluid_bed_2d(2D DEM fluid bed with a central jet), which can be found in GUI Menu-new project.
fluid_bed_dem_2d_2021_3_26.zip (23.2 MB)

This case has two modifications as follows:
1.To store particle y-velocity in cell, des_granular_temperature.f is modified according to jmusser’s advise Write user-defined scalar into .res file for postprocess and Jay’s blog mfix中输出DEM颗粒的固相速度到网格 - JayYin - 博客园. I directly modified the source code, so des_granular_temperature.f is not in the zip.
des_granular_temperature.f (10.4 KB)
What’s more, usr0_des.f located at /legacy_tests/dem-tests/homogeneous-cooling-system/usr0_des.f is used according to beidou111’s blog MFiX利用ReactionRates数组把颗粒变量存储到网格上_beidou111的博客-CSDN博客.
Until now, everything is fine.
2.Then I try to calculate the energy transfer rate.
image
Based on step 1, I further modified usr0_des.f as fellow. Note that the following usr0_des2021325.f and usr0_des.f in the compressed file only have different names
usr0_des2021325.f (8.5 KB)

There is no problem compiling, but when running mfix, no matter in win10, CentOS, serial or parallel, errors are reported.

Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

Backtrace for this error:
** Something went wrong while running addr2line. **
** Falling back to a simpler backtrace scheme. **
#22 0x7f4f5dbf92d2
#23 0x7f4f5dbf9a0e
#24 0x7f4fb15ea26f
#25 0x7f4f5e427f66
#26 0x7f4f5e2ee554
#27 0x7f4f5e49b199
#28 0x7f4f5e2ee7a4
#29 0x7f4f5e2e1b56
#30 0x5575654bfc9a
#31 0x55756552527d
#32 0x5575654b7e2a
#33 0x5575655206ef
#34 0x5575654b7e2a
#35 0x5575655206ef
#36 0x557565468d2a
#37 0x5575654877a2
#38 0x55756547a3ad
#39 0x557565578c16
#40 0x557565533667
#41 0x7f4fb197fe24
#42 0x7f4fb16ad34c
#43 0xffffffffffffffff
** MFiX (20.4.3 ) simulation on host: node01**
** Run name: FLUID_BED_DEM_2D Time: 21:25 Date: 3-25-2021**
** Project version: 27**
** Memory required: 9.00 Mb**

INFO open_files.f:374
The following mesh file was not found: FLUID_BED_DEM_2D.msh
Mesh generation will be performed and a mesh file will be saved.

The following mesh file was successfully opened: FLUID_BED_DEM_2D.msh

INFO check_data/check_solids_dem.f:712
At time = 0.000000E+00 sec., setting DEM solids time step, DTSOLID (sec) = 0.133715E-04

INFO check_data/check_geometry.f:192
DES grid size:
DESGRIDSEARCH_IMAX = 15
DESGRIDSEARCH_JMAX = 75
DESGRIDSEARCH_KMAX = 1

WARNING check_data/check_boundary_conditions.f:151
Warning 1201: Mass inflow BC# 1
Cannot apply both mi and po to des. Turning off bc_po_apply_to_des.

WARNING check_data/check_boundary_conditions.f:180
Warning 1202: Pressure or Mass outflow BC# 2
Cannot apply both mi and po to des. Turning off bc_mi_apply_to_des.

DES MPI send/recv buffer: 1.1 MB
** o 8192. Ghost Particles/MB**
** o 4228. Particles/MB**
** o 11916. Neighbor Pairs/MB**
Pre-Processing geometry for DES.
DES geometry pre-processing complete.
** MESH STATISTICS:**
** NUMBER OF CELLS = 675**
** NUMBER OF STANDARD CELLS = 675 (100.00 % of Total)**
** NUMBER OF CUT CELLS = 0 ( 0.00 % of Total)**
** NUMBER OF FLUID CELLS = 675 (100.00 % of Total)**
** NUMBER OF BLOCKED CELLS = 0 ( 0.00 % of Total)**
** WRITING VTU FILE : FLUID_BED_DEM_2D_MESH.vtu .**
… DONE.
** WROTE BOUNDARY IN VTK FILE : FLUID_BED_DEM_2D_boundary.vtk**
** PRE_PROCESSING COMPLETE. **
Initial DES Particle array size: 2400
** next_reca = 513**
** 0 1**
** next_reca = 514**

INFO set_bc0.f:563
Outflow PC defined: IJK_P_g remaining undefined.

INFO des/read_particle_input.f:100
Reading DEM particle input file version: 2.0

WARNING des/read_particle_input.f:316
Error 1201: Error reported when reading particle input file.
End-of-File found for particle 1501 and 2400 entries are expected.

ERROR des/read_particle_input.f:329

** Fatal error reported on one or more processes. The .LOG file**
** may contain additional information about the failure.**
Reading mesh stats: /home/a/mfix/sample/fluid_bed_dem_2d_2021_3_25/MESH_STATS.LOG
Reading mesh boundary: /home/a/mfix/sample/fluid_bed_dem_2d_2021_3_25/FLUID_BED_DEM_2D_boundary.vtk
/home/a/mfix/sample/fluid_bed_dem_2d_2021_3_25/mfixsolver: 行 3: 114176 浮点数例外 (吐核)env PYTHONPATH="/home/a/mfix/sample/fluid_bed_dem_2d_2021_3_25":"":${PYTHONPATH:+:$PYTHONPATH} /home/a/.conda/envs/mfix-20.4.3/bin/python3.7 -m mfixgui.pymfix "$@"
**Previous MFiX run is resumable. Reset job to edit model **
MFiX process has stopped

浮点数例外 means Floating-point exception. I think usr0_des.f has some problem. Some users have discussed similar problem in forum, they considered this problem may be caused by dividing by 0. I have written “if(ep_s(IJK,N) .GT. ZERO)” in line 232, but the error still exist.

Is there anyone checking my case? Any suggestions would be appreciated.

Best regards
xjwuyuhao

1 Like

You have a number of things going on, so if I were you, I would start here:

This is saying that the MFIX solver was only able to successfully read in 1501 particles even though you told it you have 2400 particles. You may want to play with your particle_input.dat file to narrow down why this is happening. Make sure you are completely consistent in your use of white space throughout the particle_input.dat file.

Hi, actually if I UNCHECK “Enable user-defined subroutines”, the particle_input.dat file can be read normally by MFiX. So I think my usr0_des.f goes wrong, rather than particle_input.dat.

Hi julia.hartig. The problem has been solved. I modified two places:

1.Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation
For ep_s(IJK,M), M means phase number. But I input particle number before.
2.ERROR des/read_particle_input.f:329
Because I check “user scalar tracking” in GUI, the beginning of particle_input.dat file should be modified like this:
image

Then everything is fine.

1 Like

Nicely done!

I’ve found most of my floating point errors come from the solver reading or interpreting my input files differently than how I intended, rather than an actual error in the solver itself. That, or compiler compatibility issues.

2 posts were split to a new topic: FPE at calc_resid.f:982