|
[Sponsors] |
March 24, 2017, 07:43 |
What are C_VAR, F_VAR and THREAD_VAR ?
|
#1 |
Senior Member
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 12 |
Hi~
I found some example udf on the internet were using C_VAR, F_VAR and THREAD_VAR. The example is like 1. Cell flow variables: C_var(c,t) = flow variable “var” Where: var={R,P,U,V,W,T,H} For: density,pressure,velocity(XYZ),temperature,enthalp y 2. Boundary face flow variables: F_var(f,t) = flow variable “var” and I found this in "species.h" : F_VAR(f,THREAD,THREAD_VAR(THREAD).TYPE.yi[_ns]); and this in "profile.h" : F_VAR(f,t,prof) It seems a property from the Boundary Condition setting for GUI? 3. THREAD_VAR(tc).fluid.omega THREAD VAR(t).fluid.porous What are they and how to use@@? For example, how to find the name behind THREAD_VAR(tc) or F_VAR, C_VAR, like fluid.omega? Thank you! |
|
March 24, 2017, 09:41 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
The Fluent manual explains this all.
|
|
March 24, 2017, 09:50 |
|
#3 |
Senior Member
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 12 |
I didn't find anything about C_VAR, F_VAR and THREAD_VAR in ANSYS Help of ANSYS 16.
The search result is 0. I'll search other place. Thank you~ |
|
March 24, 2017, 10:42 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
It is hard to decode what you really want to know.
Code:
Cell flow variables: C_var(c,t) = flow variable “var” Where: var={R,P,U,V,W,T,H} Code:
C_R(c,t); C_P(c,t); C_U(c,t); C_V(c,t); //and so on A literal answer to your last question: you can find it in c_fluid.h. But this is not at all useful, unless you want to work at Ansys and improve Fluent. |
|
July 9, 2019, 11:37 |
error C2039 compiling define_adjust macro
|
#5 |
Member
Hanye Azimi
Join Date: Oct 2016
Posts: 42
Rep Power: 10 |
Hi everybody
I've been trying to compile a define_adjust macro to define angular velocity. I get this error,then. motion_spec' : is not a member of 'tv_cell_struct see declaration of tv_cell_struct part of this UDF is: thread_loop_c(t,domain) { if (THREAD_VAR(t).cell.motion_spec == MOTION_TYPE_MOVING_GRID) { THREAD_VAR(t).cell.omega = omega; } } Would you help me and advise me what to do. Thanks a lot. |
|
July 9, 2019, 11:50 |
|
#6 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
You use
Code:
THREAD_VAR(t).cell.motion_spec This code segment is not found anywhere in the help, so I have no idea why you believe that this code is valid. The solution is to replace it by valid code. Preferably valid code that does what you want. I have no idea what you want and how you arrived at this code, so I can not really help more... |
|
July 10, 2019, 01:11 |
|
#7 | |
Member
Hanye Azimi
Join Date: Oct 2016
Posts: 42
Rep Power: 10 |
Quote:
|
||
July 16, 2019, 02:03 |
|
#8 |
Senior Member
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 12 |
It seems that C_VAR, F_VAR and THREAD_VAR are used for code developer since they are found in files with the extension "h" such as "species.h" and "profile.h".
|
|
July 16, 2019, 10:03 |
|
#9 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Yes, but if it is not mentioned in the manual then Ansys can choose to completely change the definitions in the next version of Fluent (without warning!) and your udf might not run anymore.
So if you want to have pressure, the following three might work now (I didn't bother looking up the exact grammar):
|
|
|
|