2.3.39.  DEFINE_SPECIFIC_HEAT

2.3.39.1. Description

The DEFINE_SPECIFIC_HEAT macro can be used to define temperature-dependent functions for specific heat and sensible enthalpy for fluid, solid and mixture materials (this does not include DPM particles). These functions must be defined in a consistent manner, that is, the enthalpy function should be the temperature integral of the specific heat function.


Important:  This option is not available with the premixed, non-premixed and partially premixed models, and should be used as a compiled UDF only.


2.3.39.2. Usage

DEFINE_SPECIFIC_HEAT (name,T,Tref,h,yi)

Argument Type

Description

symbol name

UDF name

real T

Temperature for the calculation of the specific heat and enthalpy

real Tref

Reference temperature for the enthalpy calculation

real *h

Pointer to real

real *yi

Pointer to array of mass fractions of gas phase species

Function returns

real

There are five arguments to DEFINE_SPECIFIC_HEAT: name, T, Tref, h, and yi. You supply name, the name of the UDF. T and Tref are real variables that are passed by the ANSYS Fluent solver to the UDF, and h is a pointer to real.

The UDF must return the real value of the specific heat, and set the sensible enthalpy to the value referenced by the real pointer h. Note that the entropy is not computed in the UDF, instead ANSYS Fluent sets the entropy as , where is computed by the UDF at , and is the mean logarithmic average of T and Tref.

2.3.39.3. Example

/**********************************************************************
   UDF that computes specific heat and sets the sensible enthalpy
   to the referenced value
 ***********************************************************************/
 
 #include "udf.h"
 DEFINE_SPECIFIC_HEAT(my_user_cp, T, Tref, h, yi)
 {
   real cp=2000.;
   *h = cp*(T-Tref);
   return cp;
 }

2.3.39.4. Hooking a Specific Heat UDF to ANSYS Fluent

After the UDF that you have defined using DEFINE_SPECIFIC_HEAT is compiled (Compiling UDFs), the name that you specified in the DEFINE macro argument (for example, my_user_cp) will become visible and selectable in the Create/Edit Materials dialog box in ANSYS Fluent. See Hooking DEFINE_SPECIFIC_HEAT UDFs for details.


Release 18.2 - © ANSYS, Inc. All rights reserved.