|
[Sponsors] |
April 13, 2013, 06:01 |
zero divide
|
#1 |
New Member
DongGunKo
Join Date: Apr 2013
Posts: 13
Rep Power: 13 |
in UDF
i code like below RET(ILOC,1)=d*DEXP(exvar) 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 RET(ILOC,1)=DSQRT(exvar) it also shows same error, so i changed exvar = kb/c RET(ILOC,1)=1/DSQRT(exvar) and it works. but DEXP is not the case. i cannot change that how can i get result? |
|
April 15, 2013, 05:08 |
|
#2 |
Senior Member
Mr CFD
Join Date: Jun 2012
Location: Britain
Posts: 361
Rep Power: 14 |
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. |
|
Tags |
fortran code, udf and programming, zero divide |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to normalize velocities? must we divide by kinematic viscosity or diffusivity ? | lbmagis | FLUENT | 1 | March 11, 2013 14:27 |
divide error despite of being everything in comment | immortality | OpenFOAM Running, Solving & CFD | 4 | February 17, 2013 07:10 |
How to divide all entries in 0/p by rho | lentschi | OpenFOAM | 1 | March 16, 2011 13:42 |
how to divide domain? | manish | Phoenics | 0 | May 10, 2006 02:25 |
Floating point error: divide by zero | Chris | FLUENT | 2 | April 15, 2005 02:33 |