|
[Sponsors] |
April 14, 2004, 10:46 |
Udf problem
|
#1 |
Guest
Posts: n/a
|
Hello all
I am writing a simple udf to get the temperature at each cell during iterations. It is interpreting well. But when I try to run the iterations, it is showing Access_violation error and it comes out. What may be the problem? Also I am having one more doubt. Whether can I include the udf in between the runs? It is leading to always error. Whether is it permissible in Fluent. My udf is given below: #include "udf.h" DEFINE_EXECUTE_AT_END(my_execute) { Domain *d; int ID=2; Thread *t=Lookup_Thread(d,ID); cell_t c; FILE *fp4; int i; real temp=0.; fp4=fopen("temp_zone2.dat","w"); begin_c_loop(c,t) { temp=C_T(c,t); fprintf(fp4,"%g\n",temp); i++; } end_c_loop(c,t) printf("The %d values ", i); fclose(fp4); } |
|
April 14, 2004, 18:33 |
Re: Udf problem
|
#2 |
Guest
Posts: n/a
|
Karthik ,
you are missing d=getdomain(1), use it before Thread *t=Lookup_Thread(d,ID); Should work then -Ajay |
|
April 15, 2004, 01:51 |
Re: Udf problem
|
#3 |
Guest
Posts: n/a
|
Since Get_Domain(1) and Thread *t=Lookup_Thread(d,ID) both are same, we can use either of two.
Is it right? Regards Karthick |
|
April 15, 2004, 10:05 |
Re: Udf problem
|
#4 |
Guest
Posts: n/a
|
No they are not the same .
Thread *t=Lookup_Thread(d,ID) will return a thread pointing to the ID number which you specify .Each boundary or zone is associated with an unique ID. but the other paramter you need which is d the domain pointer is not passed automatically when you use define_execute_at_end you need to get the domain ponter by using d=get_domain(1) -Ajay |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM | Rizwan | Fluent UDF and Scheme Programming | 40 | March 18, 2018 06:05 |
Problem with my udf | july | Fluent UDF and Scheme Programming | 3 | June 20, 2010 06:56 |
UDF problem | mansha goraya | FLUENT | 0 | October 29, 2007 00:31 |
udf compiling problem | akr | FLUENT | 3 | August 22, 2007 07:14 |
UDF problem | chiseung | FLUENT | 4 | January 10, 2002 09:58 |