|
[Sponsors] |
March 13, 2018, 11:35 |
Thread_name
|
#1 |
New Member
DS
Join Date: May 2016
Posts: 28
Rep Power: 10 |
Goodmorning,
I'm writing a UDF with the function DEFINE_ADJUST(my_adjust,d) but I want that it works just only in some cell zones for computational cost matter. In the thread_loop_c(t,d) I don't understand how to compare the cell zone name in order to compare it with the name read from a file. Just to results clearer I used THREAD_ID(t) and it gave me the ID number of the current CELL ZONE analyzed but I need to read the name of that (for example fluid-1 as shown in the CELL ZONE CONDITION menu). Or maybe someone have a more efficient solution with which by a journal file I can set the name of cell zone on which the my_adjust function have to operate. Thank you very much Best regards Denis |
|
March 13, 2018, 12:38 |
|
#2 |
Senior Member
Join Date: Sep 2017
Posts: 246
Rep Power: 12 |
Hi Denis,
For a thread pointer t, you can access THREAD_NAME(t). This returns a string, so then you can use strcmp and so on. However, THREAD_NAME(t) will return a blank unless you have issued the following Scheme command: (update-solver-thread-names) A frequent, but somewhat clunky, way to define a single thread (instead of a thread_loop_c) is to define a thread ID number (for example, from the Cell Zone Conditions window) and look up the thread from that in the UDF: #DEFINE CELL_ZONE_ID 3 Domain *d; Thread *t; d = Get_Domain(1); t = Lookup_Thread(d, CELL_ZONE_ID); If you need to pass the ID to the UDF without recompiling, you need to look at RP-variables. Good luck! Ed |
|
March 13, 2018, 12:48 |
|
#3 |
New Member
DS
Join Date: May 2016
Posts: 28
Rep Power: 10 |
Thank you very very much. I will try your suggestions immediately. Thank you!
Denis |
|
March 13, 2018, 13:06 |
|
#4 |
New Member
DS
Join Date: May 2016
Posts: 28
Rep Power: 10 |
Just one more question. I'm using fluent 18.2. I tried to find in the console command the update-solver-thread-names path but I couldn't reach it. I'm sorry for my inexperience in fluent software.
Thank you very much for your help Best regards Denis |
|
March 14, 2018, 00:38 |
|
#5 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
best regards |
|
Tags |
thread_name udf |
|
|