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

UDF to extract the velocity

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 16, 2015, 01:22
Default UDF to extract the velocity
  #1
Member
 
Siamak
Join Date: Jul 2014
Location: Australia
Posts: 36
Rep Power: 12
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

DEFINE_ON_DEMAND(INIT)
{
Domain *domain;
Thread *t;
cell_t c;

FILE *Fileoutput;
int n,Iter;

domain = Get_Domain(1);
t = Lookup_Thread(domain, thread_ID);
Fileoutput=fopen("VEL.txt","a+");

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)

fclose(Fileoutput);

}
siamak1438 is offline   Reply With Quote

Old   October 17, 2015, 01:32
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`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, 08:32
Default
  #3
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Quote:
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

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
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 05:50
Extract velocity field in certain time step to MATLAB spatialtime CFX 3 September 9, 2009 19:30
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 10:11
UDF component in Cyliderical Velocity? Hongchan Kim FLUENT 3 April 24, 2001 13:20


All times are GMT -4. The time now is 16:50.