CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

Floating point error: Invalid number

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   March 22, 2010, 05:54
Default Floating point error: Invalid number
  #1
psb
New Member
 
PSB
Join Date: Nov 2009
Posts: 5
Rep Power: 8
psb is on a distinguished road
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.
psb is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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 and samplesurface touf Open Source Meshers: Gmsh, Netgen, CGNS, ... 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 12, 2001 23:19


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