← Back to team overview

yade-users team mailing list archive

[Question #641561]: Hinge constraint between facets

 

New question #641561 on Yade:
https://answers.launchpad.net/yade/+question/641561

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

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.