CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

UDF error

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

LinkBack Thread Tools Display Modes
Old   September 23, 2012, 09:29
Default UDF error...after compilation
New Member
Join Date: Sep 2012
Posts: 28
Rep Power: 7
er.mkumar is on a distinguished road
Hello All,

here is my UDF for source term of scalar eqn.


#define DELTA_S 107.2
#define DELTA_H 28000
#define k_a 75
#define R_u 8.314
#define phi_s 0.35
#define phi_o 0.15
#define phi 0.2
#define PI 3.14159265359

real tp;
real rate;
real P_eq;
real arg;
real hys;

arg = PI*(C_UDSI_M1(c,t,0) - 0.5);
hys = tan (arg);
tp = C_T(c,t);
P_eq = pow(2.72,((DELTA_S/R_u)-(DELTA_H/(R_u*tp))+((phi_s+phi_o)*hys)+(phi/2)))*pow(10,5);
C_UDMI(c,t,3)= P_eq;
rate = k_a*pow(2.72,(-E_a/(R_u*tp)))*((P_i-P_eq)/P_eq)*(1-C_UDSI_M1(c,t,0));
return rate;

This code is compiling and not showing any error BUT as soon as I run it for iterations: the very first message is

"error: floating point error : Invalid no"

Observation: when I didn't incorporated the ' tan(arg) ' part (along with phi_s, phi_o, phi, arg) it will iterate well.

Could anyone please figure what could be the reason as without incorporating these I won't get the correct result.

here is my actual eqn for P_eq as attachment for your refernce.

Thanking in advance.

Last edited by er.mkumar; November 12, 2012 at 04:52.
er.mkumar is offline   Reply With Quote


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
Undeclared Identifier Errof UDF SteveGoat Fluent UDF and Scheme Programming 7 October 15, 2014 07:11
Problem with UDF compiling for kTkLW model Wantami FLUENT 0 July 18, 2011 05:11
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42
Installation OF1.5-dev ttdtud OpenFOAM Installation 46 May 5, 2009 02:32
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50

All times are GMT -4. The time now is 01:52.