A sandwich beam subjected to 3-point bending
Supporting video: Abaqus scripting, Sandwich beam
The following script employs simple boundary conditions for the supports and loading:
from abaqus import *
from abaqusConstants import *
from part import EdgeArray
def sb3p(modelname, L, dL, b, hc, ts1, ts2, ezL, ezT, ezs1, ezs2, ezc, U3):
'''
L: support length
dL: added length at both ends
b: width
hc: thickness of core
ts1: thickness of bottom skin
ts2: thickness of top skin
ezL: element size in the longitudinal direction
ezT: element size in the transverse direction
ezs1: element size through the thickness of bottom skin
ezs2: element size through the thickness of top skin
ezc: element size through the thickness of the core
U3: imposed displacement (deflection)
'''
mod = mdb.Model(name=modelname, modelType=STANDARD_EXPLICIT)
# Solid beam:
ske = mod.ConstrainedSketch(name='__profile__', sheetSize=200.0)
ske.rectangle(point1=(-L/2.0-dL, -b/2.0), point2=(L/2.0+dL, b/2.0))
prt = mod.Part(name='Beam', dimensionality=THREE_D, type=DEFORMABLE_BODY)
prt.BaseSolidExtrude(sketch=ske, depth=hc+ts1+ts2)
del mod.sketches['__profile__']
# Partitions:
id = prt.DatumPlaneByPrincipalPlane(principalPlane=YZPLANE, offset=0.0).id
prt.PartitionCellByDatumPlane(datumPlane=prt.datums[id], cells=prt.cells)
id = prt.DatumPlaneByPrincipalPlane(principalPlane=YZPLANE, offset=-L/2.0).id
prt.PartitionCellByDatumPlane(datumPlane=prt.datums[id], cells=prt.cells)
id = prt.DatumPlaneByPrincipalPlane(principalPlane=YZPLANE, offset=L/2.0).id
prt.PartitionCellByDatumPlane(datumPlane=prt.datums[id], cells=prt.cells)
id = prt.DatumPlaneByPrincipalPlane(principalPlane=XZPLANE, offset=0.0).id
prt.PartitionCellByDatumPlane(datumPlane=prt.datums[id], cells=prt.cells)
id = prt.DatumPlaneByPrincipalPlane(principalPlane=XYPLANE, offset=ts1).id
prt.PartitionCellByDatumPlane(datumPlane=prt.datums[id], cells=prt.cells)
id = prt.DatumPlaneByPrincipalPlane(principalPlane=XYPLANE, offset=ts1+hc).id
prt.PartitionCellByDatumPlane(datumPlane=prt.datums[id], cells=prt.cells)
# Sets, cells:
c = prt.cells.getByBoundingBox(zMax=ts1)
prt.Set(name='CELLS-BOT', cells=c)
c = prt.cells.getByBoundingBox(zMin=ts1, zMax=ts1+hc)
prt.Set(name='CELLS-CORE', cells=c)
c = prt.cells.getByBoundingBox(zMin=ts1+hc)
prt.Set(name='CELLS-TOP', cells=c)
# Sets, edges
edgesLongitudinal = []
edgesTransverse = []
edgesThickness = []
for e in prt.edges:
vs = e.getVertices()
x1 = prt.vertices[vs[0]].pointOn[0][0]
x2 = prt.vertices[vs[1]].pointOn[0][0]
y1 = prt.vertices[vs[0]].pointOn[0][1]
y2 = prt.vertices[vs[1]].pointOn[0][1]
z1 = prt.vertices[vs[0]].pointOn[0][2]
z2 = prt.vertices[vs[1]].pointOn[0][2]
if y1==y2 and z1==z2:
edgesLongitudinal.append(e)
if x1==x2 and z1==z2:
edgesTransverse.append(e)
if x1==x2 and y1==y2:
edgesThickness.append(e)
prt.Set(name='EDGES-LONG', edges=EdgeArray(edgesLongitudinal))
prt.Set(name='EDGES-TRAN', edges=EdgeArray(edgesTransverse))
prt.Set(name='EDGES-THIC', edges=EdgeArray(edgesThickness))
edgesThickS1 = prt.sets['EDGES-THIC'].edges.getByBoundingBox(zMax=ts1)
prt.Set(name='EDGES-THIC-S1', edges=edgesThickS1)
edgesThickCo = prt.sets['EDGES-THIC'].edges.getByBoundingBox(zMin=ts1,zMax=ts1+hc)
prt.Set(name='EDGES-THIC-CORE', edges=edgesThickCo)
edgesThickS2 = prt.sets['EDGES-THIC'].edges.getByBoundingBox(zMin=ts1+hc)
prt.Set(name='EDGES-THIC-S2', edges=edgesThickS2)
edgesSupport1 = prt.sets['EDGES-TRAN'].edges.getByBoundingBox(xMin=-L/2.0, xMax=-L/2.0, zMax=0.0)
prt.Set(name='EDGES-SUPPORT-1', edges=edgesSupport1)
edgesSupport2 = prt.sets['EDGES-TRAN'].edges.getByBoundingBox(xMin=L/2.0, xMax=L/2.0, zMax=0.0)
prt.Set(name='EDGES-SUPPORT-2', edges=edgesSupport2)
edgesLoading = prt.sets['EDGES-TRAN'].edges.getByBoundingBox(xMin=0.0, xMax=0.0, zMin=ts1+hc+ts2)
prt.Set(name='EDGES-LOADING', edges=edgesLoading)
vertsRBX = prt.vertices.findAt(((0.0, -b/2, 0.0), ), ((0.0, b/2, 0.0), ))
prt.Set(name='VERTICES-RBX', vertices=vertsRBX)
vertsRBY = prt.vertices.findAt(((0.0, 0.0, 0.0),))
prt.Set(name='VERTICES-RBY', vertices=vertsRBY)
# Materials and sections
mat1 = mod.Material(name='Alu')
mat1.Elastic(table=((70000.0, 0.33), ))
mat2 = mod.Material(name='Foam')
mat2.Elastic(table=((100.0, 0.3), ))
mod.HomogeneousSolidSection(name='Section-Skin', material='Alu', thickness=None)
mod.HomogeneousSolidSection(name='Section-Foam', material='Foam', thickness=None)
prt.SectionAssignment(region=prt.sets['CELLS-BOT'], sectionName='Section-Skin', offset=0.0,
offsetType=MIDDLE_SURFACE, offsetField='', thicknessAssignment=FROM_SECTION)
prt.SectionAssignment(region=prt.sets['CELLS-TOP'], sectionName='Section-Skin', offset=0.0,
offsetType=MIDDLE_SURFACE, offsetField='', thicknessAssignment=FROM_SECTION)
prt.SectionAssignment(region=prt.sets['CELLS-CORE'], sectionName='Section-Foam', offset=0.0,
offsetType=MIDDLE_SURFACE, offsetField='', thicknessAssignment=FROM_SECTION)
# Mesh
prt.seedEdgeBySize(edges=prt.sets['EDGES-LONG'].edges,
size=ezL, deviationFactor=0.1, constraint=FINER)
prt.seedEdgeBySize(edges=prt.sets['EDGES-TRAN'].edges,
size=ezT, deviationFactor=0.1, constraint=FINER)
prt.seedEdgeBySize(edges=prt.sets['EDGES-THIC-S1'].edges,
size=ezs1, deviationFactor=0.1, constraint=FINER)
prt.seedEdgeBySize(edges=prt.sets['EDGES-THIC-S2'].edges,
size=ezs2, deviationFactor=0.1, constraint=FINER)
prt.seedEdgeBySize(edges=prt.sets['EDGES-THIC-CORE'].edges,
size=ezc, deviationFactor=0.1, constraint=FINER)
prt.generateMesh()
# Assembly, steps, BC and loading
ass = mod.rootAssembly
ins = ass.Instance(name='Beam', part=prt, dependent=ON)
edges = ins.sets['EDGES-SUPPORT-1']
mod.DisplacementBC(name='BC-SUPPORT-1', createStepName='Initial', region=edges, u3=SET)
edges = ins.sets['EDGES-SUPPORT-2']
mod.DisplacementBC(name='BC-SUPPORT-2', createStepName='Initial', region=edges, u3=SET)
edges = ins.sets['EDGES-LOADING']
mod.DisplacementBC(name='BC-LOADING', createStepName='Initial', region=edges, u3=SET)
verts = ins.sets['VERTICES-RBX']
mod.DisplacementBC(name='BC-RBX', createStepName='Initial', region=verts, u1=SET)
verts = ins.sets['VERTICES-RBY']
mod.DisplacementBC(name='BC-RBY', createStepName='Initial', region=verts, u2=SET)
mod.StaticStep(name='Step-1', previous='Initial')
mod.boundaryConditions['BC-LOADING'].setValuesInStep(stepName='Step-1', u3=-U3)
job = mdb.Job(name=modelname, model=modelname)
job.submit(consistencyChecking=OFF)
sb3p(modelname='SW1', L=200, dL=10, b=30, hc=8, ts1=1, ts2=1,
ezL=2, ezT=2, ezs1=0.2, ezs2=0.2, ezc=2, U3=10)
Replace the last part of the function with the following:
# Assembly, steps, BC and loading
ass = mod.rootAssembly
ins = ass.Instance(name='Beam', part=prt, dependent=ON)
# Rollers
r = 5
ske = mod.ConstrainedSketch(name='__profile__', sheetSize=200.0)
ske.ConstructionLine(point1=(0.0, -100.0), point2=(0.0, 100.0))
ske.Line(point1=(r, -1.1*b/2.0), point2=(r, 1.1*b/2.0))
prtr = mod.Part(name='Roller', dimensionality=THREE_D, type=ANALYTIC_RIGID_SURFACE)
prtr.AnalyticRigidSurfRevolve(sketch=ske)
del mod.sketches['__profile__']
# Roller instances
insRL = ass.Instance(name='Roller-L', part=prtr, dependent=ON)
ass.translate(instanceList=('Roller-L', ), vector=(-L/2.0, 0.0, -r))
insRR = ass.Instance(name='Roller-R', part=prtr, dependent=ON)
ass.translate(instanceList=('Roller-R', ), vector=(L/2.0, 0.0, -r))
insRC = ass.Instance(name='Roller-C', part=prtr, dependent=ON)
ass.translate(instanceList=('Roller-C', ), vector=(0.0, 0.0, r+ts1+ts2+hc))
# Contact interactions
mod.ContactProperty('Contact-properties')
region1=ass.Surface(side2Faces=insRL.faces, name='Surface-roller-L')
region2=ass.Surface(side1Faces=ins.faces.getByBoundingBox(zMax=0.0), name='Surface-bot')
mod.SurfaceToSurfaceContactStd(name='Contact-L', createStepName='Initial', main=region1, secondary=region2,
sliding=FINITE, thickness=ON, interactionProperty='Contact-properties', adjustMethod=NONE,
initialClearance=OMIT, datumAxis=None, clearanceRegion=None)
region1=ass.Surface(side2Faces=insRR.faces, name='Surface-roller-R')
mod.SurfaceToSurfaceContactStd(name='Contact-R', createStepName='Initial', main=region1, secondary=region2,
sliding=FINITE, thickness=ON, interactionProperty='Contact-properties', adjustMethod=NONE,
initialClearance=OMIT, datumAxis=None, clearanceRegion=None)
region1=ass.Surface(side2Faces=insRC.faces, name='Surface-roller-C')
region2=ass.Surface(side1Faces=ins.faces.getByBoundingBox(zMin=ts1+ts2+hc), name='Surface-top')
mod.SurfaceToSurfaceContactStd(name='Contact-C', createStepName='Initial', main=region1, secondary=region2,
sliding=FINITE, thickness=ON, interactionProperty='Contact-properties', adjustMethod=NONE,
initialClearance=OMIT, datumAxis=None, clearanceRegion=None)
# Constraints and BC, rollers
id = ass.ReferencePoint(point=(-L/2.0, 0.0, -r)).id
regionRPL = ass.Set(name='RPL', referencePoints = (ass.referencePoints[id],))
regionRollerL = ass.surfaces['Surface-roller-L']
mod.RigidBody(name='Constraint-Roller-L', refPointRegion=regionRPL, surfaceRegion=regionRollerL)
mod.EncastreBC(name='BC-FIX-L', createStepName='Initial', region=regionRPL, localCsys=None)
id = ass.ReferencePoint(point=(L/2.0, 0.0, -r)).id
regionRPR = ass.Set(name='RPR', referencePoints = (ass.referencePoints[id],))
regionRollerR = ass.surfaces['Surface-roller-R']
mod.RigidBody(name='Constraint-Roller-R', refPointRegion=regionRPR, surfaceRegion=regionRollerR)
mod.EncastreBC(name='BC-FIX-R', createStepName='Initial', region=regionRPR, localCsys=None)
id = ass.ReferencePoint(point=(0.0, 0.0, r+ts1+ts2+hc)).id
regionRPC = ass.Set(name='RPC', referencePoints = (ass.referencePoints[id],))
regionRollerC = ass.surfaces['Surface-roller-C']
mod.RigidBody(name='Constraint-Roller-C', refPointRegion=regionRPC, surfaceRegion=regionRollerC)
mod.DisplacementBC(name='BC-C', createStepName='Initial', region=regionRPC,
u1=SET, u2=SET, u3=SET, ur1=SET, ur2=SET, ur3=SET,
amplitude=UNSET, distributionType=UNIFORM, fieldName='', localCsys=None)
# BC on specimen
verts = ins.sets['VERTICES-RBX']
mod.DisplacementBC(name='BC-RBX', createStepName='Initial', region=verts, u1=SET)
verts = ins.sets['VERTICES-RBY']
mod.DisplacementBC(name='BC-RBY', createStepName='Initial', region=verts, u2=SET)
# Step and Loading
mod.StaticStep(name='Step-1', previous='Initial', nlgeom=ON)
mod.boundaryConditions['BC-C'].setValuesInStep(stepName='Step-1', u3=-U3)
# Job
job = mdb.Job(name=modelname, model=modelname)
job.submit(consistencyChecking=OFF)