DES_RATES Run Problem (Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.)

,

I am trying to learn chemistry module for PIC. (Also, i will use on my researches)

I investigated silane_prolysis, spouted bed combustor tutorials and C3M export files. This MFiX file is just for learning setup.

When i run without usr_rates_des.f , chemistry are solved with gas. But that error occur when I add usr_rates_des.

Are there anyone check my user defined functions?

Nit     P0        U0        V0     Max res
1   1.0E+01    0.        0.        P0
2    3.       7.7E-02   0.2        P0
3   1.3E-04   4.1E-02   0.1        V0
4   3.1E-05   2.2E-02   5.7E-02    V0

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

Backtrace for this error:
5 1.6E-05 1.1E-02 2.9E-02 V0
6 7.8E-06 5.6E-03 1.5E-02 V0
7 3.9E-06 2.8E-03 7.4E-03 V0
8 1.9E-06 1.4E-03 3.7E-03 V0
9 9.7E-07 7.0E-04 1.9E-03 V0
10 4.8E-07 3.5E-04 9.3E-04 V0
11 2.4E-07 1.8E-04 4.7E-04 V0
t= 0.0000 Dt= 0.1000E-06 NIT= 11 Sm= 0.0000 Hl= 0.0000 CPU= 1. s
MbError%(0,MMAX): -0.8352E-14
#0 0x7f5b9ce3fd01 in ???
#1 0x7f5b9ce3eed5 in ???
#2 0x7f5bea33420f in ???
#3 0x7f5b9d54d1ac in usr_rates_des_
at /home/akececi/mfix/silane_pyrolysis_pic_3d_020121/usr_rates_des.f:317
#4 0x7f5b9d8b1db4 in __calc_rrates_des_mod_MOD_calc_rrates_des
at /home/akececi/anaconda3/envs/mfix-20.4.2/share/mfix/src/model/des/calc_rrates_des.f:110
#5 0x7f5b9d6a066a in __rxns_gs_des1_mod_MOD_rxns_gs_gas1
at /home/akececi/anaconda3/envs/mfix-20.4.2/share/mfix/src/model/des/rxns_gs_des1.f:191
#6 0x7f5b9d7b974c in _step_MOD_chem_mass
at /home/akececi/anaconda3/envs/mfix-20.4.2/share/mfix/src/model/time_step.f:212
#7 0x7f5b9d706d85 in run_fluid
at /home/akececi/anaconda3/envs/mfix-20.4.2/share/mfix/src/model/mfix.f:202
#8 0x7f5b9d706d85 in run_mfix

at /home/akececi/anaconda3/envs/mfix-20.4.2/share/mfix/src/model/mfix.f:142
#9 0x7f5b9d549122 in __main_MOD_run_mfix0
at /home/akececi/mfix/silane_pyrolysis_pic_3d_020121/build/pymfix/main.f90:82
#10 0x7f5b9d53c8d6 in f2py_rout_mfixsolver_main_run_mfix0
at /home/akececi/mfix/silane_pyrolysis_pic_3d_020121/build/f2pywrappers/mfixsolvermodule.c:1270
#11 0x557983976cca in _PyObject_FastCallKeywords
at /tmp/build/80754af9/python_1598874792229/work/Objects/call.c:199
#12 0x5579839dc39d in call_function
at /tmp/build/80754af9/python_1598874792229/work/Python/ceval.c:4619
#13 0x5579839dc39d in _PyEval_EvalFrameDefault
at /tmp/build/80754af9/python_1598874792229/work/Python/ceval.c:3093
#14 0x55798396ee7a in function_code_fastcall
at /tmp/build/80754af9/python_1598874792229/work/Objects/call.c:283
#15 0x55798396ee7a in _PyFunction_FastCallKeywords
at /tmp/build/80754af9/python_1598874792229/work/Objects/call.c:408
#16 0x5579839d773f in call_function
at /tmp/build/80754af9/python_1598874792229/work/Python/ceval.c:4616
#17 0x5579839d773f in _PyEval_EvalFrameDefault
at /tmp/build/80754af9/python_1598874792229/work/Python/ceval.c:3110
#18 0x55798396ee7a in function_code_fastcall
at /tmp/build/80754af9/python_1598874792229/work/Objects/call.c:283
#19 0x55798396ee7a in _PyFunction_FastCallKeywords
at /tmp/build/80754af9/python_1598874792229/work/Objects/call.c:408
#20 0x5579839d773f in call_function
at /tmp/build/80754af9/python_1598874792229/work/Python/ceval.c:4616
#21 0x5579839d773f in _PyEval_EvalFrameDefault
at /tmp/build/80754af9/python_1598874792229/work/Python/ceval.c:3110
#22 0x55798391f85a in function_code_fastcall
at /tmp/build/80754af9/python_1598874792229/work/Objects/call.c:283
#23 0x55798391f85a in _PyFunction_FastCallDict
at /tmp/build/80754af9/python_1598874792229/work/Objects/call.c:322
#24 0x55798393e4d2 in _PyObject_Call_Prepend
at /tmp/build/80754af9/python_1598874792229/work/Objects/call.c:906
#25 0x557983930ffd in PyObject_Call
at /tmp/build/80754af9/python_1598874792229/work/Objects/call.c:245
#26 0x557983a2ff76 in t_bootstrap
at /tmp/build/80754af9/python_1598874792229/work/Modules/_threadmodule.c:994
#27 0x5579839ea817 in pythread_wrapper
at /tmp/build/80754af9/python_1598874792229/work/Python/thread_pthread.h:174
#28 0x7f5bea4e9608 in start_thread
at /build/glibc-ZN95T4/glibc-2.31/nptl/pthread_create.c:477
#29 0x7f5bea410292 in ???
#30 0xffffffffffffffff in ???
Floating point exception (core dumped)

Primary job terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.


mpirun detected that one or more processes exited with non-zero status, thus causing
the job to be terminated. The first process to do so was:

Process name: [[2141,1],0]
Exit code: 136

Previous MFiX run is resumable. Reset job to edit model
MFiX process has stopped

silane_pyrolysis_pic_3d_2021-02-02T084850.313227.zip (102.8 KB)

Hi Ahmet

Thanks for providing a detailed problem report. The stack trace is long, but the important part is the first 5 or 6 stack frames, once you get below run_mfix and into the PyObject stuff there’s nothing of interest - I should probably hide that part in the output. And the first couple of ??? lines which are junk.

The important line is

 #3 0x7f5b9d54d1ac in usr_rates_des_
at /home/akececi/mfix/silane_pyrolysis_pic_3d_0201/usr_rates_des.f:317

(Those file names should be clickable, and go to the relevant line in the editor … I’ll work on that).

Line 317 in your usr_rates_des.f reads

DES_RATES(moisture_release_1) = 6105.92107819465d0 * ROP_s(IJK,1) * X_s(IJK,1,COALMOISTURE_1) *  rate_limit(X_s(IJK,1,COALMOISTURE_1)) * exp (-10668.847726726d0 / min(T_s(IJK,1), 2500d0))

That’s a long line, I suggest breaking things up a little. But I see that you are dividing:

/ min(T_s(IJK,1), 2500d0)

My immediate suspicion is a zero-division - if T_s reaches zero, there’s nothing there to prevent that, since 0 < 2500

To confirm this you could try to use a debugger to look at the core file, or just use a simple print statement. I added this right before line 317 and it confirmed my suspicion, you are attempting to divide by 0

    write (*,*) "T=", T_s(IJK,1)

prints

    T=   0.0000000000000000 

in the console, right before failing.

We could improve the debugging facilities in MFiX, but this is the general approach I use.

- Charles
2 Likes

Thx for your help @cgw

I changed my moisture_release function regarding dem-tests/evaporation. But I think I have a problem with CGS/SI problem. H2O released from Coal but this H2O doesn’t react with homogenous reactions (When I don’t use heterogeneous reactions, my homogenous reactions occur normally.)

I will study my case again. Your words give me good points.

Btw, If you need advice; I saw a lot of beginners need help with chemical reactions. Maybe you will add new tutorials about UDF-writing for chemistry.

Hi Ahmet. I’m glad I could help.

The MFiX GUI is supposed to make it easier for users to create MFiX simulations. Chemical reactions are one area where there is room for improvement. We have an editor to help create the chemical reactions, making sure they are balanced, etc, but when it’s time to specify the rates the GUI doesn’t offer much help.

We’re discussing ways to make it easier to specify and test reaction rates. This will be added to a future release (no schedule yet for this). And adding some more tutorials for chemistry and UDF is a good idea too.

  • Charles