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

UDF error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 23, 2012, 10:29
Default UDF error...after compilation
  #1
New Member
 
Mukesh
Join Date: Sep 2012
Posts: 28
Rep Power: 14
er.mkumar is on a distinguished road
Hello All,

here is my UDF for source term of scalar eqn.

#include"udf.h"

#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

DEFINE_SOURCE(uds_source,c,t,ds,eqn)
{
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);
C_UDMI(c,t,2)=tp;
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));
C_UDMI(c,t,4)=rate;
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.
----------------
Regards,
Mukesh

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

Reply


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
Undeclared Identifier Errof UDF SteveGoat Fluent UDF and Scheme Programming 7 October 15, 2014 08:11
Problem with UDF compiling for kTkLW model Wantami FLUENT 0 July 18, 2011 06: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 03:32
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 21:50


All times are GMT -4. The time now is 22:19.