CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Combining Prescribed Motion and 6-DOF (https://www.cfd-online.com/Forums/fluent/228025-combining-prescribed-motion-6-dof.html)

aCamb27 June 17, 2020 11:16

Combining Prescribed Motion and 6-DOF
 
I'm currently using Fluent, and am wondering if there is a way to prescribe a constant velocity in one direction, but have motion in another direction be dictated by the hydrodynamic forces?

Specifically, I want to track how an object translates in the y direction as a result of arms flapping about the z-axis. I have been able to create the flapping motion using a UDF with the CG_MOTION macro, but am unsure how to combine or integrate this into the 6 DOF solver.

Can I simply assign 2 UDFs to the dynamic mesh zones, or is there a way to write a SDOF_PROPERTIES function that takes into account constant rotational velocity?

Thank you for the help!

vinerm June 18, 2020 07:32

Sdof
 
You can add additional forces, moments, etc. within SDOF. You can also combine SDOF with moving mesh.

aCamb27 June 18, 2020 10:28

1 Attachment(s)
Quote:

Originally Posted by vinerm (Post 775007)
You can add additional forces, moments, etc. within SDOF. You can also combine SDOF with moving mesh.

Dear Vinerm,

Thank you for your response. I've seen that I can specify external forces within SDOF, but haven't seen anywhere how to assign a constant velocity to the object. I would like the object to have a constant angular velocity about the z axis, but have variable y translation due to the hydrodynamic forces (see image below for an idea of what I hope to achieve).

Is there a function I could use to set this constant velocity, similar to CG_MOTION, but within the greater framework of SDOF?


Attachment 78466


Thanks!

vinerm June 18, 2020 12:24

Sdof
 
You can only assign one dynamic object to each zone, so, either it has to be SDOF or CG_MOTION. However, you can combine it with mesh motion. Since the wings are rotating, in an SHM I suppose, you can assign mesh motion with rotation about z-axis. SDOF does not have any property for motion, however, dynamic thread is common structure for all dynamic objects. Therefore, you should be able to set omega_cg or v_cg within DEFINE_SDOF_PROPERTIES just like it is done in DEFINE_CG_MOTION. Its just that CG_MOTION provides you omega_cg as an argument while in SDOF, you have to fetch it from structure of dt.

aCamb27 June 18, 2020 12:55

Quote:

Originally Posted by vinerm (Post 775033)
You can only assign one dynamic object to each zone, so, either it has to be SDOF or CG_MOTION. However, you can combine it with mesh motion. Since the wings are rotating, in an SHM I suppose, you can assign mesh motion with rotation about z-axis. SDOF does not have any property for motion, however, dynamic thread is common structure for all dynamic objects. Therefore, you should be able to set omega_cg or v_cg within DEFINE_SDOF_PROPERTIES just like it is done in DEFINE_CG_MOTION. Its just that CG_MOTION provides you omega_cg as an argument while in SDOF, you have to fetch it from structure of dt.


Dear Vinerm,
Thank you for the help. In your last sentence, are you saying that there is a way for me to extract omega_cg from Ansys at each time step and then set it to be a certain value? I'm not very familiar with the dt structure, would you be able to clarify this a bit or point me to somewhere I could learn about it?

vinerm June 18, 2020 12:59

Dynamic Thread
 
Yes, that's what I implied. dt is already provided by Fluent as argument of DEFINE_SDOF_PROPERTIES.

Look into dynamesh_tools.h available in src directory of Fluent installation. The first structure is for rigid bodies and the second one is generic dynamic thread structure. The rigid body structure is a member of dynamic thread. So, you can access rigid body structure from dt returned by Fluent and from that you can access omega_cg.

aCamb27 June 18, 2020 13:13

Quote:

Originally Posted by vinerm (Post 775048)
Yes, that's what I implied. dt is already provided by Fluent as argument of DEFINE_SDOF_PROPERTIES.

Look into dynamesh_tools.h available in src directory of Fluent installation. The first structure is for rigid bodies and the second one is generic dynamic thread structure. The rigid body structure is a member of dynamic thread. So, you can access rigid body structure from dt returned by Fluent and from that you can access omega_cg.


Thank you for the quick response! I'll look into this method now and see what I can do with it.

aCamb27 June 23, 2020 17:14

Quote:

Originally Posted by vinerm (Post 775048)
Yes, that's what I implied. dt is already provided by Fluent as argument of DEFINE_SDOF_PROPERTIES.

Look into dynamesh_tools.h available in src directory of Fluent installation. The first structure is for rigid bodies and the second one is generic dynamic thread structure. The rigid body structure is a member of dynamic thread. So, you can access rigid body structure from dt returned by Fluent and from that you can access omega_cg.

Dear Vinerm,

I was able to go through the src directory to access dynamesh_tools.h, and see the rigid bodies and generic dynamic thread structures mentioned. But, I'm still not able to have the UDF I write recognize omega_cg, even with #include "dynamesh_tools.h", which is where omega_cg[3] is located and defined in the src. I have included the UDF below.

Do you know if there is another file I have to #include, or a different function I need to use, to make sure Fluent connects the omega_cg[3] I write in my UDF to the one in dynamesh_tools.h?
Thank you for the help!


My UDF:


#include "udf.h"
#include "dynamesh_tools.h"

DEFINE_SDOF_PROPERTIES(ytranslationCWrotate, prop, dt, time, dtime)
{
prop[SDOF_MASS] = .001;
prop[SDOF_IZZ] = .1;
prop[SDOF_ZERO_TRANS_X] = TRUE;
prop[SDOF_ZERO_TRANS_Y] = FALSE;
prop[SDOF_ZERO_TRANS_Z] = TRUE;
prop[SDOF_ZERO_ROT_X] = TRUE;
prop[SDOF_ZERO_ROT_Y] = TRUE;
prop[SDOF_ZERO_ROT_Z] = FALSE;

real vely;
real omegareported;
real omega_cg[3]; /*without including real omega_cg[3] Fluent throws an “undefined object” error, and without the [3] it give a “subscript requires array“ error. */

if (time < 0.2)
{
omega_cg[2] = -3.9;
}

else
{
omega_cg[2] = 0.0;
}

vely = DT_VEL_CG(dt)[1];
omegareported = DT_OMEGA_CG(dt)[2];

Message("Time is %g and y velocity is %g and omega is %e and inputted omega is %g\n”, time, vely, omegareported, omega_cg[2]);
/*when I run a simulation, omega reported = 0.0 while omega_cg[2] = -3.9. */
}

nahian_masud May 1, 2024 06:32

Hi,

Could you solve the problem? I am trying something like this.


All times are GMT -4. The time now is 05:32.