A.12 Forming a channel

gsi_channel_caemodel.py

#
# Getting Started with ABAQUS
#
# Script for forming portion channel example
#
from abaqus import *
from abaqusConstants import *
session.viewports['Viewport: 1'].makeCurrent()
session.viewports['Viewport: 1'].maximize()
session.journalOptions.setValues(replayGeometry=COORDINATE, 
    recoverGeometry=COORDINATE)
from caeModules import *
from driverUtils import executeOnCaeStartup
executeOnCaeStartup()
Mdb()

mdb.models.changeKey(fromName='Model-1', toName='standard')

##
##  Sketch profile of blank
##
s = mdb.models['standard'].ConstrainedSketch(name='__profile__',
    sheetSize=0.25)
g, v, d = s.geometry, s.vertices, s.dimensions
s.sketchOptions.setValues(sheetSize=0.25, gridSpacing=0.005, grid=ON, 
    gridFrequency=2, constructionGeometry=ON, dimensionTextHeight=0.005, 
    decimalPlaces=3)
s.Line(point1=(-0.05, -0.005), point2=(0.05, -0.005))
s.Line(point1=(0.05, -0.005), point2=(0.05, 0.005))
s.Line(point1=(0.05, 0.005), point2=(-0.05, 0.005))
s.Line(point1=(-0.05, 0.005), point2=(-0.05, -0.005))

s.HorizontalDimension(vertex1=v.findAt((-0.05, 0.005)), vertex2=v.findAt((
    0.05, 0.005)), textPoint=(0.0457058809697628, 0.0127279916778207), 
    value=0.1)
s.VerticalDimension(vertex1=v.findAt((-0.05, -0.005)), vertex2=v.findAt((
    -0.05, 0.005)), textPoint=(-0.0521911755204201, 0.000539974775165319), 
    value=0.001)
p = mdb.models['standard'].Part(name='Blank', dimensionality=TWO_D_PLANAR, 
    type=DEFORMABLE_BODY)
p = mdb.models['standard'].parts['Blank']
p.BaseShell(sketch=s)
p = mdb.models['standard'].parts['Blank']
session.viewports['Viewport: 1'].setValues(displayedObject=p)
del mdb.models['standard'].sketches['__profile__']
##
##  Sketch profile of punch
##
s0 = mdb.models['standard'].ConstrainedSketch(name='__profile__', sheetSize=0.25)
g, v, d = s0.geometry, s0.vertices, s0.dimensions
s0.sketchOptions.setValues(sheetSize=0.25, gridSpacing=0.005, grid=ON, 
    gridFrequency=2, constructionGeometry=ON, dimensionTextHeight=0.005, 
    decimalPlaces=3)
s0.Line(point1=(-0.06, 0.0), point2=(0.0, 0.0))
s0.Line(point1=(0.0, 0.0), point2=(0.0, 0.06))
s0.FilletByRadius(radius=0.005, curve1=g.findAt((-0.03, 0.0)), nearPoint1=(
    -0.00207383744418621, 0.000262239947915077), curve2=g.findAt((0.0, 0.03)), 
    nearPoint2=(-0.00016310065984726, 0.00246503762900829))
session.viewports['Viewport: 1'].view.fitView()
mdb.models['standard'].ConstrainedSketch(name='Punch', objectToCopy=s0)
p = mdb.models['standard'].Part(name='Punch', dimensionality=TWO_D_PLANAR, 
    type=ANALYTIC_RIGID_SURFACE)
p = mdb.models['standard'].parts['Punch']
p.AnalyticRigidSurf2DPlanar(sketch=s0)
p = mdb.models['standard'].parts['Punch']
session.viewports['Viewport: 1'].setValues(displayedObject=p)
del mdb.models['standard'].sketches['__profile__']
#
#   Create holder
#
s = mdb.models['standard'].ConstrainedSketch(name='__profile__', 
    sheetSize=0.25)
g, v, d, c = s.geometry, s.vertices, s.dimensions, s.constraints
s.sketchOptions.setValues(decimalPlaces=3)
s.setPrimaryObject(option=STANDALONE)
s.sketchOptions.setValues(gridOrigin=(-0.026910743678459, 0.026910743678459))
s.retrieveSketch(sketch=mdb.models['standard'].sketches['Punch'])
s.mirror(mirrorLine=g.findAt((0.0, 0.0325)), objectList=(g.findAt((-0.0325, 
    0.0)), g.findAt((0.0, 0.0325)), g.findAt((-0.001464, 0.001464))))
p = mdb.models['standard'].Part(name='Holder', dimensionality=TWO_D_PLANAR, 
    type=ANALYTIC_RIGID_SURFACE)
p = mdb.models['standard'].parts['Holder']
p.AnalyticRigidSurf2DPlanar(sketch=s)
s.unsetPrimaryObject()
p = mdb.models['standard'].parts['Holder']
session.viewports['Viewport: 1'].setValues(displayedObject=p)
del mdb.models['standard'].sketches['__profile__']

#
#   Create die
#
s = mdb.models['standard'].ConstrainedSketch(name='__profile__', 
    sheetSize=0.25)
g, v, d, c = s.geometry, s.vertices, s.dimensions, s.constraints
s.sketchOptions.setValues(decimalPlaces=3)
s.setPrimaryObject(option=STANDALONE)
s.sketchOptions.setValues(gridOrigin=(-0.026910743678459, 0.026910743678459))

s.retrieveSketch(sketch=mdb.models['standard'].sketches['Punch'])

s.mirror(mirrorLine=g.findAt((0.0, 0.0325)), objectList=(g.findAt((-0.0325, 
    0.0)), g.findAt((0.0, 0.0325)), g.findAt((-0.001464, 0.001464))))

s.mirror(mirrorLine=g.findAt((0.0325, 0.0)), objectList=(g.findAt((0.0325, 
    0.0)), g.findAt((0.0, 0.0325)), g.findAt((0.001464, 0.001464))))

p = mdb.models['standard'].Part(name='Die', dimensionality=TWO_D_PLANAR, 
    type=ANALYTIC_RIGID_SURFACE)
p = mdb.models['standard'].parts['Die']
p.AnalyticRigidSurf2DPlanar(sketch=s)
s.unsetPrimaryObject()
p = mdb.models['standard'].parts['Die']
session.viewports['Viewport: 1'].setValues(displayedObject=p)
del mdb.models['standard'].sketches['__profile__']
 
##
##  Add reference point to die
##
p = mdb.models['standard'].parts['Die']
e = p.edges
p.ReferencePoint(point=p.InterestingPoint(
    edge=e.findAt(coordinates=(0.003087, -0.000381, 0.0)), rule=CENTER))
##
##  Add reference point to holder
##
p = mdb.models['standard'].parts['Holder']
e = p.edges
p.ReferencePoint(point=p.InterestingPoint(
    edge=e.findAt(coordinates=(0.003087, 0.000381, 0.0)), rule=CENTER))
##
##  Add reference point to punch
##
p = mdb.models['standard'].parts['Punch']
e = p.edges
p.ReferencePoint(point=p.InterestingPoint(
    edge=e.findAt(coordinates=(-0.003087, 0.000381, 0.0)), rule=CENTER))
##
##  Create material 'Steel'
##
mdb.models['standard'].Material('Steel')
mdb.models['standard'].materials['Steel'].Elastic(table=((2.1E11, 0.3), ))
mdb.models['standard'].materials['Steel'].Plastic(table=((400.E6, 0.0), (
    420.E6, 0.02), (500.E6, 0.2), (600.E6, 0.5)))
##
##  Create and assign solid section to blank
##
mdb.models['standard'].HomogeneousSolidSection(name='BlankSection', 
    material='Steel', thickness=1.0)
p = mdb.models['standard'].parts['Blank']
f = p.faces
faces = f.findAt(((-0.016667, -0.004667, 0.0), ))
region = regionToolset.Region(faces=faces)
p = mdb.models['standard'].parts['Blank']
p.SectionAssignment(region=region, sectionName='BlankSection', offset=0.0)
##
##  Define datum coordinate system
##
p = mdb.models['standard'].parts['Blank']
p.DatumCsysByDefault(coordSysType=CARTESIAN)
##
##  Assign material orientation to blank
##
p = mdb.models['standard'].parts['Blank']
f = p.faces
faces = f.findAt(((-0.016667, -0.004667, 0.0), ))
region = regionToolset.Region(faces=faces)
datum = p.datums[3]
p.assignMaterialOrientation(region=region, localCsys=datum)

a = mdb.models['standard'].rootAssembly
session.viewports['Viewport: 1'].setValues(displayedObject=a)
##
##  Set coordinate system (done by default)
##
a = mdb.models['standard'].rootAssembly
a.DatumCsysByDefault(CARTESIAN)
##
##  Instance the blank
##
p = mdb.models['standard'].parts['Blank']
a.Instance(name='Blank-1', part=p, dependent=ON)
a = mdb.models['standard'].rootAssembly
##
##  Instance the punch
##
p = mdb.models['standard'].parts['Punch']
a.Instance(name='Punch-1', part=p, dependent=ON)
##
##  Translate the punch
##
a = mdb.models['standard'].rootAssembly
p = a.instances['Punch-1']
p.translate(vector=(0.116, 0.0, 0.0))
##
##   Edge to edge constraints between punch and blank
##
e11 = a.instances['Punch-1'].edges
e12 = a.instances['Blank-1'].edges
a.EdgeToEdge(movableAxis=e11.findAt(coordinates=(0.06975, 0.0, 0.0)), 
    fixedAxis=e12.findAt(coordinates=(0.025, -0.004, 0.0)), flip=ON, 
    clearance=0.001)
session.viewports['Viewport: 1'].view.fitView()
e11 = a.instances['Punch-1'].edges
e12 = a.instances['Blank-1'].edges
a.EdgeToEdge(movableAxis=e11.findAt(coordinates=(0.116, 0.01575, 0.0)), 
    fixedAxis=e12.findAt(coordinates=(-0.05, -0.00425, 0.0)), flip=ON, 
    clearance=-0.05)
##
##  Instance the holder
##
p = mdb.models['standard'].parts['Holder']
a.Instance(name='Holder-1', part=p, dependent=ON)
p = a.instances['Holder-1']
p.translate(vector=(0.056, 0.0, 0.0))
session.viewports['Viewport: 1'].view.fitView()
##
##   Edge to edge constraints between holder and punch
##
e11 = a.instances['Holder-1'].edges
e12 = a.instances['Punch-1'].edges
a.EdgeToEdge(movableAxis=e11.findAt(coordinates=(0.056, 0.01875, 0.0)), 
    fixedAxis=e12.findAt(coordinates=(0.0, 0.01575, 0.0)), flip=OFF, 
    clearance=0.001)

e11 = a.instances['Holder-1'].edges
e12 = a.instances['Blank-1'].edges
a.EdgeToEdge(movableAxis=e11.findAt(coordinates=(0.04725, 0.0, 0.0)), 
    fixedAxis=e12.findAt(coordinates=(0.025, -0.004, 0.0)), flip=OFF, 
    clearance=0.0)
##
##  Instance the die
##
p = mdb.models['standard'].parts['Die']
a.Instance(name='Die-1', part=p, dependent=ON)
p = a.instances['Die-1']
p.translate(vector=(0.067, 0.0, 0.0))
session.viewports['Viewport: 1'].view.fitView()
##
##   Edge to edge constraints between die and blank (horizontal)
##
e11 = a.instances['Die-1'].edges
e12 = a.instances['Blank-1'].edges
a.EdgeToEdge(movableAxis=e11.findAt(coordinates=(0.067, -0.01875, 0.0)), 
    fixedAxis=e12.findAt(coordinates=(-0.05, -0.00425, 0.0)), flip=OFF, 
    clearance=-0.051)

e11 = a.instances['Die-1'].edges
e12 = a.instances['Blank-1'].edges
a.EdgeToEdge(movableAxis=e11.findAt(coordinates=(0.04725, 0.0, 0.0)), 
    fixedAxis=e12.findAt(coordinates=(-0.025, -0.005, 0.0)), flip=ON, 
    clearance=0.0)

p = a.instances['Blank-1']
p.translate(vector=(0.0, 0.009, 0.0))
##
##  Partition left vertical edge of blank and
##  create geometry set 'MidLeft'
##
p = mdb.models['standard'].parts['Blank']
e = p.edges
pickedEdges = e.findAt(((-0.05, -0.00425, 0.0), ))
p.PartitionEdgeByParam(edges=pickedEdges, parameter=0.5)
a = mdb.models['standard'].rootAssembly
v1 = a.instances['Blank-1'].vertices
a.Set(vertices=v1.findAt(((-0.05, 0.0045, 0.0),),), name='MidLeft')
##
##  Partition right vertical edge of blank and
##  create geometry set 'MidRight'
##
session.viewports['Viewport: 1'].view.fitView()
session.viewports['Viewport: 1'].view.setValues(width=0.016745, 
    height=0.010705, cameraPosition=(0.049619, 0.0054186, 0.34366), 
    cameraTarget=(0.049619, 0.0054186, 0))
p = mdb.models['standard'].parts['Blank']
e = p.edges
pickedEdges = e.findAt(((0.05, -0.00475, 0.0), ))
p.PartitionEdgeByParam(edges=pickedEdges, parameter=0.5)
a = mdb.models['standard'].rootAssembly
v1 = a.instances['Blank-1'].vertices
a.Set(name='MidRight', vertices=v1.findAt(((0.05, 0.0045, 0.0), ), ))

a = mdb.models['standard'].rootAssembly
a.regenerate()

#
#   Create geometry set RefPunch
#
a = mdb.models['standard'].rootAssembly
r1 = a.instances['Punch-1'].referencePoints
refPoints1 = (r1[2], )
a.Set(referencePoints=refPoints1, name='RefPunch')
#
#   Create geometry set RefHolder
#
a = mdb.models['standard'].rootAssembly
r1 = a.instances['Holder-1'].referencePoints
refPoints1 = (r1[2], )
a.Set(referencePoints=refPoints1, name='RefHolder')
#
#   Create geometry set RefDie
#
a = mdb.models['standard'].rootAssembly
r1 = a.instances['Die-1'].referencePoints
refPoints1 = (r1[2], )
a.Set(referencePoints=refPoints1, name='RefDie')
#
#   Reset view
#
session.viewports['Viewport: 1'].view.setValues(width=0.0066561, 
    height=0.0042551, cameraPosition=(-0.048954, 0.0037356, 0.34938), 
    cameraTarget=(-0.048954, 0.0037356, 0))
#
#   Create geometry set Center
#
a = mdb.models['standard'].rootAssembly
e = a.instances['Blank-1'].edges
edges = e.findAt(((-0.05, 0.004875, 0.0), ), ((-0.05, 0.004375, 0.0), ))
a.Set(edges=edges, name='Center')
#
#   Create surface BlankTop
#
a = mdb.models['standard'].rootAssembly
e1 = a.instances['Blank-1'].edges
a.Surface(name='BlankTop', side1Edges=e1.findAt(((0.025, 0.005, 0.0), ), ))
#
#   Create surface BlankBot
#
a = mdb.models['standard'].rootAssembly
e1 = a.instances['Blank-1'].edges
a.Surface(name='BlankBot', side1Edges=e1.findAt(((-0.025, 0.004, 0.0), ), ))

session.viewports['Viewport: 1'].view.fitView()
#
#   Create surface PunchSurf
#
s = a.instances['Punch-1'].edges
side2Edges = s.findAt(((-0.04625, 0.0060, 0.0), ))
a.Surface(side2Edges=side2Edges, name='PunchSurf')

#
#   Create surface HolderSurf
#
s = a.instances['Holder-1'].edges
side1Edges = s.findAt(((0.001, 0.02375, 0.0), ))
a.Surface(side1Edges=side1Edges, name='HolderSurf')

#
#   Create surface DieSurf
#
s = a.instances['Die-1'].edges
side2Edges = s.findAt(((0.001, -0.01475, 0.0), ))
a.Surface(side2Edges=side2Edges, name='DieSurf')

##
##  Create five static general steps
##
mdb.models['standard'].StaticStep(name='Establish contact I', 
    previous='Initial', 
    description='Push the blank holder and die together', timePeriod=1, 
    adiabatic=OFF, maxNumInc=100, stabilization=None, 
    timeIncrementationMethod=AUTOMATIC, 
    initialInc=1, minInc=1e-05, maxInc=1, matrixSolver=SOLVER_DEFAULT, 
    amplitude=RAMP, extrapolation=LINEAR, nlgeom=ON)
session.viewports['Viewport: 1'].assemblyDisplay.setValues(
    step='Establish contact I')
mdb.models['standard'].StaticStep(name='Remove right constraint', 
    previous='Establish contact I', 
    description='Remove the middle constraint at right', timePeriod=1, 
    adiabatic=OFF, maxNumInc=100, stabilization=None, 
    timeIncrementationMethod=AUTOMATIC, 
    initialInc=1, minInc=1e-05, maxInc=1, matrixSolver=SOLVER_DEFAULT, 
    amplitude=RAMP, extrapolation=LINEAR)
session.viewports['Viewport: 1'].assemblyDisplay.setValues(
    step='Remove right constraint')
mdb.models['standard'].StaticStep(name='Holder force', 
    previous='Remove right constraint', 
    description='Apply prescribed force on blank holder', timePeriod=1, 
    adiabatic=OFF, maxNumInc=100, stabilization=None, 
    timeIncrementationMethod=AUTOMATIC, 
    initialInc=1, minInc=1e-05, maxInc=1, matrixSolver=SOLVER_DEFAULT, 
    amplitude=RAMP, extrapolation=LINEAR)
session.viewports['Viewport: 1'].assemblyDisplay.setValues(step='Holder force')
mdb.models['standard'].StaticStep(name='Establish contact II', 
    previous='Holder force', 
    description='Move the punch down a little while applying a small pressure to blank top', 
    timePeriod=1, adiabatic=OFF, maxNumInc=100, stabilization=None, 
    timeIncrementationMethod=AUTOMATIC, initialInc=0.1, 
    minInc=1e-05, maxInc=1, 
    matrixSolver=SOLVER_DEFAULT, amplitude=RAMP, extrapolation=LINEAR)
session.viewports['Viewport: 1'].assemblyDisplay.setValues(
    step='Establish contact II')
mdb.models['standard'].StaticStep(name='Move punch', 
    previous='Establish contact II', 
    description='Full extent', timePeriod=1, 
    adiabatic=OFF, maxNumInc=1000, stabilization=None, 
    timeIncrementationMethod=AUTOMATIC, initialInc=0.0001, 
    minInc=1e-06, maxInc=1, 
    matrixSolver=SOLVER_DEFAULT, amplitude=RAMP, extrapolation=LINEAR)
session.viewports['Viewport: 1'].assemblyDisplay.setValues(
    step='Establish contact I')
##
##  Modify output requests
##
mdb.models['standard'].fieldOutputRequests['F-Output-1'].setValues(
    variables=PRESELECT, frequency=999)
session.viewports['Viewport: 1'].assemblyDisplay.setValues(
    step='Remove right constraint')
del mdb.models['standard'].historyOutputRequests['H-Output-1']
a0=mdb.models['standard'].rootAssembly
regionDef=a0.sets['RefPunch']
mdb.models['standard'].HistoryOutputRequest(name='H-Output-1', 
    createStepName='Establish contact II', 
    variables=('RF1', 'RF2', 'RF3', 'RM1', 'RM2', 'RM3'), 
    region=regionDef)
mdb.models['standard'].fieldOutputRequests['F-Output-1'].setValuesInStep(
    stepName='Move punch', variables=PRESELECT, frequency=20)
##
##  Create degree of freedom monitor
##
mdb.models['standard'].steps['Establish contact I'].Monitor(dof=2, 
    node=regionDef, frequency=1)
mdb.models['standard'].steps['Remove right constraint'].Monitor(dof=2, 
    node=regionDef, frequency=1)
mdb.models['standard'].steps['Holder force'].Monitor(dof=2, 
    node=regionDef, frequency=1)
mdb.models['standard'].steps['Establish contact II'].Monitor(dof=2, 
    node=regionDef, frequency=1)
mdb.models['standard'].steps['Move punch'].Monitor(dof=2, 
    node=regionDef, frequency=1)
##
##  Print diagnostic data for contact
##
mdb.models['standard'].steps['Establish contact I'].DiagnosticPrint(
    frequency=1, contact=ON, plasticity=OFF, residual=ON, solve=OFF)
mdb.models['standard'].steps['Remove right constraint'].DiagnosticPrint(
    frequency=1, contact=ON, plasticity=OFF, residual=ON, solve=OFF)
mdb.models['standard'].steps['Holder force'].DiagnosticPrint(frequency=1, 
    contact=ON, plasticity=OFF, residual=ON, solve=OFF)
mdb.models['standard'].steps['Establish contact II'].DiagnosticPrint(
    frequency=1, contact=ON, plasticity=OFF, residual=ON, solve=OFF)
mdb.models['standard'].steps['Move punch'].DiagnosticPrint(frequency=1, 
    contact=ON, plasticity=OFF, residual=ON, solve=OFF)
##
##  Reset view
##
session.viewports['Viewport: 1'].view.setValues(width=0.025757, 
    height=0.016466, cameraPosition=(-0.04834, 0.0033255, 0.34366), 
    cameraTarget=(-0.04834, 0.0033255, 0))

session.viewports['Viewport: 1'].assemblyDisplay.setValues(interactions=ON)
session.viewports['Viewport: 1'].view.fitView()
session.viewports['Viewport: 1'].assemblyDisplay.setValues(step='Initial')
##
##  Create contact property 'Fric'
##
mdb.models['standard'].ContactProperty('Fric')
mdb.models['standard'].interactionProperties['Fric'].TangentialBehavior(
    formulation=PENALTY, directionality=ISOTROPIC, slipRateDependency=OFF, 
    pressureDependency=OFF, temperatureDependency=OFF, dependencies=0, 
    table=((0.1, ), ), shearStressLimit=None, maximumElasticSlip=FRACTION, 
    fraction=0.005, elasticSlipStiffness=None)
##
##  Create contact property 'NoFric'
##
mdb.models['standard'].ContactProperty('NoFric')
mdb.models['standard'].interactionProperties['NoFric'].TangentialBehavior(
    formulation=FRICTIONLESS)
##
##  Create contact interaction 'Punch-Blank'
##
a0 = mdb.models['standard'].rootAssembly
region1=a0.surfaces['PunchSurf']
a0 = mdb.models['standard'].rootAssembly
region2=a0.surfaces['BlankTop']
mdb.models['standard'].SurfaceToSurfaceContactStd(name='Punch-Blank', 
    createStepName='Establish contact I', master=region1, slave=region2,
    sliding=FINITE, interactionProperty='NoFric', adjustMethod=NONE)
##
##  Create contact interaction 'Holder-Blank'
##
a0 = mdb.models['standard'].rootAssembly
region1=a0.surfaces['HolderSurf']
a0 = mdb.models['standard'].rootAssembly
region2=a0.surfaces['BlankTop']
mdb.models['standard'].SurfaceToSurfaceContactStd(name='Holder-Blank', 
    createStepName='Establish contact I', master=region1, slave=region2,
    sliding=FINITE, interactionProperty='Fric', adjustMethod=NONE)
##
##  Create contact interaction 'Die-Blank'
##
a0 = mdb.models['standard'].rootAssembly
region1=a0.surfaces['DieSurf']
a0 = mdb.models['standard'].rootAssembly
region2=a0.surfaces['BlankBot']
mdb.models['standard'].SurfaceToSurfaceContactStd(name='Die-Blank', 
    createStepName='Establish contact I', master=region1, slave=region2,
    sliding=FINITE, interactionProperty='Fric', adjustMethod=NONE)

session.viewports['Viewport: 1'].assemblyDisplay.setValues(loads=ON, bcs=ON,
    predefinedFields=ON, interactions=OFF)
session.viewports['Viewport: 1'].view.setValues(width=0.02663, height=0.017024, 
    cameraPosition=(-0.050293, 0.0041627, 0.34366), cameraTarget=(-0.050293, 
    0.0041627, 0))
##
##
session.viewports['Viewport: 1'].view.fitView()
##
##  Create BCs in step "Establish contact"
##
session.viewports['Viewport: 1'].assemblyDisplay.setValues(
    step='Establish contact I')
a0 = mdb.models['standard'].rootAssembly
region = a0.sets['MidRight']
mdb.models['standard'].DisplacementBC(name='MidRightBC', 
    createStepName='Establish contact I', region=region, u2=0.0)
a0 = mdb.models['standard'].rootAssembly
region = a0.sets['MidLeft']
mdb.models['standard'].DisplacementBC(name='MidLeftBC', 
    createStepName='Establish contact I', region=region, u2=0.0)
a0 = mdb.models['standard'].rootAssembly
region = a0.sets['Center']
mdb.models['standard'].XsymmBC(name='CenterBC', 
    createStepName='Establish contact I', region=region)
a0 = mdb.models['standard'].rootAssembly
region = a0.sets['RefDie']
mdb.models['standard'].DisplacementBC(name='RefDieBC', 
    createStepName='Establish contact I', region=region, u1=0.0, u2=1e-08, 
    ur3=0.0)
a0 = mdb.models['standard'].rootAssembly
region = a0.sets['RefHolder']
mdb.models['standard'].DisplacementBC(name='RefHolderBC', 
    createStepName='Establish contact I', region=region, u1=0.0, u2=-1e-08, 
    ur3=0.0)
a0 = mdb.models['standard'].rootAssembly
region = a0.sets['RefPunch']
mdb.models['standard'].DisplacementBC(name='RefPunchBC', 
    createStepName='Establish contact I', region=region, 
    u1=0.0, u2=0.0, ur3=0.0)
##
##  Remove MidRight bc in step "Remove right constraint"
##
session.viewports['Viewport: 1'].assemblyDisplay.setValues(
    step='Remove right constraint')
mdb.models['standard'].boundaryConditions['MidRightBC'].deactivate(
    'Remove right constraint')
##
##  Replace holder bcs with bcs and cload in step "Holder force"
##
session.viewports['Viewport: 1'].assemblyDisplay.setValues(step='Holder force')
mdb.models['standard'].boundaryConditions['RefHolderBC'].setValuesInStep(
    stepName='Holder force', u2=FREED)
##
a0 = mdb.models['standard'].rootAssembly
region = a0.sets['RefHolder']
mdb.models['standard'].ConcentratedForce(name='RefHolderForce', 
    createStepName='Holder force', region=region, cf2=-440000.0)
##
##  Push punch down slightly, remove midleft bc, and add small 
##  pressure to top of blank in step  "Establish contact (punch and blank)"
##
session.viewports['Viewport: 1'].assemblyDisplay.setValues(
    step='Establish contact II')
mdb.models['standard'].boundaryConditions['RefPunchBC'].setValuesInStep(
    stepName='Establish contact II', u2=-1.E-3)
mdb.models['standard'].boundaryConditions['MidLeftBC'].deactivate(
    'Establish contact II')
a0 = mdb.models['standard'].rootAssembly
region = a0.surfaces['BlankTop']
mdb.models['standard'].Pressure(name='Small pressure', 
    createStepName='Establish contact II', region=region, 
    magnitude=-1000.0)
##
##  Push punch down and remove pressure in step  "Move punch"
##
session.viewports['Viewport: 1'].assemblyDisplay.setValues(step='Move punch')
mdb.models['standard'].boundaryConditions['RefPunchBC'].setValuesInStep(
    stepName='Move punch', u2=-0.031)
mdb.models['standard'].loads['Small pressure'].deactivate('Move punch')

session.viewports['Viewport: 1'].assemblyDisplay.setValues(mesh=ON, loads=OFF,
    bcs=OFF, predefinedFields=OFF)
session.viewports['Viewport: 1'].assemblyDisplay.meshOptions.setValues(
    meshTechnique=ON)
session.viewports['Viewport: 1'].view.fitView()
##
##  Assign edge seeds
##
p = mdb.models['standard'].parts['Blank']
e = p.edges
pickedEdges = e.findAt(((-0.025, -0.005, 0.0), ), ((0.025, -0.004, 0.0), ))
p.seedEdgeByNumber(edges=pickedEdges, number=100)
pickedEdges = e.findAt(((-0.05, -0.004125, 0.0), ), ((-0.05, -0.004625, 0.0), 
    ), ((0.05, -0.004875, 0.0), ), ((0.05, -0.004375, 0.0), ))
p.seedEdgeByNumber(edges=pickedEdges, number=2)
##
##  Assign element type
##
elemType1 = mesh.ElemType(elemCode=CPE4R, elemLibrary=STANDARD, 
    secondOrderAccuracy=OFF, hourglassControl=ENHANCED, distortionControl=OFF)
elemType2 = mesh.ElemType(elemCode=CPE3, elemLibrary=STANDARD)
f = p.faces
faces = f
pickedRegions =(faces, )
p.setElementType(regions=pickedRegions, elemTypes=(elemType1, elemType2))
##
##  Use structured meshing
##
f = p.faces
pickedRegions = f.findAt(((0.016667, -0.004167, 0.0), ))
p.setMeshControls(regions=pickedRegions, technique=STRUCTURED)
##
##  Generate mesh
##
p.generateMesh()
session.viewports['Viewport: 1'].assemblyDisplay.geometryOptions.setValues(
    geometryEdgesInShaded=OFF, datumPoints=OFF, datumAxes=OFF, datumPlanes=OFF,
    datumCoordSystems=OFF)

session.viewports['Viewport: 1'].assemblyDisplay.setValues(mesh=OFF)
session.viewports['Viewport: 1'].assemblyDisplay.meshOptions.setValues(
    meshTechnique=OFF)
##
##  Create job
##
mdb.Job(name='Channel', model='standard', 
    description='Analysis of the forming of a channel-static')
##
##  Save model database
##
mdb.saveAs('Channel')
##

##
##  Create explicit dynamics model
##
mdb.Model(name='explicit', objectToCopy=mdb.models['standard'])
#: The model "explicit" has been created.

p = mdb.models['explicit'].parts['Blank']
session.viewports['Viewport: 1'].setValues(displayedObject=p)

##
##  add density
##
mdb.models['explicit'].materials['Steel'].Density(table=((7800.0, ), ))

p = mdb.models['explicit'].parts['Holder']
session.viewports['Viewport: 1'].setValues(displayedObject=p)

##
##  add point mass to holder
##
r = p.referencePoints
refPoints=(r[2], )
region = regionToolset.Region(referencePoints=refPoints)
mdb.models['explicit'].parts['Holder'].engineeringFeatures.PointMassInertia(
    name='mass', region=region, mass=0.1, alpha=0.0,
    composite=0.0)

a = mdb.models['explicit'].rootAssembly
session.viewports['Viewport: 1'].setValues(displayedObject=a)

##
##  remove clearance between blank and punch
##
a.features['Edge to Edge-1'].setValues(clearance=0.0)

session.viewports['Viewport: 1'].assemblyDisplay.setValues(
    step='Establish contact I')
session.viewports['Viewport: 1'].view.fitView()

##
##  delete dummy bcs
##
del mdb.models['explicit'].boundaryConditions['MidLeftBC']
del mdb.models['explicit'].boundaryConditions['MidRightBC']

##
##  move holder force to first step
##
mdb.models['explicit'].loads['RefHolderForce'].move('Holder force', 
    'Establish contact I')

##
##  delete all but first step
##
del mdb.models['explicit'].steps['Remove right constraint']
del mdb.models['explicit'].steps['Holder force']
del mdb.models['explicit'].steps['Establish contact II']
del mdb.models['explicit'].steps['Move punch']

##
##  rename first step
##
mdb.models['explicit'].steps.changeKey(fromName='Establish contact I', 
    toName='Apply holder force')
session.viewports['Viewport: 1'].assemblyDisplay.setValues(
    step='Apply holder force')

##
##  define set containing blank
##
f1 = a.instances['Blank-1'].faces
faces1 = f1.findAt(((-0.016667, 0.004167, 0.0), ))
a.Set(faces=faces1, name='blank')

##
##  replace the remaining static step with an explicit dynamics step
##
mdb.models['explicit'].ExplicitDynamicsStep(name='Apply holder force', 
    previous='Initial', maintainAttributes=TRUE, timePeriod=0.0001)

##
##  create a second explicit dynamics step
##
mdb.models['explicit'].ExplicitDynamicsStep(name='Displace punch', 
    previous='Apply holder force', timePeriod=0.007)

##
##  define mass scaling
##
regionDef=mdb.models['explicit'].rootAssembly.sets['blank']
mdb.models['explicit'].steps['Apply holder force'].setValues(massScaling=((
    SEMI_AUTOMATIC, regionDef, AT_BEGINNING, 5.0, 0.0, None, 0, 0, 0.0, 
    0.0, 0, None), ))

##
##  request RF2, U2 history output for punch reference point
##
regionDef=mdb.models['explicit'].rootAssembly.sets['RefPunch']
mdb.models['explicit'].HistoryOutputRequest(name='H-Output-2', 
    createStepName='Apply holder force', variables=('U2', 'RF2'),
    region=regionDef, sectionPoints=DEFAULT, rebar=EXCLUDE)

##
##  define smooth step amplitude curves
##
mdb.models['explicit'].SmoothStepAmplitude(name='smooth1', timeSpan=STEP,
    data=((0.0, 0.0), (0.0001, 1.0)))
mdb.models['explicit'].SmoothStepAmplitude(name='smooth2', timeSpan=STEP,
    data=((0.0, 0.0), (0.007, 1.0)))
##
##  fix the die in the 2-direction
##
session.viewports['Viewport: 1'].assemblyDisplay.setValues(
    step='Apply holder force')
mdb.models['explicit'].boundaryConditions['RefDieBC'].setValues(u2=0.0)

##
##  use smooth step amplitude for holder force
##
mdb.models['explicit'].loads['RefHolderForce'].setValues(amplitude='smooth1')

##
##  unset dof 2 for the holder (force is applied instead)
##
session.viewports['Viewport: 1'].assemblyDisplay.setValues(
    step='Displace punch')

mdb.models['explicit'].boundaryConditions['RefHolderBC'].setValues(u2=UNSET)

##
##  adjust displacement bc for punch to account for no clearance
##  use smooth step amplitude
##
mdb.models['explicit'].boundaryConditions['RefPunchBC'].setValuesInStep(
    stepName='Displace punch', u2=-0.030, amplitude='smooth2')

session.viewports['Viewport: 1'].assemblyDisplay.setValues(mesh=ON)
session.viewports['Viewport: 1'].assemblyDisplay.meshOptions.setValues(
    meshTechnique=ON)
elemType1 = mesh.ElemType(elemCode=CPE4R, elemLibrary=EXPLICIT, 
    secondOrderAccuracy=OFF, hourglassControl=ENHANCED, distortionControl=OFF)
elemType2 = mesh.ElemType(elemCode=CPE3, elemLibrary=EXPLICIT)

p = mdb.models['explicit'].parts['Blank']
f = p.faces
faces = f
pickedRegions =(faces, )
p.setElementType(regions=pickedRegions, elemTypes=(elemType1, elemType2))

a.regenerate()
p.generateMesh()

##
##  create job
##
mdb.Job(name='expChannel', model='explicit', 
    description='Analysis of the forming of a channel-quasistatic')

a = mdb.models['standard'].rootAssembly
a.regenerate()
a = mdb.models['explicit'].rootAssembly
a.regenerate()

mdb.save()

gsi_channel_caemodel_spring.py

#
# Getting Started with ABAQUS
#
# Script for springback portion of channel example
#
from abaqus import *
from abaqusConstants import *
session.viewports['Viewport: 1'].makeCurrent()
session.viewports['Viewport: 1'].maximize()
session.journalOptions.setValues(replayGeometry=COORDINATE, 
    recoverGeometry=COORDINATE)
from caeModules import *
from driverUtils import executeOnCaeStartup
executeOnCaeStartup()
Mdb()

a = mdb.models['Model-1'].rootAssembly
session.viewports['Viewport: 1'].setValues(displayedObject=a)
openMdb('Channel.cae')
a = mdb.models['explicit'].rootAssembly
session.viewports['Viewport: 1'].setValues(displayedObject=a)

##
##  Springback analysis model
##

mdb.Model(name='import', objectToCopy=mdb.models['explicit'])

a = mdb.models['import'].rootAssembly
session.viewports['Viewport: 1'].setValues(displayedObject=a)

a.deleteFeatures(('Punch-1', 'Holder-1', 'Die-1', ))
del mdb.models['import'].rootAssembly.sets['RefDie']
del mdb.models['import'].rootAssembly.sets['RefHolder']
del mdb.models['import'].rootAssembly.sets['RefPunch']
del mdb.models['import'].rootAssembly.surfaces['BlankBot']
del mdb.models['import'].rootAssembly.surfaces['BlankTop']
del mdb.models['import'].rootAssembly.surfaces['DieSurf']
del mdb.models['import'].rootAssembly.surfaces['HolderSurf']
del mdb.models['import'].rootAssembly.surfaces['PunchSurf']
del mdb.models['import'].steps['Displace punch']
del mdb.models['import'].steps['Apply holder force']

region = a.sets['Center']
mdb.models['import'].XsymmBC(name='BC-1', createStepName='Initial', 
    region=region)

region = a.sets['MidLeft']
mdb.models['import'].VelocityBC(name='BC-2', createStepName='Initial', 
    region=region, v1=UNSET, v2=SET, vr3=UNSET, amplitude=UNSET, 
    distributionType=UNIFORM, localCsys=None)

mdb.models['import'].StaticStep(name='springback', previous='Initial', 
    initialInc=0.1, nlgeom=ON, stabilizationMagnitude=0.0002, 
    stabilizationMethod=DISSIPATED_ENERGY_FRACTION)

instances=(a.instances['Blank-1'], )
mdb.models['import'].InitialState(updateReferenceConfiguration=OFF, 
    fileName='expChannel', endStep=LAST_STEP, endIncrement=STEP_END, 
    name='Field-1', createStepName='Initial', instances=instances)

mdb.Job(name='springback', model='import', 
    description='Analysis of the forming of a channel-springback')

a = mdb.models['import'].rootAssembly
a.regenerate()

mdb.save()