|
[Sponsors] |
udf problem.. output data comes out to "zero" |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 11, 2012, 08:06 |
udf problem.. output data comes out to "zero"
|
#1 |
New Member
Jong Hwan Park
Join Date: Oct 2011
Posts: 12
Rep Power: 15 |
Hi Guys~
I am trying to output to a point w-velocity. but, All values are output "0". ---------------------------------------------------------------------- #include "udf.h" #define ID1 5 /*ID of the point*/ DEFINE_EXECUTE_AT_END(monkeymagic) { FILE *fp; Domain *d; real x[ND_ND]; Thread *t; cell_t c; real w=0, time=0; fp = fopen("velocity.txt","w"); d = Get_Domain(4); t = Lookup_Thread (d, ID1); begin_c_loop(c, t) { C_CENTROID(x,c,t); w= (C_W(c,t)); } end_c_loop(c, t) time=CURRENT_TIME; fprintf (fp, "%f\n",time); fprintf (fp, "%f\n",w); fclose(fp); } ---------------------------------------------------------------------- If I fix this problem, Base on this udf source, I will generate 200 points and output velocity.(x, y, z velocity) Plz anyone help me What`s the problem of the source code? |
|
August 13, 2012, 00:07 |
|
#2 | |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 17 |
Is this a multiphase problem? Why use "4" in the "Get_Domain"? Usually it should be d = Get_Domain(1) for a single-phase case.
d = Get_Domain(4); Quote:
|
||
August 13, 2012, 01:17 |
|
#3 |
New Member
Jong Hwan Park
Join Date: Oct 2011
Posts: 12
Rep Power: 15 |
Hi, gearboy
Thanks for your answer! Changed the get domain value 4-> 1 But same results comes out. What is the problem? |
|
August 16, 2012, 00:09 |
|
#4 |
Senior Member
|
If I guess correctly, after
t = Lookup_Thread (d, ID1); t is NULL The following thread should help you with your task. http://www.cfd-online.com/Forums/flu...r-xy-plot.html Last edited by blackmask; August 16, 2012 at 01:43. Reason: additional information |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF compiling problem | Wouter | Fluent UDF and Scheme Programming | 6 | June 6, 2012 05:43 |
DPM Output Problem (Again...) | DLINSA | Fluent UDF and Scheme Programming | 1 | March 16, 2012 01:45 |
Weird problem in my UDF | aleisia | Fluent UDF and Scheme Programming | 1 | June 29, 2011 14:17 |
Help! Compiled UDF problem 4 Wave tank tutorial | Shane | FLUENT | 1 | September 3, 2010 03:32 |
parallel UDF problem | kerem | FLUENT | 2 | June 20, 2006 07:56 |