Quote:
Originally Posted by diggee
(Post 696223)
But honestly, I would expect the same thing to happen there too cos the UDF will only have the mass, spring constant and 1dof as parameters, not initial equilibrium position.
|
Not quite. Consider the restoring force from earlier:
If you only want a single DOF such that the restoring force of the spring acts purely in the y-direction, then the force on the cylinder could be calculated with:
Code:
force = -k*(DT_CG(dt)[1] - x_equilibrium[1]);
where the DT_CG macro is the centre of gravity vector of the dynamic thread zone and x_equilibrium is the vector where the spring is at equilibrium (defined within the UDF). The UDF manual has examples and details for further clarification and reference.
Note: remember that indexing in C starts from zero instead of one, so DT_CG(dt)[1] corresponds to the second spatial coordinate (y for Cartesian).
|