|
[Sponsors] |
March 16, 2011, 10:19 |
THREAD-ID in UDF
|
#1 |
Senior Member
|
I would be grateful if someone could help me to fix the problem.
I am using THREAD_ID(t) in if statement to set different visosities in different zones. But it does not work in " if (Thread_ID(t)==...) " statement in my UDF. Whe I run fluent with this UDF, it does not distingush between zones. It is a very simple code, what could be wrong here?: PHP Code:
|
|
March 16, 2011, 10:57 |
|
#3 |
Senior Member
|
I have checked it without message: I have just removed "if(THREAD_ID...) statements and everything works fine, as seen from postprocessing, except it chooses one viscousity function for all zones, so it does not enter "if(THREAD_ID...) statements
|
|
March 16, 2011, 11:03 |
|
#4 |
Senior Member
|
I have checked it without message: I have just removed "if(THREAD_ID...) statements and everything works fine, as seen from postprocessing, except it chooses one viscousity function for all zones, so it does not enter "if(THREAD_ID...) statements
|
|
March 16, 2011, 11:52 |
|
#6 | |
Senior Member
|
Quote:
do not introduce idtop & idbot as: Code:
#define idtop 11 #define idbot 10 Code:
int idtop=11 int idbot=10 |
||
March 16, 2011, 12:13 |
|
#7 | |
Senior Member
|
Quote:
I have already tried this: it does not help. I am wanderin, could it be an interpretor problem, since it does not recognize commands like "Message" and "Error" |
||
March 16, 2011, 13:38 |
|
#8 |
Senior Member
|
you're right if you have such these problems with other UDFs with the same headers. is it the case?
|
|
March 16, 2011, 18:39 |
|
#10 |
Senior Member
|
I have solved the problem: it turns out that zone ID numbers must be taken as assigned by gambit (as in mesh file) and not as shown by fluent!
As for "Error" and "Message" makros they do not work, but can be replaced by "printf". |
|
April 3, 2012, 19:36 |
|
#12 | |
Member
Nathan
Join Date: Aug 2010
Posts: 62
Rep Power: 16 |
Hi
I've got the same problem with my UDF to define different diffusivities for different zones , did you solve this? I appreciate your suggestions. Did you define the zone ID from boundary box or cell zone box? Quote:
|
||
April 4, 2012, 05:15 |
|
#13 |
Senior Member
|
Hello Nathan,
Yes I have solved the problem but it was a long time ago: I remember that it turns out that zone ID numbers must be taken as assigned by gambit (as in mesh file) and not as shown by fluent! That is why my procedure was not working. So, in file I have presented above, it was necessary to change values of idtop and idbottom to those given by gambit in mesh file. Truffaldino |
|
April 4, 2012, 05:19 |
|
#14 | |
Senior Member
|
Quote:
I was not aware of your messge, sorry for late responce. Unfortunately I have no access to different versions of Fluent, so I cannot check it. Truffaldino |
||
December 3, 2012, 08:51 |
|
#15 |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 16 |
Hi, I have problem to save mass flow rate at outlet
I did following udf but it seems UDMI doesnt work because it is always zero. is there anyone who can help me? thanks in advance! here is my code: #include "udf.h" DEFINE_EXECUTE_AT_END(measure_mass_flow) { real mass_flow; Domain *d=Get_Domain(1); cell_t c; face_t f; Thread *mixture_thread = Lookup_Thread(d,4); Thread **pt = THREAD_SUB_THREADS(mixture_thread); Thread *tp = pt[0]; Thread *ts = pt[1]; mass_flow=0.; mp_thread_loop_f(mixture_thread,d,pt) if( THREAD_ID(mixture_thread) == 4 ) { begin_f_loop(f,mixture_thread) { F_UDMI(f,mixture_thread,0)+= F_FLUX(f,tp); } end_f_loop(f,mixture_thread) } } |
|
March 5, 2013, 14:36 |
|
#16 |
New Member
W Z
Join Date: Nov 2010
Posts: 11
Rep Power: 15 |
Hi, I also have this problem and fix it by using the ID provided by FLUENT, which can be found in BC panel.
|
|
March 6, 2013, 05:31 |
|
#17 |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 16 |
||
March 6, 2013, 05:39 |
|
#18 |
New Member
W Z
Join Date: Nov 2010
Posts: 11
Rep Power: 15 |
||
March 6, 2013, 05:45 |
|
#19 |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 16 |
||
March 6, 2013, 05:59 |
|
#20 |
New Member
W Z
Join Date: Nov 2010
Posts: 11
Rep Power: 15 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to access only one phase in multiphase model by UDF | wersoe | Fluent UDF and Scheme Programming | 1 | January 4, 2017 08:11 |
Parallelizing UDF | Hattori Hanzo | Fluent UDF and Scheme Programming | 4 | July 17, 2010 15:26 |
thread pointer comparison crash in Fluent UDF | Miriam | Main CFD Forum | 0 | August 31, 2008 17:40 |
Phase locked average in run time | panara | OpenFOAM | 2 | February 20, 2008 15:37 |
UDF: Checking Thread Storage | Greg Perkins | FLUENT | 0 | March 10, 2000 21:35 |