-
-
August 21, 2019 at 1:36 pm
khalidb77
SubscriberDear 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?
#include "udf.h"
/*
#define cps 1800.0
#define cpl 2400.0
#define lat 160000.0
*/
DEFINE_SPECIFIC_HEAT(specificheat, T, Tref, h, yi)
{
real cpm,dt;
Tref=308;
real cps = 1800.0;
real cpl = 2400.0;
real lat = 160000.0;
Thread *t;
cell_t c;
dt=exp(-T*(T-Tref)*(T-Tref)/4.0)/sqrt(4.0*3.14);
cpm =cps+(cpl-cps)*C_LIQF(c,t)+lat*dt;
*h = cpm*(T-Tref);
return cpm;
}
-
August 21, 2019 at 2:17 pm
DrAmine
Ansys EmployeeThat 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 pm
khalidb77
SubscriberThanks Amine for the reply. So how I can resolve the error? is there any changes can I make within the UDF?
Khalid
-
August 21, 2019 at 3:26 pm
DrAmine
Ansys EmployeeOne way via udrgm (not tested). -
August 21, 2019 at 3:32 pm
khalidb77
SubscriberExcuse me what did you mean with udrgm?
-
August 21, 2019 at 3:39 pm
DrAmine
Ansys EmployeeUser defined real gas model. -
August 21, 2019 at 3:44 pm
khalidb77
SubscriberBut 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 pm
DrAmine
Ansys 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 pm
khalidb77
SubscriberI am actually used the solidification and melting model? then is there a solution to the problem?
-
August 21, 2019 at 4:27 pm
DrAmine
Ansys 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 am
DrAmine
Ansys 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 am
khalidb77
SubscriberI 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?
Thanks
Khalid
-
August 22, 2019 at 8:28 am
DrAmine
Ansys EmployeeAgain: 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.

Ansys Blog
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
-
2688
-
2138
-
1349
-
1136
-
462
© 2023 Copyright ANSYS, Inc. All rights reserved.