CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   6DOF for spring valve motion problem (

ahehuhehuh August 19, 2015 03:08

6DOF for spring valve motion problem
2 Attachment(s)
Dear all~
I want solve the problem that 6DOF constant spring motion in 2-D

But it's results weird.. something likes function of sine..
How can i write 6DOF function?

Here are some attachment.
first, using the 6DOF

#include "udf.h"
#define spring_constant 1.5 /*idonknow*/
#define original_pin_cg_y 3.25e-4

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

real pin_movement_y;
prop[SDOF_MASS] = 6.792e-6;
prop[SDOF_IXX] = 6.4059e-11;
prop[SDOF_IYY] = 6.28e-13;
prop[SDOF_IZZ] = 6.4676e-11;

pin_movement_y = (DT_CG(dt)[1] - original_pin_cg_y);
Message("DT_CG = %e, %e, %e\n",DT_CG(dt)[0], DT_CG(dt)[1], DT_CG(dt)[2]);
prop[SDOF_LOAD_F_Y] = - spring_constant * pin_movement_y;
Message("spring force = %e\n",prop[SDOF_LOAD_F_Y]);

model and mesh for simulation,
results of coordinate for <Time vs 'wall box positions'>


LucasGasparino3110 February 26, 2018 14:36

Hi there mate!!

Did you get any closure in your case? For me, the sine-like motion doesn't seem wrong, tbh. Is your UDF used as interpret or compiled? I'm having a similar case but with the addition of torsion, so I'm willing to try your solution, as it is the only reference I got that uses a spring...

Thank you very much!

PRIDEmartins April 18, 2018 16:39

It is not wrong what you have done.
In my opinion, there are only two things missing in here:

I. a damping coeficient. Something like: -c*DT_VEL_GD(dt), on the force equation, in order to make the system more stable.

II. Descrease the time step.

For I: try using: zeta = c/2*sqrt(M*K), for correctly determing your damping coeficient, c.

For II, a good start point is: dt = fn/50 (fn = system's natural frequency, given by: fn = sqrt(k/m)/2*pi.

For me, in II, the frequency of vortex sheeding is also a good idea. Use the Strouhal nunber, St=0.2, to guess f_vortex e try doing the same.

Sorry for the bad English. I'm in a hurry in here.

All times are GMT -4. The time now is 09:56.