[ANSYS, Inc. Logo] return to home search
next up previous contents index

3.4.1 Macros for Dealing with Two and Three Dimensions

There are two ways that you can deal with expressions involving two and three dimensions in your UDF. The first is to use an explicit method to direct the compiler to compile separate sections of the code for 2D and 3D, respectively. This is done using RP_2D and RP_3D in conditional-if statements. The second method allows you to include general 3D expressions in your UDF, and use ND and NV macros that will remove the $z$-components when compiling with RP_2D. NV macros operate on vectors while ND macros operate on separate components.



RP_2D and RP_3D


The use of a RP_2D and RP_3D macro in a conditional-if statement will direct the compiler to compile separate sections of the code for 2D and 3D, respectively. For example, if you want to direct the compiler to compute swirl terms for the 3D version of ANSYS FLUENT only, then you would use the following conditional compile statement in your UDF:

#if RP_3D
   /* compute swirl terms */
#endif


next up previous contents index Previous: 3.4 Vector and Dimension
Up: 3.4 Vector and Dimension
Next: 3.4.2 The ND Macros
Release 12.0 © ANSYS, Inc. 2009-01-14