![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Description
You can use DEFINE_DOM_SPECULAR_REFLECTIVITY to modify the inter-facial reflectivity of specularly reflecting semi-transparent walls. You may wish to do this if the reflectivity is dependent on other conditions that the standard boundary condition doesn't allow for (see this section in the separate Theory Guide for more information). During ANSYS FLUENT execution, the same UDF is called for all the faces of the semi-transparent wall, for each of the directions.
Usage
DEFINE_DOM_SPECULAR_REFLECTIVITY( name, f, t, nband, n_a, n_b, ray_direction, en, |
internal_reflection, specular_reflectivity, specular_transmissivity) |
|
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 |
symbol name | UDF name. |
face_t f | Face index. |
Thread *t | Pointer to face thread on which the specular |
reflectivity function is to be applied. | |
int nband | Band number (needed for non-gray discrete |
ordinates (DO) model). | |
real n_a | Refractive index of medium a. |
real n_b | Refractive index of medium b. |
real ray_direction | Direction vector (
![]() |
in this equation in the separate Theory Guide | |
real en | Interface normal vector (
![]() |
in this equation in the separate Theory Guide | |
int internal_reflection | Variable used to flag the code that total |
internal reflection has occurred. | |
real *specular_reflectivity | Specular reflectivity for the given direction
![]() |
real *specular_transmissivity | Specular transmissivity for the given direction
![]() |
Function returns | |
void | |
There are eleven arguments to DEFINE_DOM_SPECULAR_REFLECTIVITY: name, f, t, nband, n_a, n_b, ray_direction, en, internal_reflection, specular_reflectivity, and specular_transmissivity. You supply name, the name of the UDF. f, t, nband, n_a, n_b, ray_direction, en, internal_reflection, specular_reflectivity, and specular_transmissivity are variables that are passed by the ANSYS FLUENT solver to your UDF.
Example
In the following UDF, named
user_dom_spec_refl, specular reflectivity and transmissivity values are altered for a given ray direction
at face
f.
|
Note that in the example that follows, the
DEFINE_DOM_SPECULAR_REFLECTIVITY statement is broken up into three 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 alter the specular reflectivity and transmissivity, at semi-transparent walls, along direction s at face f */ #include "udf.h" DEFINE_DOM_SPECULAR_REFLECTIVITY(user_dom_spec_refl,f,t, nband,n_a,n_b, ray_direction,en,internal_reflection,specular_reflectivity, specular_transmissivity) { real angle, cos_theta; real PI = 3.141592; cos_theta = NV_DOT(ray_direction, en); angle = acos(cos_theta); if (angle >45 && angle < 60) { *specular_reflectivity = 0.3; *specular_transmissivity = 0.7; } } |
Hooking a Discrete Ordinates Model (DOM) Specular Reflectivity UDF to
ANSYS FLUENT
After the UDF that you have defined using DEFINE_DOM_SPECULAR_REFLECTIVITY is interpreted (Chapter 4) or compiled (Chapter 5), the name of the argument that you supplied as the first DEFINE macro argument (e.g., user_dom_spec_refl) will become visible and selectable in the User-Defined Function Hooks dialog box in ANSYS FLUENT.
See Section 6.2.6 for details.