The use of ND macros in a UDF allows you to include general
3D expressions in your code, and the ND macros
take care of removing the z components of a vector
when you are compiling with RP_2D.
The constant ND_ND is defined as 2 for RP_2D (ANSYS Fluent 2D) and 3 for RP_3D (ANSYS Fluent 3D).
It can be used when you want to build a matrix in 2D and a
matrix in 3D. When you use
ND_ND, your UDF will work for both 2D and 3D cases, without requiring
any modifications.
real A[ND_ND][ND_ND] for (i=0; i<ND_ND; ++i) for (j=0; j<ND_ND; ++j) A[i][j] = f(i, j);