A.1 Overhead hoist frame

gsi_frame_caemodel.py

#
# Getting Started with ABAQUS
#
# Script for frame example
#
#

from abaqus import *
from abaqusConstants import *
session.journalOptions.setValues(replayGeometry=COORDINATE, 
    recoverGeometry=COORDINATE)
session.Viewport(name='Viewport: 1', origin=(1.3671875, 1.3671875), 
    width=201.25, height=135.625)
session.viewports['Viewport: 1'].makeCurrent()
Mdb()
mdb.models.changeKey(fromName='Model-1', toName='standard')
##
##  Switch to the part module
##
import part
import regionToolset
import displayGroupMdbToolset as dgm
##
##  Sketch profile of frame
##
s = mdb.models['standard'].Sketch(name='__profile__', sheetSize=4.0)
g, v, d = s.geometry, s.vertices, s.dimensions
s.sketchOptions.setValues(sheetSize=4.0, gridSpacing=0.1, grid=ON, 
    gridFrequency=2, constructionGeometry=ON, dimensionTextHeight=0.1, 
    decimalPlaces=2)
s.setPrimaryObject(option=STANDALONE)
##
##  Create points
##
s.Spot(point=(-1.0, 0.0))
s.Spot(point=(0.0, 0.0))
s.Spot(point=(1.0, 0.0))
##
##  Create angular construction lines
##
s.AngularConstructionLine(point=(-1.0, 0.0), angle=60.0)
s.AngularConstructionLine(point=(0.0, 0.0), angle=60.0)
s.AngularConstructionLine(point=(0.0, 0.0), angle=120.0)
s.AngularConstructionLine(point=(1.0, 0.0), angle=120.0)
##
##  Create lines
##
s.Line(point1=(-1.0, 0.0), point2=(0.0, 0.0))
s.Line(point1=(0.0, 0.0), point2=(1.0, 0.0))
s.Line(point1=(1.0, 0.0), point2=(0.5, 0.866025403784439))
s.Line(point1=(0.5, 0.866025403784439), point2=(-0.499999999999679, 
    0.866025403783884))
s.Line(point1=(-0.499999999999679, 0.866025403783884), point2=(-1.0, 0.0))
s.Line(point1=(-0.499999999999679, 0.866025403783884), point2=(0.0, 0.0))
s.Line(point1=(0.0, 0.0), point2=(0.5, 0.866025403784439))
p = mdb.models['standard'].Part(name='Frame', dimensionality=TWO_D_PLANAR, 
    type=DEFORMABLE_BODY)
p = mdb.models['standard'].parts['Frame']
p.BaseWire(sketch=s)
s.unsetPrimaryObject()
p = mdb.models['standard'].parts['Frame']
session.viewports['Viewport: 1'].setValues(displayedObject=p)
del mdb.models['standard'].sketches['__profile__']
##
##  Switch to the property module
##
import material
import section
##
##  Create material 'Steel'
##
mdb.models['standard'].Material('Steel')
mdb.models['standard'].materials['Steel'].Elastic(table=((200.E9, 0.3), ))
##
##  Create truss section
##
mdb.models['standard'].TrussSection(name='FrameSection', material='Steel', 
    area=1.963E-05)
##
##  Assign truss section
##
p0 = mdb.models['standard'].parts['Frame']
e = p0.edges
region=(None, 
    e.findAt(((0.25, 0.0, 0.0), ), 
    ((0.875, 0.21650635094611, 0.0), ), 
    ((-0.75, 0.0, 0.0), ), 
    ((0.125, 0.21650635094611, 0.0), ), 
    ((-0.624999999999759, 0.649519052837913, 0.0), ), 
    ((0.25000000000008, 0.8660254037843, 0.0), ), 
    ((-0.374999999999759, 0.649519052837913, 0.0), ), ), None, None)
p0 = mdb.models['standard'].parts['Frame']
p0.SectionAssignment(region=region, sectionName='FrameSection')
##
##  Switch to the assembly module
##
import assembly
import part
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 frame
##
p = mdb.models['standard'].parts['Frame']
a.Instance(name='Frame-1', part=p, dependent=ON)
##
##  Switch to the step module
##
import step
##
##  Create a static linear perturbation step
##
mdb.models['standard'].StaticLinearPerturbationStep(name='Apply load', 
    previous='Initial', description="""10kN central load""", 
    matrixSolver=SOLVER_DEFAULT)
session.viewports['Viewport: 1'].assemblyDisplay.setValues(step='Apply load')
mdb.models['standard'].fieldOutputRequests['F-Output-1'].setValues(
    variables=PRESELECT, region=MODEL)
##
##  Switch to load module
##
import load
session.viewports['Viewport: 1'].assemblyDisplay.setValues(loads=ON, bcs=ON,
    fields=ON)
##
##  Apply concentrated force to bottom center
##
a = mdb.models['standard'].rootAssembly
v1 = a.instances['Frame-1'].vertices
region=((v1.findAt(((0.0, 0.0, 0.0), ), ), ), )
mdb.models['standard'].ConcentratedForce(name='Force', 
    createStepName='Apply load', 
    region=region, cf2=-10000.0)
session.viewports['Viewport: 1'].assemblyDisplay.geometryOptions.setValues(
    geometryEdgesInShaded=OFF, datumPoints=OFF, datumAxes=OFF, datumPlanes=OFF,
    datumCoordSystems=OFF)
##
##  Apply encastre bc to bottom left corner
##
a = mdb.models['standard'].rootAssembly
v1 = a.instances['Frame-1'].vertices
region=(v1.findAt(((-1.0, 0.0, 0.0), ), ), None, None, None)
mdb.models['standard'].EncastreBC(name='Fixed', createStepName='Initial', 
    region=region)
##
##  Apply roller bc to bottom right corner
##
a = mdb.models['standard'].rootAssembly
v1 = a.instances['Frame-1'].vertices
region=(v1.findAt(((1.0, 0.0, 0.0), ), ), None, None, None)
mdb.models['standard'].DisplacementBC(name='Roller', 
    createStepName='Initial', region=region, u2=0.0)
##
##  Switch to mesh module
##
import mesh
session.viewports['Viewport: 1'].assemblyDisplay.setValues(mesh=ON, loads=OFF,
    bcs=OFF, fields=OFF)
session.viewports['Viewport: 1'].assemblyDisplay.meshOptions.setValues(
    meshTechnique=ON)
##
##  Assign global seed
##
p = mdb.models['standard'].parts['Frame']
p.seedPart(size=1.0)
##
##  Assign element type
##
elemType1 = mesh.ElemType(elemCode=T2D2)
e = p.edges
regions=(None, 
    e.findAt(((0.25, 0.0, 0.0), ), ((0.875, 0.21650635094611, 0.0), ), 
    ((-0.75, 0.0, 0.0), ), ((0.125, 0.21650635094611, 0.0), ), 
    ((-0.624999999999759, 0.649519052837913, 0.0), ), 
    ((0.25000000000008, 0.8660254037843, 0.0), ), 
    ((-0.374999999999759, 0.649519052837913, 0.0), ), ), None, None)
p.setElementType(regions=regions, elemTypes=(elemType1, ))
##
##  Generate mesh
##
p.generateMesh()
##
##  Switch to job module
##
import job
session.viewports['Viewport: 1'].assemblyDisplay.setValues(mesh=OFF)
session.viewports['Viewport: 1'].assemblyDisplay.meshOptions.setValues(
    meshTechnique=OFF)
##
##  Create job
##
mdb.Job(name='Frame', model='standard', 
    description='Two-dimensional overhead hoist frame')
mdb.jobs['Frame'].setValues(echoPrint=ON, modelPrint=ON, contactPrint=ON, 
    historyPrint=ON)
##
##  Save model database
##
mdb.saveAs('Frame')

##
##  Create explicit dynamics model
##
mdb.Model(name='explicit', objectToCopy=mdb.models['standard'])

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

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

##
##  replace static step with explicit dynamics step
##  add new history output requests
##
mdb.models['explicit'].ExplicitDynamicsStep(name='Apply load', 
    previous='Initial', maintainAttributes=TRUE, timePeriod=0.01)

v1 = a.instances['Frame-1'].vertices
verts1 = v1.findAt(((0.0, 0.0, 0.0), ))
a.Set(vertices=verts1, name='Center')
#: The set 'Center' has been created (1 vertex).
regionDef=mdb.models['explicit'].rootAssembly.sets['Center']
mdb.models['explicit'].HistoryOutputRequest(name='H-Output-2', 
    createStepName='Apply load', variables=('U1', 'U2', 'U3', 'UR1', 'UR2', 
    'UR3'), region=regionDef, sectionPoints=DEFAULT, rebar=EXCLUDE)
##
#  change element library to EXPLICIT
##
elemType1 = mesh.ElemType(elemCode=T2D2, elemLibrary=EXPLICIT)
p = mdb.models['explicit'].parts['Frame']
e = p.edges
regions=(None, 
    e.findAt(((0.25, 0.0, 0.0), ), ((0.875, 0.21650635094611, 0.0), ), 
    ((-0.75, 0.0, 0.0), ), ((0.125, 0.21650635094611, 0.0), ), 
    ((-0.624999999999759, 0.649519052837913, 0.0), ), 
    ((0.25000000000008, 0.8660254037843, 0.0), ), 
    ((-0.374999999999759, 0.649519052837913, 0.0), ), ), None, None)
p.setElementType(regions=regions, elemTypes=(elemType1, ))

##
##  create job
##
mdb.Job(name='expFrame', model='explicit', type=ANALYSIS, 
    description='Two-dimensional overhead hoist frame-explicit dynamics')

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

mdb.save()