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

FLUENT UDF in Intepreting

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 17, 2011, 22:41
Default FLUENT UDF in Intepreting
  #1
NGH
New Member
 
NGH
Join Date: May 2011
Posts: 15
Rep Power: 15
NGH is on a distinguished road
Hi

I have created a vel.c file for parabolic velocity BC at the inlet. The UDF.c is as shown below. During intepreting by the fluent, it has a syntax error at line 2. However, I dont find anything wrong with line 2. Anyone out there see the source of this syntax error, please help thanks

#include "udf.h"
DEFINE_PROFILE (inlet_x_velocity, thread, index) /*line 2*/
{
real x[ND_ND];
real y;
face_t f;

begin_f_loop(f, thread)
{
F_CENTROID(x, f, thread);
y=x[1];
F_PROFILE(f, thread, index) = 0.4*[-0.64*(y/0.1)^6 +3.9*(y/0.1)^5 - 9.2*(y/0.1)^4 m+ 11*(y/0.1)^3 - 6.9*(y/0.1)^2];
}
end_f_loop(f, thread)
}
NGH is offline   Reply With Quote

Old   May 19, 2011, 04:16
Default
  #2
Member
 
alighaffari
Join Date: May 2011
Posts: 31
Rep Power: 15
alighaffari is on a distinguished road
Hi NGH
I have examined your udf it has no problem in line2.But its problem is in line 12. I have solved this problem and it has been interpreted properly:

#include"udf.h"
DEFINE_PROFILE (inlet_x_velocity, thread, index) /*line 2*/
{
real x[ND_ND];
real y;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x, f, thread);
y=x[1];
F_PROFILE(f, thread, index) = 0.4*(-0.64*pow((y/0.1),6) +3.9*pow((y/0.1),5) - 9.2*pow((y/0.1),4)+ 11*pow((y/0.1),3) - 6.9*pow((y/0.1),2));
/*line12*/
}
end_f_loop(f, thread)
}

enjoy
alighaffari is offline   Reply With Quote

Old   May 19, 2011, 04:49
Default
  #3
NGH
New Member
 
NGH
Join Date: May 2011
Posts: 15
Rep Power: 15
NGH is on a distinguished road
Hi alighaffari

Thanks a lot! I will try that again.
NGH is offline   Reply With Quote

Old   July 19, 2011, 06:41
Default problem in UDF on LINUX
  #4
New Member
 
walle
Join Date: Jul 2011
Posts: 10
Rep Power: 15
shilpamkar is on a distinguished road
Hey i have a same problem
the following is the UDF
It runs fine when on windows 7.
however on linux system gives me a syntax error in line 2.
Pls help me out with this.

#include "udf.h"
DEFINE_PROFILE(inlet_x_velocity, thread, nv)
{
real x[3];
real y;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y=x[1];
F_PROFILE(f, thread, nv) = 0.0015*(1-pow(((y-0.005)/0.005),2));
}
end_f_loop(f, thread)
}
shilpamkar 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
fluent udf, saving data in udf mohsen zendehbad Fluent UDF and Scheme Programming 15 June 14, 2017 00:23
Transient pressure UDF for parallel fluent droberts Fluent UDF and Scheme Programming 5 October 11, 2010 05:13
Using Fluent with a UDF frm a remote m/c aarti FLUENT 2 September 11, 2008 20:53
UDF problem caused by various version of Fluent Yurong FLUENT 3 January 15, 2006 11:57
Can somebody send me a Fluent 6 UDF manual?? KKLAU FLUENT 4 April 14, 2004 17:37


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