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

whats wrong with this udf ?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 14, 2015, 06:48
Default whats wrong with this udf ?
  #1
Member
 
hani mortezaee
Join Date: Sep 2014
Posts: 30
Rep Power: 12
h.mortezaee is on a distinguished road
hi there
im new to udf , im trying to learn how to use define source ? when i Intereprete this udf fluent exits with an error, i was wondering what is causing this?

#include "udf.h"
#include "math.h"
DEFINE_SOURCE(energy_source,c,t,dS,eqn)
{
real x[ND_ND];
real con, source;
C_CENTROID(x,c,t);
con = 50*exp(1/((x[1]*x[1])*(x[2]*x[2])));
source = con;
dS[eqn] = 0;
return source;
}
h.mortezaee is offline   Reply With Quote

Old   September 14, 2015, 08:02
Default
  #2
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
which error appears? did you try to compile instead of interpret it?
Bruno Machado is offline   Reply With Quote

Old   September 14, 2015, 08:16
Default
  #3
Member
 
hani mortezaee
Join Date: Sep 2014
Posts: 30
Rep Power: 12
h.mortezaee is on a distinguished road
no i didn't compile it, but i think this is because of the math.h header , any comment on that ?
btw fluent shuts down rapidly so i cant catch the error
h.mortezaee is offline   Reply With Quote

Old   September 14, 2015, 08:32
Default
  #4
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
there is no need to include math.h since it is included already by the udf.h
Bruno Machado 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
something wrong when compiling udf, however the code is correct when interpreting richard ben Fluent UDF and Scheme Programming 7 May 11, 2013 08:36
Help me to check my UDF Liufeng_ustb Fluent UDF and Scheme Programming 2 May 7, 2013 11:25
parse error while interpreting udf Kristin Fluent UDF and Scheme Programming 3 March 15, 2012 07:43
what's wrong with the UDF major FLUENT 6 March 3, 2005 07:39
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 14:04.