You can use DEFINE_DOM_DIFFUSE_REFLECTIVITY to modify the inter-facial reflectivity computed by ANSYS Fluent at
diffusely reflecting semi-transparent walls, based on the refractive
index values. During execution, a DEFINE_DOM_DIFFUSE_REFLECTIVITY function is called by ANSYS Fluent for each semi-transparent wall and
also for each band (in the case of a non-gray discrete ordinates (DO)
model). Therefore the function can be used to modify diffuse reflectivity
and diffuse transmissivity values at the interface.
DEFINE_DOM_DIFFUSE_REFLECTIVITY (name, t, nb, n_a, n_b, diff_ref_a, diff_tran_a, diff_ref_b, diff_tran_b)
Important: Note that all of the arguments to a DEFINE macro need to be placed on the same line in your source code. Splitting
the DEFINE statement onto several lines will
result in a compilation error.
|
Argument Type |
Description |
|---|---|
|
|
UDF name. |
|
|
Pointer to the thread on which the discrete ordinate diffusivity function is to be applied. |
|
|
Band number (needed for the non-gray discrete ordinates (DO) model). |
|
|
Refractive index of medium a. |
|
|
Refractive index of medium b. |
|
|
Diffuse reflectivity at the interface facing medium a. |
|
|
Diffuse transmissivity at the interface facing medium a. |
|
|
Diffuse reflectivity at the interface facing medium b. |
|
|
Diffuse transmissivity at the interface facing medium b. |
Function returns
void
There are nine arguments to DEFINE_DOM_DIFFUSE_REFLECTIVITY: name, t, nb, n_a, n_b, diff_ref_a, diff_tran_a, diff_ref_b, and diff_tran_b. You supply name, the name of the UDF.
t, nb, n_a, n_b, diff_ref_a, diff_tran_a, diff_ref_b, and diff_tran_b are variables that are
passed by the ANSYS Fluent solver to your UDF.
The following UDF, named user_dom_diff_refl, modifies diffuse reflectivity and transmissivity values on both
the sides of the interface separating medium a and b. The UDF is called
for all the semi-transparent walls and prints the value of the diffuse
reflectivity and transmissivity values for side a and b.
Important: Note that in the example that follows, the DEFINE_DOM_DIFFUSE_REFLECTIVITY statement is broken up into two lines for the sake of readability.
In your source file, you must make sure that the DEFINE statement is on one line only.
/* UDF to print the diffuse reflectivity and transmissivity
at semi-transparent walls*/
#include "udf.h"
DEFINE_DOM_DIFFUSE_REFLECTIVITY(user_dom_diff_refl,t,nband,n_a,n_b,
diff_ref_a,diff_tran_a,diff_ref_b,diff_tran_b)
{
printf("diff_ref_a=%f diff_tran_a=%f \n", *diff_ref_a, *diff_tran_a);
printf("diff_ref_b=%f diff_tran_b=%f \n", *diff_ref_b, *diff_tran_b);
}
After the UDF that you have defined using DEFINE_DOM_DIFFUSE_REFLECTIVITY is interpreted (Interpreting UDFs)
or compiled (Compiling UDFs), the name
of the argument that you supplied as the first DEFINE macro argument (for example, user_dom_diff_refl) will become visible and selectable in the User-Defined
Function Hooks dialog box in ANSYS Fluent.
See Hooking DEFINE_DOM_DIFFUSE_REFLECTIVITY UDFs for details.