CFD Online Discussion Forums

CFD Online Discussion Forums (
-   CFX (
-   -   zero divide (

D.ko April 13, 2013 06:01

zero divide
in UDF
i code like below

and exvar = c/kb (d is very small value)
kb is boltzman constant so it has very small value and c is constant
when i apply this UDF in cfx, solver shows error message that Zero divide . But it is not zero.
i annouced exvar and kb as double precision

when i made
it also shows same error, so i changed
exvar = kb/c
and it works.
but DEXP is not the case. i cannot change that
how can i get result?

JuPa April 15, 2013 05:08

Sounds like rounding error. Try double precision and your problem may go away.

HOWEVER read about what double precision is, and what it means when you switch it on.

All times are GMT -4. The time now is 20:38.