CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF to extract the velocity

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

LinkBack Thread Tools Display Modes
Old   October 16, 2015, 00:22
Default UDF to extract the velocity
Join Date: Jul 2014
Location: Australia
Posts: 36
Rep Power: 5
siamak1438 is on a distinguished road
Hello Guys,
I need to define a plane in the middle of the geometry (3D) and then extract the velocity of each node in that plane.The Id of that plane is 6, so I wrote the following UDF abut it is not working. Which part do you think is not correct?

#include "udf.h"
#include "mem.h"
#define thread_ID 6

Domain *domain;
Thread *t;
cell_t c;

FILE *Fileoutput;
int n,Iter;

domain = Get_Domain(1);
t = Lookup_Thread(domain, thread_ID);

begin_c_loop(c, t)

fprintf(Fileoutput,"\n %f %f %f", C_U(c,t), C_V(c,t), C_W(c,t));

end_c_loop(c, t)


siamak1438 is offline   Reply With Quote

Old   October 17, 2015, 00:32
Senior Member
Join Date: Mar 2015
Posts: 800
Rep Power: 11
`e` is on a distinguished road
Are you receiving any compiler errors, is the text file being opened and is any text being written to this file?

Try printing the velocities to the screen (using the Message() function inside your cell loop) to help debug your problem.
`e` is offline   Reply With Quote

Old   October 19, 2015, 07:32
Senior Member
Join Date: Nov 2013
Posts: 1,197
Rep Power: 15
pakk will become famous soon enough
but it is not working
Be more specific.

Do you have problems with compiling? Interpreting? Loading? Running? Getting results? Showing results?
pakk 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
UDF inlet velocity profile mismatch with Fluent ChristineL Fluent UDF and Scheme Programming 15 November 25, 2016 07:45
UDF for Inlet velocity Mijin Kim FLUENT 0 September 28, 2009 04:50
Extract velocity field in certain time step to MATLAB spatialtime CFX 3 September 9, 2009 18:30
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 09:11
UDF component in Cyliderical Velocity? Hongchan Kim FLUENT 3 April 24, 2001 12:20

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