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

Floating Point Error

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 1, 2008, 17:00
Default Floating Point Error
  #1
Nuno
Guest
 
Posts: n/a
Hi folks. Im trying to apply a x-velocity profile and a x-momentum source. So i made a file when i put the profile and the source code. When Fluent iterate it given an error: Error: Floatng point erro: invalid number How I can fix that? Thanks for all help

#include "udf.h" /* must be at the beginning of every UDF you write */

#define C2 0.2 #define a 2.0

DEFINE_PROFILE(x_velocity,thread,index) { real x[ND_ND]; /* this will hold the position vector */ real y; face_t f;

begin_f_loop(f,thread) /* loops over all faces in the thread passed

in the DEFINE macro argument */

{

F_CENTROID(x,f,thread);

y = x[1];

F_PROFILE(f,thread,index) = 1.5*pow(y/42,0.14);

} end_f_loop(f,thread) }

DEFINE_SOURCE(xmom_source, c, t, dS, eqn) { real x[ND_ND]; real con, source; C_CENTROID(x, c, t);

con = C2*a*0.5*C_R(c, t)*x[1]; source = -con*sqrt(C_U(c, t)*C_U(c, t)+C_V(c, t)+C_V(c, t))*C_U(c, t); dS[eqn] = -2.*con*sqrt(C_U(c, t)*C_U(c, t)+C_V(c, t)+C_V(c, t));

return source; }

  Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
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 07:57
Floating point error - help sk FLUENT 2 December 17, 2008 10:32
Floating point error Chico Mbanu FLUENT 0 July 14, 2004 13:56
floating point error Mavinakere FLUENT 3 March 1, 2002 17:22
floating point error sivakuamr Main CFD Forum 12 August 31, 2001 01:37


All times are GMT -4. The time now is 06:13.