Professional Documents
Culture Documents
How To Access The Heat Flux in General Purpose Fluent Udfs?: Problem/Description
How To Access The Heat Flux in General Purpose Fluent Udfs?: Problem/Description
Note: This macro is not documented. You can use it on your own risk. ANSYS can decline working on
support requests related to cases that depend on such macros and the macros can change without notice
in future versions of ANSYS Fluent.
Solution:
To access the heat transfer rate on walls and flow openings (e.g. velocity inlet) you can use the following
macro:
BOUNDARY_HEAT_FLUX(face_t, thread)
Although the macro is called "flux" it returns the heat transfer rate. If you need the heat flux you have to
divide it through the area of the face.
The following example code is also attached as C source file to this solution.
01 /*******************************************************************\
02 Start UDF code
03 Example uses undocumented macros
04 ANSYS can decline support for all UDFs that use such macros
05 Example UDF provided without guarantees and support
06 \*******************************************************************/
07
08 #include "udf.h"
09
10 DEFINE_ON_DEMAND(heat_flux_output)
11 {
12 /* Do nothing on the host process, only run serial and on compute
nodes */
13 #if !RP_HOST
14 Domain *d = Get_Domain(1);
15 Thread *t;
16 face_t f;
17 real hf;
18 real thf = 0.0;
19
To use this UDF download the attachment from the ANSYS Customer Portal. It is not recommended to
copy and paste the code from this document to avoid formatting issues.
Although it is not required to run this case to convergence to see how this UDF works, just remember that
heat conduction cases should always be calculated using double precision and the residuals
convergence criterion should be lowered to get a reasonably converged solution.
Important: Use the described macro at your own risk. There is no documentation for this macro. ANSYS
can decline working on support requests related to cases that depend on such macros.
Attachments:
1. 2039857-example.zip
Archive contains example case and C source file to demonstrate the application of the macro
BOUNDARY_HEAT_FLUX(f, t)