DEFINE_SDOF_PROPERTIES

Alaa AhmedAlaa Ahmed Member Posts: 6
edited November 2020 in Fluids

Hello,

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:


Comments

  • DrAmineDrAmine GermanyPosts: 6,867Forum 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?

  • Alaa AhmedAlaa Ahmed Posts: 23Member

    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.


  • Alaa AhmedAlaa Ahmed Posts: 23Member

    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 GermanyPosts: 6,867Forum 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 GermanyPosts: 6,867Forum Coordinator

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

  • Alaa AhmedAlaa Ahmed Posts: 23Member

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

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

  • Alaa AhmedAlaa Ahmed Posts: 23Member

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

  • DrAmineDrAmine GermanyPosts: 6,867Forum Coordinator

    The Customization manual does contain an example which you can use for your case. Example 3 If I remember correctly.

  • Alaa AhmedAlaa Ahmed Posts: 23Member

    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 */

    }

    }

  • Alaa AhmedAlaa Ahmed Posts: 23Member

    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 UKPosts: 8,886Forum 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?

  • Alaa AhmedAlaa Ahmed Posts: 23Member

    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 UKPosts: 8,886Forum Coordinator

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

  • Alaa AhmedAlaa Ahmed Posts: 23Member

    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 GermanyPosts: 6,867Forum 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?

  • Alaa AhmedAlaa Ahmed Posts: 23Member

    We performed some experiments for an oscillating plate hinged at the bottom end, the mass for the plate is mass=21.5kg, we did a swing test to calculate the mass moment of inertia and we found it to be I=5.5kg.m2. I compared this number with solid works and mechanical system and it matches both of them. Waves were generated in a tank and the plate started to move due to those waves. The rotation of the plate was measured.

    I tried to simulate the same experiment in Fluent using the SDOF solver for the plate and open channel wave conditions for the waves. I specified the wave height and the wavelength exactly as in the experiment, and the mass properties of the plate in a UDF file (shown above) same as the prototype we have.

    The simulation stopped giving me a dynamic mesh error, but when I increased the mass moment of inertia it works fine, and at some point it matches the experiment. I tried both the built-in SDOF solver, and UDF, both ways match the experiment but with different values.

    I tried to use that value for the mass moment of inertia that got me results matching with the experiment for a higher wave height, but then the simulation didn't work again and I had to increase the mass moment of inertia again.

    My question is, why the values in the simulations are much higher than the reality? and why the mass moment of inertia has to be increased with higher wave heights?

    How can this be solved to allow me to rely on Fluent for any change in the prototype?

  • YasserSelimaYasserSelima Posts: 934Member

    Your simulation are running very fast "large time step" ... So, you get negative cell volume. You solve the problem by increasing the mass moment of inertia. When you increase the mass moment of inertia, you actually decrease the change in velocity "acceleration" .. in other words, you make your body heavier, so it moves slower.

    Decrease the time step and try again

  • Alaa AhmedAlaa Ahmed Posts: 23Member

    I tried before to decrease the time step but it wasn't useful.

    I simulated a free decay test to check the natural frequency of the body without any forces, and then compared the simulation to the experiment and it matched with the higher mass moment of inertia as well.

  • YasserSelimaYasserSelima Posts: 934Member

    So, as you keep increasing the mass moment of inertia between simulations, the natural frequency remains constant?

Sign In or Register to comment.