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

UDF to extract the velocity

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 16, 2015, 00:22
Default UDF to extract the velocity
  #1
Member
 
Siamak
Join Date: Jul 2014
Location: Australia
Posts: 31
Rep Power: 3
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, 00:32
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 540
Rep Power: 6
`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
Default
  #3
Senior Member
 
Join Date: Nov 2013
Posts: 769
Rep Power: 11
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

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 10 June 24, 2013 06:10
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 03:41.