CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   6dof udf (https://www.cfd-online.com/Forums/fluent-udf/98126-6dof-udf.html)

 assac March 3, 2012 21:41

6dof udf

1 Attachment(s)
Hi, I have a question:
I wanna calculate the movement of a 3d rigid body due to the pressure and shear forces of the flow with Fluent. The problem is a 3d flow in a tube with a rigid body that is free to move inside that tube (I've added an image below).
I wrote this UDF (It's my first UDF!!!! :-S ):

DEFINE_SDOF_PROPERTIES(six_degs_of_frdom1, prop, dt, time, dtime)
{
face_t f;
real NV_VEC(A);
real force0, force1, force2;

force0 = 0.0;
force1 = 0.0;
force2 = 0.0;

begin_f_loop(f,t)
{
F_AREA(A,f,t);
force0 += F_P(f,t) * A[0] + F_STORAGE_R_N3V(f,t,SV_WALL_SHEAR)[0];
force1 += F_P(f,t) * A[1] + F_STORAGE_R_N3V(f,t,SV_WALL_SHEAR)[1];
force2 += F_P(f,t) * A[2] + F_STORAGE_R_N3V(f,t,SV_WALL_SHEAR)[2];
}
end_f_loop(f,t)

prop[SDOF_MASS] = 50;
prop[SDOF_LOAD_F_X] = force0; /* external force */
prop[SDOF_LOAD_F_Y] = force1; /* external force */
prop[SDOF_LOAD_F_Z] = force2; /* external force */

but Fluent stamp an error :

Error:
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
Error Object: #f

Can somebody help me??!?!?!??!?!
Thanks!

[IMG][img=http://s16.postimage.org/51n8m75sl/problem.jpg] png image hosting[/IMG]

 assac March 6, 2012 14:38

solution

Hi,
storage.h
and the "ACCESS_VIOLATION" problem was solved!! (many thanks to Amir for that!).
But there is now a new problem...

the 3d object doesn't move at all...:confused:

does anyone have any idea what might be wrong?
Thanks!

 majidmng January 23, 2014 10:19

help!

Hi assac
im using 6dof for calculate force and moving body
my udf is:

#include "udf.h"

DEFINE_SDOF_PROPERTIES(stage, prop, dt, time, dtime)
{
face_t f;
real NV_VEC(A);
real force0, force1, force2;

force0 = 0.0;
force1 = 0.0;
force2 = 0.0;

begin_f_loop(f,t)
{
F_AREA(A,f,t);
force0 += F_P(f,t) * A[0];
force1 += F_P(f,t) * A[1];
force2 += F_P(f,t) * A[2];
}
end_f_loop(f,t)

prop[SDOF_MASS] = 50;
printf ("\nstage: updated 6DOF properties");
}
but it doesnt work and fluent messege is: