July 29, 2019 at 6:50 amAzim07Subscriber
Here i have a UDF which Shows the undeclared variable error in line 6. How can i remove this?
real T = C_T(c,t);
rho = 885/(0.0008(temp-321.35)+1);
C_UDMI(c,t,0) = rho;
July 29, 2019 at 1:59 pmRobAnsys Employee
I find deleting the line to solve many problems. Read the error carefully, and tell me which variable is undefined.
July 29, 2019 at 2:24 pmrachels1001Subscriber
I may be wrong, but is the "temp" variable defined anywhere?
July 30, 2019 at 4:43 amAzim07Subscriber
I just need to define the density in the way of following Equation
rho = 885/(0.0008*(t-321.35)+1)
How can i easily enter it ?
July 30, 2019 at 11:51 amrachels1001Subscriber
by using the macro C_T, you are finding the temperature for the cell that you are passing into the UDF, and you are defining this temperature as T. If this is the temperature that you want to evaluate density by, the line should read
"rho = 885/(0.008*(T-321.35)+1)"
not "rho = 885/(0.008*(Temp-321.35)+1)"
July 30, 2019 at 2:33 pmRobAnsys Employee
cvelikonja: correct. T is defined, temp is not so will cause an error when used in the code.
Note, UDFs may be case sensitive so always consider this too. T is also a slightly dangerous letter to use when you're using t for thread in Line 2.
July 31, 2019 at 9:34 amAzim07Subscriber
Thank you very much Gentleman......
I am getting Floating Error in the following UDF of viscosity......
How can i remove this?
July 31, 2019 at 10:18 amRobAnsys Employee
I doubt the floating point is in the UDF: it'll be the value produced by the UDF. Plot the value of your function against temperature and see what it produces.
- You must be logged in to reply to this topic.
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Suppress Fluent to open with GUI while performing in journal file
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Difference between K-epsilon and K-omega Turbulence Model
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error in cfd post
© 2023 Copyright ANSYS, Inc. All rights reserved.