How to solve the problem of float divide by zero?

Hello developer,
When I changed the reaction rate equation from this
微信截图_20231130224623
to that
微信截图_20231130224410
it reported an error.
微信截图_20231130224315
Can you help me check it? Thank you very much!
fluid_bed_tfm_2d_2023-11-30T224330.136394.zip (106.3 KB)

You will divide by zero when the void fraction is one, i.e in cells where there is no solids. You should not be dividing by (1 - ep_g)

Practice “defensive programming”.

To avoid zero-division errors, always check the denominators before you do the division. Instead of

result  = (some complex expresson) / (some other complex expression)

do

num = some complex expression
denom = some other complex expression
if (denom .ne. 0)  then
   result = num / denom
else
   do something else
endif

Same goes for logs, square roots, etc.