Reaction rate coefficient caused problem

Hey guys,

I’m trying to simulate a TFM that has really fast reaction, which absorbs most of the CO2 in the air as soon as air flows into the fluidized bed. usr_rates.f (2.4 KB) td_jelly_roll.mfx (25.9 KB)

When I increased the reaction rate coefficient to 100 (line 69 of usr_rates.f ), it gave me an error:

ERROR time_step.f:193
DT < DT_MIN. Recovery not possible!

However, it did not happen when I had lower reaction rate coefficient (at 1 or 10). Does anyone know what is causing the error?

My guess is that my reaction rate function doesn’t involve the solid concentration, so when the solid reactant is used up in the cell, MFiX finds the solid concentration to be negative, which caused problem. Can someone confirm if that was correct?

If that’s the case, how can I fix it? I tried modifying line 70 of usr_rates.f to be
IF(X_s(IJK,ML) > c_Limiter) then
RATES(Reaction_1) = 100*c_CO2
ELSE
RATES(Reaction_1) = 0
ENDIF

But the build failed with the following error.

C:\Users\Administrator\td_jelly_roll\usr_rates.f:70:7:
IF(X_s(IJK,ML) > c_Limiter) then
1
Error: Rank mismatch in array reference at (1) (2/3)
CMakeFiles\udfs.dir\build.make:86: recipe for target ‘CMakeFiles/udfs.dir/C_/Users/Administrator/td_jelly_roll/usr_rates.f.obj’ failed
mingw32-make.exe[2]: *** [CMakeFiles/udfs.dir/C_/Users/Administrator/td_jelly_roll/usr_rates.f.obj] Error 1
CMakeFiles\Makefile2:117: recipe for target ‘CMakeFiles/udfs.dir/all’ failed
Makefile:148: recipe for target ‘all’ failed

                  BUILD FAILED 

==============================================================
mingw32-make.exe[1]: *** [CMakeFiles/

Any input is appreciated! Thanks a lot!

Jack

Jack - you can try increasing min_dt, in the Run pane. The keyword browser will help you find controls corresponding to keywords, if you don’t know where they are.

Regarding your UDF, what the compiler is trying to tell you by “Rank Mismatch” is that you are indexing the X_s array incorrectly. It requires 3 indices:

$ grep -riw x_s|grep -i double
fldvar_mod.f:      DOUBLE PRECISION, DIMENSION(:, :, :), ALLOCATABLE ::  X_s

The indices are cell (IJK), phase, and species within the phase.

Hope this helps,
– Charles

Thanks a lot Charles! Yeah I decreased the dt_min to 1e-8 and revised my X_s as you suggested. I think it’s running without problem now. Thank you for your help!

Jack