#include "udf.
h"
DEFINE_PROPERTY(sfc, c, t)
real T = C_T(c,t);
return 1.35 - 0.004*T + 5.0e-6*T*T;
Example 2 - User-defined Mixing Law for Thermal Conductivity
You can use DEFINE_PROPERTY to define custom user-defined mixing laws for density,
viscosity, and conductivity of mixture materials. In order to access species material properties
your UDF will need to utilize auxiliary utilities that are described above.
The following UDF, named mass_wtd_k, is an example of a mass-fraction weighted
conductivity function. The UDF utilizes the generic_property function to obtain properties
of individual species. It also makes use of MATERIAL_PROPERTY and THREAD_MATERIAL .
/*********************************************************************
UDF that specifies a custom mass-fraction weighted conductivity
**********************************************************************/
DEFINE_PROPERTY(mass_wtd_k,c,t)
{
real sum = 0.; int i;
Material *sp;
real ktc;
Property *prop;
mixture_species_loop(THREAD_MATERIAL(t),sp,i)
{
prop = (MATERIAL_PROPERTY(sp));
ktc = generic_property(c,t,prop,PROP_ktc,C_T(c,t));
sum += C_YI(c,t,i)*ktc;
}
return sum;
}
Example 3 - Surface Tension Coefficient UDF
DEFINE_PROPERTY can also be used to define a surface tension coefficient UDF for the
multiphase VOF model. The following UDF specifies a surface tension coefficient as a
quadratic function of temperature. The source code can be interpreted or compiled in
FLUENT.
/***************************************************************
Surface Tension Coefficient UDF for the VOF Multiphase Model
***************************************************************/
#include "udf.h"
DEFINE_PROPERTY(sfc, c, t)
{
real T = C_T(c,t);
return 1.35 - 0.004*T + 5.0e-6*T*T;
}
Hooking a Property UDF to FLUENT
After the UDF that you have defined using DEFINE_PROPERTY is interpreted or compiled (see
Chapter 7 for details), the name that you specified in the DEFINE macro argument will
become visible in the Materials panel in FLUENT. See Section 8.2.13 for details on how to
hook your DEFINE_PROPERTY UDF to FLUENT.
Previous: 4.3.12 DEFINE_PROFILE
Up: 4.3 Model-Specific DEFINE Macros
Next: 4.3.14 DEFINE_SCAT_PHASE_FUNC