|
[Sponsors] |
October 16, 2015, 01:22 |
UDF to extract the velocity
|
#1 |
Member
Siamak
Join Date: Jul 2014
Location: Australia
Posts: 36
Rep Power: 12 |
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); } |
|
October 17, 2015, 01:32 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
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. |
|
October 19, 2015, 08:32 |
|
#3 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Quote:
Do you have problems with compiling? Interpreting? Loading? Running? Getting results? Showing results? |
||
|
|
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 |