Modeling a pin connector with Salome

Modeling a pin connector with Salome

This post explains how to model a pin connector with a python script using free pre-processing software Salome.

A pin connector is a solid beam that allows rotation/translation between two bodies. The analyst typically simulates it by modeling the pin part in a 3D solid mesh and then defining contact between the pin and the main body. It is good if you are interested in the stress distribution on the pin itself. But if you are interested in the effect of the pin on the overall assembly, using contact elements is not necessary. A faster approach is to use bars or beams elements to represent the connection.

The aluminum support shows on the next figure has two pin connectors. A displacement is applied on the flat surface, and the support is hold in place by the contact with the pins. For such a fine mesh, creating manually the connection would be very difficult. An alternative is to use the python script published in this post. The user provides two lines id and a mesh size, and the script automatically creates the connection.

9

# + + + + + + + + + + + + + + + + + + + + + + + + + + +
#  IDRA SIMULATION
#  MARCH. 2014
#  Create a pin connection using 2-nodes link elements
# + + + + + + + + + + + + + + + + + + + + + + + + + + +

# PARAMETERS

# Name of the mesh
Mesh_name='...'
# Enter the entry lines id has they appear in Salome
entry_line1=...
entry_line2=...
lying_on=1 #the axis of the hole is perpendicular to a X=cte (0), Y=cte (1) of Z=cte (2) plan
sizem=... # average distance btw two nodes of the mesh
factor_on_rad=2   # a ray is built every factor_on_rad node of the circonf
factor_on_axis=2  # a ray is built every factor_on_axis node of the axis

# Create a line passing in the center of the hole

# Create end points for the line
l1 = salome.myStudy.FindObjectID(entry_line1).GetObject()
l2 = salome.myStudy.FindObjectID(entry_line2).GetObject()
[Ver1,Ver2] = geompy.ExtractShapes(l1, geompy.ShapeType[VERTEX], True)
[Ver3,Ver4] = geompy.ExtractShapes(l2, geompy.ShapeType[VERTEX], True)
cV1 = geompy.PointCoordinates(Ver1)
cV2 = geompy.PointCoordinates(Ver2)
cV3 = geompy.PointCoordinates(Ver3)
cV4 = geompy.PointCoordinates(Ver4)
axex1=(cV1[0]+cV2[0])/2.0
axey1=(cV1[2]+cV2[2])/2.0
axex2=(cV3[0]+cV4[0])/2.0
axey2=(cV3[2]+cV4[2])/2.0
pp1 = geompy.MakeVertex(axex1,cV1[1],axey1)
pp2 = geompy.MakeVertex(axex2,cV3[1],axey2)
axe1= geompy.MakeLineTwoPnt(pp1,pp2)
geompy.addToStudy(axe1,'axe1')
l_axis=cV3[lying_on]-cV1[lying_on]
nb_naxis=int(round(l_axis/sizem)) # nb of nodes in the axis

# Add nodes on the axis

n_axis_list=[]
for i in range(nb_naxis):
    nodeaxis = Mesh1.AddNode(axex1,cV1[1]+i*((cV3[1]-cV1[1])/nb_naxis),axey1)
    n_axis_list.append(nodeaxis)

n_axis = Mesh1.CreateEmptyGroup(SMESH.NODE, 'n_axis')
nbAdd = n_axis.Add(n_axis_list)

#  Create the link elements

# Number of interval in the circonf
R=(sqrt((cV1[0]-cV2[0])**2+(cV1[2]-cV2[2])**2))*0.5
circon=2.0*PI*R
ntheta=int(round(circon/sizem))

links_list=[]
for j in range(0,nb_naxis,factor_on_axis):
   for i in range(0,ntheta,factor_on_rad):
     cyt=Mesh1.GetNodeXYZ(n_axis_list[j])
     cy=cyt[1]
     angle=(i*(360.0/ntheta))*2*PI/360.0
     cx=axex1+R*cos(angle)
     cz=axey1+R*sin(angle)
     edge = Mesh1.AddEdge([n_axis_list[j],Mesh1.FindNodeClosestTo(cx,cy,cz)])
     links_list.append(edge)

links = Mesh1.CreateEmptyGroup(SMESH.EDGE, 'links')
nbAdd = links.Add(links_list)

# update the Object Browser
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)

To properly represent the contact behavior, the analyst has to determine which of the beams are in compression (the contact), and which are in tension (open contact: element to delete). This is done by creating a filter in the post-precessing. Resulting connections look like this:

5
10

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License