Alaa AhmedAlaa Ahmed Member
edited November 2020 in Fluids


I'm using a udf to specify the properties of one degree of freedom body (rotation around z-axis), I compiled it using the built-in compiler in Fluent 2020 R2. I specified the cg location in the dynamic mesh zone, but it seems like the location doesn't get updated with the solution. The motion file has the same value for the cg point with different angles.

Am I missing something? Why the cg location doesn't update? I think it's affecting the solution, that's why I need to fix it.

This is the UDF I used:

#include "udf.h"

DEFINE_SDOF_PROPERTIES(flap, prop, dt, time, dtime)


prop[SDOF_MASS] = 21.5;

prop[SDOF_IXX] = 5;

prop[SDOF_IYY] = 5;

prop[SDOF_IZZ] = 5.5;

prop[SDOF_ZERO_TRANS_X] = TRUE; /* boolean, suppress translation in x-direction */

prop[SDOF_ZERO_TRANS_Y] = TRUE; /* boolean, suppress translation in y-direction */

prop[SDOF_ZERO_TRANS_Z] = TRUE; /* boolean, suppress translation in z-direction */

prop[SDOF_ZERO_ROT_X] = TRUE; /* boolean, suppress rotation around x-axis */

prop[SDOF_ZERO_ROT_Y] = TRUE; /* boolean, suppress rotation around y-axis */

prop[SDOF_ZERO_ROT_Z] = FALSE; /* boolean, suppress rotation around z-axis */

printf("\nflap: updated 6DOF properties");


and the motion file I got:


  • DrAmineDrAmine GermanyForum Coordinator
    edited November 2020

    If it is not moving and only rotating why shall cg change or am I missing some info here? Is it rotating around what?

  • The global coordinates should change as it rotates, it is not the same to have the body in vertical position and inclined by angle.

    When I use the the SDOF solver I can see the change, but it is not updated with the UDF.

  • To make it clearer, think about it in horizontal and vertical positions. A flat plate with length L rotating about one of its ends, in horizontal position will have cg as x=L/2 and y=0, after rotating 90 degrees the x=0 and y=L/2.

  • DrAmineDrAmine GermanyForum Coordinator

    You better describe the problem better from start. So you center of rotation is not your center of gravity? And the result you are getting without UDF are different to the ones with the GUI specification.

  • DrAmineDrAmine GermanyForum Coordinator

    You need to define the center of rotation in the UDf.

  • Yes, center of gravity is not the center of rotation.

    How can I define the center of rotation in the UDF?

  • Could you please help me with defining the center of rotation in the UDF?

  • I defined the center of rotation, but then the code didn't work. it gives me error (Error: Update-Dynamic-Mesh failed. Negative cell volume detected).

    I'm monitoring the moment at the center of rotation and below is the plot for the moment with time.

    and this is the motion file

    the used UDF


      Six DOF property compiled UDF with one DOF rotation


    #include "udf.h"

    DEFINE_SDOF_PROPERTIES(flap, sdof_prop, dt, time, dtime)


    Six_DOF_Object* sdof_obj = NULL;

    sdof_prop[SDOF_MASS] = 21.5;

    sdof_prop[SDOF_IXX] = 5.5;

    sdof_prop[SDOF_IYY] = 5.5;

    sdof_prop[SDOF_IZZ] = 5.5;

    sdof_prop[SDOF_LOAD_M_X] = 0.0;

    sdof_prop[SDOF_LOAD_M_Y] = 0.0;

    sdof_prop[SDOF_LOAD_M_Z] = 0.0;

    sdof_obj = Get_SDOF_Object(DT_PU_NAME(dt));

    if (NULLP(sdof_obj))


    /* Allocate_SDOF_Object must be called with the same name as the udf */

    sdof_obj = Allocate_SDOF_Object(DT_PU_NAME(dt));

    SDOFO_1DOF_T_P(sdof_obj) = FALSE;    /* one DOF translation */

    SDOFO_1DOF_R_P(sdof_obj) = TRUE;    /* one DOF rotation */

    SDOFO_DIR(sdof_obj)[0] = 0.0;

    SDOFO_DIR(sdof_obj)[1] = 0.0;

    SDOFO_DIR(sdof_obj)[2] = 1.0;

    SDOFO_CENTER_ROT(sdof_obj)[0] = 6.0;  /* only needed for one DOF rotation */

    SDOFO_CENTER_ROT(sdof_obj)[1] = 1.1938;  /* only needed for one DOF rotation */

    SDOFO_CENTER_ROT(sdof_obj)[2] = 0.0;  /* only needed for one DOF rotation */

    SDOFO_CONS_P(sdof_obj) = FALSE;     /* constrained */



  • It works fine if I increased the mass moment of inertia, the solution matches with experimental data if the moment of inertia equals to 45 instead of 5.5

  • RobRob UKForum Coordinator

    Negative cells tend to suggest it's moving too quickly. Not sure why messing with the moment of inertia will change that, unless the mass of the object is wrong?

  • The mass is right, it is the actual weight of the prototype we had in the experiment, same for the mass moment of inertia. (mass=21.5kg, I=5.5kg.m2)

    I tried the six DOF solver in the fluent and same thing happened, it works fine with a higher mass moment of inertia but not with the actual value.

  • RobRob UKForum Coordinator

    Weird. Are all the dimensions & material properties the same as the experiment?

  • Everything is exactly the same as the experiment.

    The motion of the flap is due to the interaction with waves, I have run different simulations with different waves (height and period) and as the wave height increases I have to increase the mass moment of inertia as well to match the experimental results. I need to fix this otherwise I won't be able to run any simulations different than the experiments.

    Do you have any suggestions?

  • DrAmineDrAmine GermanyForum Coordinator

    Are you sure about the moment of inertial? I remember in the past I got it from Mechanical System. Can you summarize in one single post the actual state?

Sign In or Register to comment.