See video: Abaqus scripting, Extruded panel.
from abaqus import *
from abaqusConstants import *
from part import FaceArray
def extpan(modelname, h, b1, b2, n, L, tb, tt, ti, esize, offs):
btot = n*(b1+b2)
mod = mdb.Model(name=modelname, modelType=STANDARD_EXPLICIT)
# Part
ske = mod.ConstrainedSketch(name='__profile__', sheetSize=200.0)
ske.Line(point1=(0.0, 0.0), point2=(btot, 0.0))
ske.Line(point2=(0.0, h), point1=(btot, h))
x1 = b2/2.0
x2 = b1/2.0
for i in range(0,n):
ske.Line(point1=(x1, 0.0), point2=(x2, h))
ske.Line(point1=(x1+b1, 0), point2=(x2+b2, h))
x1 = x1 + b1 + b2
x2 = x2 + b1 + b2
prt = mod.Part(name='Panel', dimensionality=THREE_D, type=DEFORMABLE_BODY)
prt.BaseShellExtrude(sketch=ske, depth=L)
del mod.sketches['__profile__']
# Sets
f1, f2, f3 = [], [], []
for f in prt.faces:
if f.pointOn[0][1]==0.0:
f1.append(f)
elif f.pointOn[0][1]==h:
f2.append(f)
else:
f3.append(f)
s1=prt.Set(name='FACES-BOT', faces=FaceArray(f1))
s2=prt.Set(name='FACES-TOP', faces=FaceArray(f2))
s3=prt.Set(name='FACES-INT', faces=FaceArray(f3))
# Material and section
mat = mod.Material(name='Alu')
mat.Elastic(table=((70000.0, 0.33), ))
mod.HomogeneousShellSection(name='SecBot',
preIntegrate=OFF, material='Alu', thicknessType=UNIFORM, thickness=tb,
thicknessField='', nodalThicknessField='',
idealization=NO_IDEALIZATION, poissonDefinition=DEFAULT,
thicknessModulus=None, temperature=GRADIENT, useDensity=OFF,
integrationRule=SIMPSON, numIntPts=5)
mod.HomogeneousShellSection(name='SecTop',
preIntegrate=OFF, material='Alu', thicknessType=UNIFORM, thickness=tt,
thicknessField='', nodalThicknessField='',
idealization=NO_IDEALIZATION, poissonDefinition=DEFAULT,
thicknessModulus=None, temperature=GRADIENT, useDensity=OFF,
integrationRule=SIMPSON, numIntPts=5)
mod.HomogeneousShellSection(name='SecInt',
preIntegrate=OFF, material='Alu', thicknessType=UNIFORM, thickness=ti,
thicknessField='', nodalThicknessField='',
idealization=NO_IDEALIZATION, poissonDefinition=DEFAULT,
thicknessModulus=None, temperature=GRADIENT, useDensity=OFF,
integrationRule=SIMPSON, numIntPts=5)
prt.SectionAssignment(region=s1, sectionName='SecBot', offset=0.0,
offsetType=offs, offsetField='', thicknessAssignment=FROM_SECTION)
prt.SectionAssignment(region=s2, sectionName='SecTop', offset=0.0,
offsetType=offs, offsetField='', thicknessAssignment=FROM_SECTION)
prt.SectionAssignment(region=s3, sectionName='SecInt', offset=0.0,
offsetType=MIDDLE_SURFACE, offsetField='', thicknessAssignment=FROM_SECTION)
# Mesh
prt.setMeshControls(regions=prt.faces, elemShape=QUAD, technique=STRUCTURED)
prt.seedPart(size=esize, deviationFactor=0.1, minSizeFactor=0.1)
prt.generateMesh()
# Assembly and constraints
ass = mod.rootAssembly
ass.DatumCsysByDefault(CARTESIAN)
ins = ass.Instance(name='Panel', part=prt, dependent=ON)
ass.rotate(instanceList=('Panel', ), axisPoint=(0.0, 0.0, 0.0), axisDirection=(0.0, 1.0, 0.0), angle=90.0)
ass.rotate(instanceList=('Panel', ), axisPoint=(0.0, 0.0, 0.0), axisDirection=(1.0, 0.0, 0.0), angle=90.0)
# Step, BC and loading
# Feel free to add...
extpan(modelname='M1', h=10, b1=14, b2=6, n=5, L=100, tb=1, tt=1, ti=1, esize=4, offs=TOP_SURFACE)