Hinge constraint between facets

Asked by Alessandro Balzarotti

Hello everybody,

I'm trying to simulate an harpoon for anchoring in microgravity in 2D (blocking xYZ degrees of freedom). I designed a basic harpoon made of a cylinder and a cone, but now I want to complicate the geometry. In particular I want to add two fins on the sides of the cylinder.

1) Is it possible to add an hinge constraint between the lower edge of the fin and the side of the cylinder, such that the fin can passively open when the harpoon is re-tracted?

2) Moreover, I created the geometry following some examples and answers I found here. Is the procedure I used, to generate a dynamic element made of facets, correct?

------------------------------------

from yade import ymport,export,plot

import math as m

#### INITIAL DATA ####
g=-2.5e-4 # g acceleration
radius=0.0032 # max radius of the spheres
h=1.18 # soil height
ls=.8 # desired depth of the soil
hl=h-ls
maxIt=7000 # max iterations

### MATERIAL ###
# Copper-Beryllium
ECo=130e9
rhoCo=8250
nuCo=.3
CoBe=FrictMat(density=rhoCo,young=ECo,poisson=nuCo,frictionAngle=.8,label="CoBe")
O.materials.append(CoBe)

#### CYLINDER AND CONE ####
# Cylinder and cone data
r=.008 # Cylinder radius
hcy=.09 # Cylinder length
hcon=.06 # Cone length
htip=.15 # Distance tip-soil

# Cylinder position
zcy=h+htip+hcon+hcy/2 # Cylinder center z-position (needed by facetCylinder)
zcon=h+htip+hcon/2 # Cone center z-position (needed by facetCone)

# Cylinder and cone made of facets is created and added to the simulation
mcy=pi*r**2*hcy*rhoCo # Cylinder mass
mcon=pi*r**2*hcon/3*rhoCo # Cone mass
Acy=r*hcy
Acon=r*hcon/2
COM=(Acy*(hcon+hcy/2)+Acon*hcon*2/3)/(Acy+Acon) # harpoon COM wrt the tip
dcy=hcon+hcy/2-COM # Distance cylinderCOM - harpoonCOM
dcon=COM-hcon*2/3 # Distance coneCOM - harpoonCOM
Izcy=mcy*r**2/2 # Cylinder moment of inertia wrt to z-axis, centered in the harpoon COM
Iycy=mcy/12*(3*r**2+hcy**2)+mcy*dcy**2 # Cylinder moment of inertia wrt to y-axis and x-axis, centered in the harpoon COM
      # Huygens Steiner theorem has been used.
Izcon=3*mcon*r**2/10 # Cone moment of inertia wrt to z-axis, centered in the harpoon COM
Iycon=3*mcon*(r**2+4*hcon**2)/20+mcon*dcon**2 # Cone moment of inertia wrt to y-azis and x axis, centered in the harpoon COM
      # Huygens Steiner theorem has been used.
cyl=O.bodies.append(geom.facetCylinder((.016,.05,zcy),r,hcy, material="CoBe"))
con=O.bodies.append(geom.facetCone((.016,.05,zcon), r, 0, hcon, material="CoBe"))

# A small mass and small inertia are given to each facet
for kk in O.bodies:
 if isinstance(kk.shape, Facet):
  kk.state.mass=1e-6
  kk.state.inertia=(1e-6,1e-6,1e-6)

# Facets are colored and clumped together
myList1=[]

for x in range(len(O.bodies)):
 if (O.bodies[x]):
  if isinstance(O.bodies[x].shape,Facet):
   myList1.append(x)

for x in myList1:
 O.bodies[x].shape.color=(0,1,0)

idClump1=O.bodies.clump(myList1)

# Inertia and mass are removed from the facets
for kk in O.bodies:
 if isinstance(kk.shape, Facet):
  kk.state.mass=0
  kk.state.inertia=(0,0,0)

# Inertia, mass and velocity are added to the harpoon
har=O.bodies[idClump1].state
har.mass=pi*r**2*(hcy+hcon/3)*rhoCo
har.inertia=(Iycon+Iycy,Iycon+Iycy,Izcon+Izcy)
har.vel=(0,0,-90)
har.blockedDOFs='xYZ'

#### FIN ####
finFacet=O.bodies.append(geom.facetParallelepiped((.016,.0585,1.415), (0.008,0.0005,0.025), orientation=Quaternion((0, 0, 1), 0), height= .025, wallMask=63, material="CoBe"))

# A small mass and small inertia are given to each facet
for yy in finFacet:
 if isinstance(O.bodies[yy].shape, Facet):
  O.bodies[yy].state.mass=1e-6
  O.bodies[yy].state.inertia=(1e-6,1e-6,1e-6)

# Facets are colored and clumped together
myList2=[]
for jj in finFacet:
 if isinstance(O.bodies[jj].shape,Facet):
  myList2.append(jj)
  O.bodies[jj].shape.color=(0,0,1)

idClump2=O.bodies.clump(myList2)

# Inertia and mass are removed from the facets
for xx in finFacet:
 if isinstance(O.bodies[xx].shape, Facet):
  O.bodies[xx].state.mass=0
  O.bodies[xx].state.inertia=(0,0,0)

# Inertia, mass and velocity are added to the fin
fin=O.bodies[idClump2].state
fin.mass=(.016*.001*.05)*rhoCo
fin.inertia=(1,1,1)
fin.vel=(0,0,-90)
fin.blockedDOFs='xYZ'

------------------------------------

Thanks in advance.

Kind regards,

Alessandro

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Alessandro Balzarotti
Solved:
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hello Alessandro,

> 1) Is it possible to add an hinge constraint between the lower edge of the fin and the side of the cylinder, such that the fin can passively open when the harpoon is re-tracted?

not directly, but in principle it is possible. A kind of penalty stiffness method put inside a PyRunner came to my mind, something like:
* dst = distance of hinges on both clumps = something
* force = dst * penaltyStiffness
* add forces and correcponding moments (excentricity of the force with respect to clump pos) to both clumps

> 2) Moreover, I created the geometry following some examples and answers I found here. Is the procedure I used, to generate a dynamic element made of facets, correct?

after a quick look it seems ok. If a rotation of clumped facets is important in your simulation, maybe more precise mass then 1e-6 will be needed for facets as the pos of the clump is computed based on pos and mass of individual facets. You cen easily test if the difference between computed and desired pos is negligible or not.

cheers
Jan

Revision history for this message
Alessandro Balzarotti (balzale) said :
#2

1) Thank you, I will try to implement it!

2) So you're saying that I should add to each facet a mass that is proportional to its area? And if so, is there a way to directly retrieve such information?

3) If I may ask another question about dynamic elements made of facets, how is the local coordinate system oriented? Because I imported a fin created with SolidWorks using ymport.gmsh, but the geometry is not fully symmetric. SolidWorks gives me the principal axes of inertia and the diagonal matrix of inertia. How can I be sure that the moments of inertia Ixx, Iyy, Izz by SolidWorks coincide with the ones considered by Yade?

Cheers,
Alessandro

Revision history for this message
Jan Stránský (honzik) said :
#3

Hello.

> 2) So you're saying that I should add to each facet a mass that is proportional to its area? And if so, is there a way to directly retrieve such information?

not that you should, it very much depends on a specific situation. But since it is not difficult to add, I would go this way :-)
to get area of a facet:
f = O.bodies[...] # a facet
area = f.shape.area

> 3)
clump.state.inertia ... principal values of inertia (should be equal to the diagonal of the diagonal matrix from solidWorks)
ori = clump.state.ori ... quaternion representing rotation
mori = ori.toRotationMatrix() ... rotation matrix, after creation (before further rotation) its columns (rows?) represents principal axes
I am not 100% sure with this point, please test it and if you find some difficulties, let us know

cheers
Jan

Revision history for this message
Alessandro Balzarotti (balzale) said :
#4

Thank you Jan, that solved my questions.