|
[Sponsors] |
March 22, 2010, 05:54 |
Floating point error: Invalid number
|
#1 |
New Member
PSB
Join Date: Nov 2009
Posts: 5
Rep Power: 16 |
Hello,
I am getting the error 'floating point error :Invalid number' immediately after I click 'iterate' for the following udf: DEFINE_SOURCE(species_sieving, c, t, dS, eqn) { real source, con1, con2; real xf[ND_ND],xc[ND_ND],xd,yd; cell_t c0, c1; Thread *tc0, *tc1, *ft; face_t f; int n; c_face_loop(c,t,n) { f = C_FACE(c,t,n); ft = C_FACE_THREAD(c,t,n); c0 = F_C0(f,ft); tc0= THREAD_T0(ft); c1 = F_C1(f,ft); tc1= THREAD_T1(ft); C_CENTROID(xc,c,t); F_CENTROID(xf,f,ft); xd = xf[0]-xc[0]; yd = xf[1]-xc[1]; C_UDMI(c,t,0)=(C_U(c,t)*C_YI(c,t,0)-C_U(c0,tc0)*C_YI(c0,tc0,0))/xd; C_UDMI(c,t,1)=(C_V(c,t)*C_YI(c,t,0)-C_V(c0,tc0)*C_YI(c0,tc0,0))/yd; C_UDMI(c,t,2)=C_UDMI(c,t,0)+C_UDMI(c,t,1); } con1=0.8660; con2=0.4275e-4; source=con1*C_UDMI(c,t,2)-con2*C_YI(c,t,0); dS[eqn]=0; return source; } Does anyone know how to debug this code? Thank you. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Floating point error | prapanj | OpenFOAM Running, Solving & CFD | 1 | March 12, 2009 08:57 |
Floating point exception: Invalid number | Jinfeng | CFX | 4 | January 11, 2009 17:44 |
[Gmsh] Gmsh and samplesurface | touf | OpenFOAM Meshing & Mesh Conversion | 2 | December 10, 2007 03:27 |
Floating point error | Sohail Ahmed | FLUENT | 0 | March 12, 2004 01:02 |
CFX4.3 -build analysis form | Chie Min | CFX | 5 | July 13, 2001 00:19 |