2.6.5.  DEFINE_SDOF_PROPERTIES

2.6.5.1. Description

You can use DEFINE_SDOF_PROPERTIES to specify custom properties of moving objects for the six-degrees of freedom (six DOF) solver in ANSYS Fluent. These include mass, moment and products of inertia, and external forces and moment properties. The properties of an object which can consist of multiple zones can change in time, if desired. External load forces and moments can either be specified as global coordinates or body coordinates. In addition, you can specify custom transformation matrices using DEFINE_SDOF_PROPERTIES.

Note that if the moving object is modeled as a half model and includes a plane of symmetry, then you have to specify this by providing the normal vector to the symmetry plane. Further, all six DOF properties such as mass and moments of inertia have to be specified for the full body if a symmetry plane is specified.

2.6.5.2. Usage

DEFINE_SDOF_PROPERTIES (name, properties, dt, time, dtime)

Argument Type

Description

symbol name

UDF name.

real *properties

Pointer to the array that stores the six DOF properties.

Dynamic_Thread *dt

Pointer to structure that stores the dynamic mesh attributes that you have specified (or that are calculated by ANSYS Fluent).

real time

Current time.

real dtime

Time step.

Function returns

void

There are four arguments to DEFINE_SDOF_PROPERTIES: name, properties, dt, and dtime. You provide the name of the UDF. properties, dt, and dtime are variables that are passed by the ANSYS Fluent solver to your UDF. The property array pointer that is passed to your function allows you to specify values for any of the following six DOF properties:

 SDOF_MASS   /* mass */
 SDOF_IXX,   /* moment of inertia */
 SDOF_IYY,   /* moment of inertia */
 SDOF_IZZ,   /* moment of inertia */
 SDOF_IXY,   /* product of inertia */
 SDOF_IXZ,   /* product of inertia */
 SDOF_IYZ,   /* product of inertia */
 SDOF_LOAD_LOCAL, /* boolean */
 SDOF_LOAD_F_X, /* external force */
 SDOF_LOAD_F_Y, /* external force */
 SDOF_LOAD_F_Z, /* external force */
 SDOF_LOAD_M_X, /* external moment */
 SDOF_LOAD_M_Y, /* external moment */
 SDOF_LOAD_M_Z, /* external moment */ 
 SDOF_ZERO_TRANS_X, /* boolean, suppress translation in x-direction */
 SDOF_ZERO_TRANS_Y, /* boolean, suppress translation in y-direction */
 SDOF_ZERO_TRANS_Z, /* boolean, suppress translation in z-direction */
 SDOF_ZERO_ROT_X, /* boolean, suppress rotation around x-axis */
 SDOF_ZERO_ROT_Y, /* boolean, suppress rotation around y-axis */
 SDOF_ZERO_ROT_Z, /* boolean, suppress rotation around z-axis */
 SDOF_SYMMETRY_X, /* normal vector of symmetry plane for half model */
 SDOF_SYMMETRY_Y, /* normal vector of symmetry plane for half model */
 SDOF_SYMMETRY_Z, /* normal vector of symmetry plane for half model */

The Boolean properties[SDOF_LOAD_LOCAL] can be used to determine whether the forces and moments are expressed in terms of global coordinates (FALSE) or body coordinates (TRUE). The default value for properties[SDOF_LOAD_LOCAL] is FALSE.

The booleans properties[SDOF_ZERO_TRANS_X], properties[SDOF_ZERO_TRANS_Y], and so on can be used to freeze selected translational and rotational components of the six DOF motion. A value of TRUE will freeze the corresponding component. The default value is FALSE.

If your moving object consists of a half model, then the symmetry plane has to be specified by providing the components of the normal vector, properties[SDOF_SYMMETRY_X], properties[SDOF_SYMMETRY_Y], and properties[SDOF_SYMMETRY_Z].

2.6.5.3. Custom Transformation Variables

The default transformations used by ANSYS Fluent are typical for most aerospace and other types of applications. However, if your model requires custom transformations, you can specify these matrices in your six DOF UDF. First set the SDOF_CUSTOM_TRANS Boolean to TRUE. Then use the macros listed below to define custom coordination rotation and derivative rotation matrices. CTRANS is the body-global coordinate rotation matrix and DTRANS is the body-global derivative rotation matrix.

 SDOF_CUSTOM_TRANS,   /* boolean */
 SDOF_CTRANS_11,   /* coordinate rotation matrices */
 SDOF_CTRANS_12,
 SDOF_CTRANS_13,
 SDOF_CTRANS_21,
 SDOF_CTRANS_22,
 SDOF_CTRANS_23,
 SDOF_CTRANS_31,
 SDOF_CTRANS_32,
 SDOF_CTRANS_33,
 SDOF_DTRANS_11,   /* derivative rotation matrices */
 SDOF_DTRANS_12,
 SDOF_DTRANS_13,
 SDOF_DTRANS_21,
 SDOF_DTRANS_22,
 SDOF_DTRANS_23,
 SDOF_DTRANS_31,
 SDOF_DTRANS_32,
 SDOF_DTRANS_33, 

2.6.5.4. Example 1

The following UDF, named stage, is a simple example of setting mass and moments of inertia properties for a moving object. This UDF is typical for applications in which a body is dropped and the six DOF solver computes the body’s motion in the flow field.

/************************************************************
   Simple example of a six DOF property UDF for a moving body
 **************************************************************/
 #include "udf.h"
 
 DEFINE_SDOF_PROPERTIES(stage, prop, dt, time, dtime)
 {
   prop[SDOF_MASS]   = 800.0;
   prop[SDOF_IXX]  = 200.0;
   prop[SDOF_IYY]  = 100.0;
   prop[SDOF_IZZ]  = 100.0;
   printf ("\nstage: updated 6DOF properties");
 } 

2.6.5.5. Example 2

The following UDF named delta_missile specifies case injector forces and moments that are time-dependent. Specifically, the external forces and moments depend on the current angular orientation of the moving object. Note that this UDF must be executed as a compiled UDF.

/*******************************************************
   Six DOF property compiled UDF with external forces/moments
 *******************************************************/
 #include "udf.h"
 
 DEFINE_SDOF_PROPERTIES(delta_missile, prop, dt, time, dtime)
 {
   prop[SDOF_MASS]   = 907.185;
   prop[SDOF_IXX]  = 27.116;
   prop[SDOF_IYY]  = 488.094;
   prop[SDOF_IZZ]  = 488.094;
   /* add injector forces, moments */
   {
    register real dfront = fabs (DT_CG (dt)[2] -
          (0.179832*DT_THETA (dt)[1]));
    register real dback = fabs (DT_CG (dt)[2] +
          (0.329184*DT_THETA (dt)[1]));
    if (dfront <= 0.100584)
      {
       prop[SDOF_LOAD_F_Z] = 10676.0;
       prop[SDOF_LOAD_M_Y] = -1920.0;
      }
    if (dback <= 0.100584)
      {
       prop[SDOF_LOAD_F_Z] += 42703.0;
       prop[SDOF_LOAD_M_Y] += 14057.0;
      }
   }
   printf ("\ndelta_missile: updated 6DOF properties");
 } 

2.6.5.6. Hooking a DEFINE_SDOF_PROPERTIES UDF to ANSYS Fluent

After the UDF that you have defined using DEFINE_SDOF_PROPERTIES is interpreted (Interpreting UDFs) or compiled (Compiling UDFs), the name of the argument that you supplied as the first DEFINE macro argument will become visible in the Six DOF UDF/Properties drop-down list in the Dynamic Mesh Zones dialog box in ANSYS Fluent. See Hooking DEFINE_SDOF_PROPERTIES UDFs for details on how to hook your DEFINE_SDOF_PROPERTIES UDF to ANSYS Fluent.


Release 18.2 - © ANSYS, Inc. All rights reserved.