Notifications
Clear all

question about abaqus python scripte (single edge crack model)  


陳皇銘
Posts: 2
(@陳皇銘)
New Member
Joined: 1 year ago

Hello,

Im programming a Python script to study the crack propagation. When, I tried to test the code about the crack (assignSeam) and define the cracktip and crackfront, abaqus reports [SIZE=26px][COLOR=#FF0000][U][I][B]erro [/B][/I][/U][B](arg1(coordinates)[0], found tuple, expecting float), [/B][/COLOR][/SIZE]

I wonder if someone have experience in similar project can offer me some help to the script, i will be very grateful, the following is my script:

def creat_crack (w,H,a1_w,h1_H,my_model,my_part):

# Draw crack on the sketch and make partition
a1,h1 = a1_w*w,h1_H*H

p = mdb.models[my_model].parts[my_part]
f, e, d = p.faces, p.edges, p.datums
t = p.MakeSketchTransform(sketchPlane=f.findAt(coordin ates=(w/2.0,H/2.0,0.0),), sketchPlaneSide=SIDE1, origin=(
0.0,0.0,0.0))
s1 = mdb.models[my_model].ConstrainedSketch(name=__profile__,
sheetSize=44.72, gridSpacing=1.00, transform=t)
g, v, d, c = s1.geometry, s1.vertices, s1.dimensions, s1.constraints
s1.setPrimaryObject(option=SUPERIMPOSE)
crackLine = s1.Line(point1=(0.0,h1), point2=(a1,h1))
s1.HorizontalConstraint(entity=crackLine,addUndoSt ate=False)
p = mdb.models[my_model].parts[my_part]
pickedFaces = f.findAt(((w/2.0, H/2.0, 0.0), ))
p.PartitionFaceBySketch(faces=pickedFaces, sketch=s1)
#s1.unsetPrimaryObject()
#del mdb.models[my_model].sketches[__profile__]

# AssignSeam Creat the crack
#a = mdb.models[my_model].rootAssembly
p = mdb.models[my_model].parts[my_part]
f1, e1, d1 = p.faces, p.edges, p.datums
edges1 = e1.findAt(((a1/2.0,h1,0.0),))
pickedRegions = p.Set(edges=edges1, name=Set-1)
#pickedRegions = p.Set(edges=crackLine, name=Set-1)
mdb.models[my_model].parts[my_part].engineeringFeatures.assignSeam(
regions=pickedRegions)
#a = mdb.models[my_model].rootAssembly
#a = mdb.models[my_model].rootAssembly
#v1 = a.instances[my_part+-1].vertices
vert = (a1,h1,0.0)
vt = v1.findAt((vert,))
crack_Front = regionToolset.Region(vertices=vt)
#a = mdb.models[my_model].rootAssembly
#v1 = a.instances[my_part+-1].vertices
#verts1 = v1.findAt(((a1,h1,0.0),))
crack_Tip = regionToolset.Region(vertices=vt)
p.engineeringFeatures.ContourIntegral(name=Crack-1, symmetric=OFF,
crackFront=crack_Front, crackTip=crack_Tip,
extensionDirectionMethod=Q_VECTORS, qVectors=(((-1.0, 0.0, 0.0), (0.0, 0.0,
0.0)), ), midNodePosition=0.25, collapsedElementAtTip=SINGLE_NODE)

Best regards

Topic Tags
Share: