August 21, 2019 at 1:36 pmkhalidb77Subscriber
Dear FLUENT users,
I used the below UDF for specific heat in terms of liquid fraction it compiled normally and uploaded successfully into Cp in materials panel but an error happened and the program quit with unknown reason as soon as I initial the solution? knowing that I activated the melting and solidification model and the case is running normally without using the UDF? So is there an error on it? any recommendations are appreciated please?
#define cps 1800.0
#define cpl 2400.0
#define lat 160000.0
DEFINE_SPECIFIC_HEAT(specificheat, T, Tref, h, yi)
real cps = 1800.0;
real cpl = 2400.0;
real lat = 160000.0;
*h = cpm*(T-Tref);
August 21, 2019 at 2:17 pmDrAmineAnsys Employee
That would not work: There is no way to access cell and thread data from within the DEFINE_SPECIFIC_HEAT macro.
August 21, 2019 at 2:21 pmkhalidb77Subscriber
Thanks Amine for the reply. So how I can resolve the error? is there any changes can I make within the UDF?
August 21, 2019 at 3:26 pmDrAmineAnsys EmployeeOne way via udrgm (not tested).
August 21, 2019 at 3:32 pmkhalidb77Subscriber
Excuse me what did you mean with udrgm?
August 21, 2019 at 3:39 pmDrAmineAnsys EmployeeUser defined real gas model.
August 21, 2019 at 3:44 pmkhalidb77Subscriber
But I do not have a gas in my case? I used PCM model hence I have just two liquids and a solid?
August 21, 2019 at 3:49 pmDrAmineAnsys EmployeeCan be used for liquid eos. Only way to make the trick. Or you use solidification and melting model or you use specie transport and code Cp with mass fraction. The problem here is that the macro to modify cp dies not support cell access or cell loop just temperature access and species access.
August 21, 2019 at 3:56 pmkhalidb77Subscriber
I am actually used the solidification and melting model? then is there a solution to the problem?
August 21, 2019 at 4:27 pmDrAmineAnsys EmployeeJust provide Cp as temperature dependent and melt heat in the material panel.
August 21, 2019 at 7:54 pm
August 22, 2019 at 5:18 amDrAmineAnsys EmployeePlease look thoroughly in my answers and you will see that Cp can be defined in UDF for temperature dependency.
August 22, 2019 at 7:57 amkhalidb77Subscriber
I thought you never notice what I mentioned in my previous post. If you see the definition at the picture I sent you will realized that LIQF is a function of temperature too. Hence can I use this definition for f(T) (liquid fraction) inside the specific heat UDF or no?
August 22, 2019 at 8:28 amDrAmineAnsys Employee
Again: You cannot access any cell variables in DEFINE_SPECIF_HEAT you need to use the passed temperature and species arguments into the macro.
- 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.