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

Define_profile udf not work correctly?!

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By ghost82

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   December 15, 2014, 03:08
Default Define_profile udf not work correctly?!
  #1
Member
 
Nick
Join Date: Feb 2012
Posts: 33
Rep Power: 14
valahian1 is on a distinguished road
Hello everyone!
I have compiled an UDF for FLUENT 15.0 to test a velocity parabolic profile for inlet. But the DEFINE_PROFILE macro does not seem to work right. It takes the coordinates from the last face of the thread and it gives them to the second face (face no. 1). So, the velocity vector of the last face is always bigger that the vector before. Here is the code:

#include "udf.h"
DEFINE_PROFILE(inlet_velocity,t,i)
{
real x[ND_ND];
real a;
face_t f;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
a = f;
F_PROFILE(f,t,i) = 15.5-(a-5)*(a-5)/2;
printf("face no= %d\n", f);
printf("x= %f\n", x[0]);
printf("y= %f\n", x[1]);
}
end_f_loop(f,t)
}

And here is a part of the results:

face no= 0
x= 0.010000
y= 0.010500
face no= 1
x= 0.010000
y= 0.019500
face no= 2
x= 0.010000
y= 0.011500
face no= 3
x= 0.010000
y= 0.012500
...


The inlet starts at x=0.01; y=0.01 and stops at x=0.01; y=0.02 and has 10 faces.
I done something wrong? Or there is something wrong inside macro?
Thank you!
valahian1 is offline   Reply With Quote

 

Tags
define_profile, fluent, macro, udf


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
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 07:37
udf doesn't work blaid FLUENT 0 March 6, 2012 12:29
the udf has been hooked to the fluent successfully,but it does not work! hugeforest Fluent UDF and Scheme Programming 1 July 8, 2011 04:31
Timestep UDF not work peaker007 Fluent UDF and Scheme Programming 0 April 28, 2011 12:10
UDF for wall slipping HFLUENT Fluent UDF and Scheme Programming 0 April 27, 2011 12:03


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