You can use DEFINE_GEOM to specify
the geometry of a deforming zone. By default, ANSYS Fluent provides a
mechanism for defining node motion along a planar or cylindrical surface.
When ANSYS Fluent updates a node on a deforming zone (for example, through
spring-based smoothing or after local face re-meshing) the node is
“repositioned" by calling the DEFINE_GEOM UDF. Note that UDFs that are defined using DEFINE_GEOM can only be executed as compiled UDFs.
DEFINE_GEOM (name, d, dt, position)
|
Argument Type |
Description |
|---|---|
|
|
UDF name. |
|
|
Pointer to domain. |
|
|
Pointer to structure that stores the dynamic mesh attributes that you have specified (or that are calculated by ANSYS Fluent). |
|
|
Pointer to array that stores the position. |
Function returns
void
There are four arguments to DEFINE_GEOM: name, d, dt, and position. You supply
name, the name of the UDF. d, dt, and position are variables that are passed by the ANSYS Fluent solver to your UDF.
The new position (after projection to the geometry defining the zone)
is returned to ANSYS Fluent by overwriting the position array.
The following UDF, named parabola,
is executed as a compiled UDF.
/************************************************************
* defining parabola through points (0, 1), (1/2, 5/4), (1, 1)
************************************************************/
#include "udf.h"
DEFINE_GEOM(parabola,domain,dt,position)
{
/* set y = -x^2 + x + 1 */
position[1] = - position[0]*position[0] + position[0] + 1;
}
After the UDF that you have defined using DEFINE_GEOM is compiled (see Compiling UDFs for
details), the name of the argument that you supplied as the first DEFINE macro argument will become visible in the Dynamic Mesh Zones dialog box in ANSYS Fluent. See Hooking DEFINE_GEOM UDFs for details on how to hook your DEFINE_GEOM UDF to ANSYS Fluent.