0% found this document useful (0 votes)
264 views2 pages

Example 2 - User-Defined Mixing Law For Thermal Conductivity

This document provides examples of using the DEFINE_PROPERTY macro to define custom user-defined mixing laws and properties in Fluent. It shows a mass-fraction weighted conductivity function that utilizes generic_property and mixture_species_loop to calculate conductivity based on the properties of individual species. It also gives an example of using DEFINE_PROPERTY to define a surface tension coefficient as a quadratic function of temperature for a multiphase VOF model. The document explains that after interpreting or compiling a DEFINE_PROPERTY UDF, its name will be visible in the Materials panel in Fluent to hook it up to simulations.

Uploaded by

ketan_bhardwaj88
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
264 views2 pages

Example 2 - User-Defined Mixing Law For Thermal Conductivity

This document provides examples of using the DEFINE_PROPERTY macro to define custom user-defined mixing laws and properties in Fluent. It shows a mass-fraction weighted conductivity function that utilizes generic_property and mixture_species_loop to calculate conductivity based on the properties of individual species. It also gives an example of using DEFINE_PROPERTY to define a surface tension coefficient as a quadratic function of temperature for a multiphase VOF model. The document explains that after interpreting or compiling a DEFINE_PROPERTY UDF, its name will be visible in the Materials panel in Fluent to hook it up to simulations.

Uploaded by

ketan_bhardwaj88
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

#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

You might also like