CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Thread_name

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 13, 2018, 11:35
Default Thread_name
  #1
New Member
 
DS
Join Date: May 2016
Posts: 28
Rep Power: 10
denis.sanga@hotmail.it is on a distinguished road
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
denis.sanga@hotmail.it is offline   Reply With Quote

Old   March 13, 2018, 12:38
Default
  #2
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 12
obscureed is on a distinguished road
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
obscureed is offline   Reply With Quote

Old   March 13, 2018, 12:48
Default
  #3
New Member
 
DS
Join Date: May 2016
Posts: 28
Rep Power: 10
denis.sanga@hotmail.it is on a distinguished road
Thank you very very much. I will try your suggestions immediately. Thank you!
Denis
denis.sanga@hotmail.it is offline   Reply With Quote

Old   March 13, 2018, 13:06
Default
  #4
New Member
 
DS
Join Date: May 2016
Posts: 28
Rep Power: 10
denis.sanga@hotmail.it is on a distinguished road
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
denis.sanga@hotmail.it is offline   Reply With Quote

Old   March 14, 2018, 00:38
Default
  #5
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
  • copy with brackets
    Code:
    (update-solver-thread-names)
  • go to fluent
  • click console
  • in root use paste [ctrl+v]
  • enter
that's it

best regards
AlexanderZ is offline   Reply With Quote

Reply

Tags
thread_name udf


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 18:48.