A.7 Stress wave propagation in a bar

gxi_stresswave_caemodel.py

#
# Getting Started with ABAQUS
#
# Replay file for stress wave in a bar example
#
from abaqus import *
from abaqusConstants import *
session.Viewport(name='Viewport: 1', origin=(1.5625, 1.5625), width=230.0, 
    height=155.0)
session.viewports['Viewport: 1'].makeCurrent()
from driverUtils import executeOnCaeStartup
executeOnCaeStartup()
Mdb()
#: A new model database has been created.
#: The model "Model-1" has been created.
import part
import regionToolset
import displayGroupMdbToolset as dgm
#: Part module loaded
s = mdb.models['Model-1'].Sketch(name='__profile__', sheetSize=1.0)
g, v, d = s.geometry, s.vertices, s.dimensions
s.sketchOptions.setValues(sheetSize=1.0, gridSpacing=0.02, grid=ON,     gridFrequency=2, constructionGeometry=ON, dimensionTextHeight=0.02,     decimalPlaces=2)
s.rectangle(point1=(-0.1, -0.1), point2=(0.1, 0.1))
s.HorizontalDimension(vertex1=v[2], vertex2=v[4], textPoint=(    0.0884268581867218, 0.151511877775192))
s.VerticalDimension(vertex1=v[4], vertex2=v[6], textPoint=(0.176853746175766,     -0.0846525430679321))
p = mdb.models['Model-1'].Part(name='Bar', dimensionality=THREE_D,     type=DEFORMABLE_BODY)
p = mdb.models['Model-1'].parts['Bar']
p.BaseSolidExtrude(sketch=s, depth=1.0)
p = mdb.models['Model-1'].parts['Bar']
session.viewports['Viewport: 1'].setValues(displayedObject=p)
del mdb.models['Model-1'].sketches['__profile__']
session.viewports['Viewport: 1'].partDisplay.setValues(renderStyle=SHADED)
import material
import section
import regionToolset
import displayGroupMdbToolset as dgm
#: Property module loaded
mdb.models['Model-1'].Material('Steel')
mdb.models['Model-1'].materials['Steel'].Density(table=((7800.0, ), ))
mdb.models['Model-1'].materials['Steel'].Elastic(table=((207.0E9, 0.3), ))
mdb.models['Model-1'].HomogeneousSolidSection(name='BarSection',     material='Steel', thickness=1.0)
p0 = mdb.models['Model-1'].parts['Bar']
c = p0.cells
cells = c.findAt(((-0.1, -0.0333333333333, 0.333333333333),),)
region =(None, None, None, cells)
p0 = mdb.models['Model-1'].parts['Bar']
p0.SectionAssignment(region=region, sectionName='BarSection')
#: The section "BarSection" has been assigned to the selected regions.
import assembly
import regionToolset
import displayGroupMdbToolset as dgm
#: Assembly module loaded
a = mdb.models['Model-1'].rootAssembly
session.viewports['Viewport: 1'].setValues(displayedObject=a)
a = mdb.models['Model-1'].rootAssembly
a.DatumCsysByDefault(CARTESIAN)
p = mdb.models['Model-1'].parts['Bar']
a.Instance(name='Bar-1', part=p, dependent=ON)
session.viewports['Viewport: 1'].assemblyDisplay.setValues(renderStyle=SHADED)
a = mdb.models['Model-1'].rootAssembly
e1 = a.instances['Bar-1'].edges
edges1 = e1.findAt(((0.1, 0.1, 0.25), ))
a.Set(edges=edges1, name='out')
#: The set "out" has been created.
a = mdb.models['Model-1'].rootAssembly
f1 = a.instances['Bar-1'].faces
faces1 = f1.findAt(((-0.1, 0.0333333333333333, 0.666666666666667), ))
a.Set(faces=faces1, name='back')
#: The set "back" has been created.
a = mdb.models['Model-1'].rootAssembly
f1 = a.instances['Bar-1'].faces
faces1 = f1.findAt(((0.1, -0.0333333333333333, 0.666666666666667), ))
a.Set(faces=faces1, name='front')
#: The set "front" has been created.
a = mdb.models['Model-1'].rootAssembly
f1 = a.instances['Bar-1'].faces
faces1 = f1.findAt(((-0.0333333333333333, -0.1, 0.666666666666667), ))
a.Set(faces=faces1, name='bot')
#: The set "bot" has been created.
a = mdb.models['Model-1'].rootAssembly
f1 = a.instances['Bar-1'].faces
faces1 = f1.findAt(((0.0333333333333333, 0.1, 0.666666666666667), ))
a.Set(faces=faces1, name='top')
#: The set "top" has been created.
a = mdb.models['Model-1'].rootAssembly
f1 = a.instances['Bar-1'].faces
faces1 = f1.findAt(((0.0333333333333333, -0.0333333333333333, 0.0), ))
a.Set(faces=faces1, name='fix')
#: The set "fix" has been created.
a = mdb.models['Model-1'].rootAssembly
s1 = a.instances['Bar-1'].faces
side1Faces1 = s1.findAt(((-0.0333333333333333, -0.0333333333333333, 1.0), ))
a.Surface(side1Faces=side1Faces1, name='load')
#: The surface "load" has been created.
import step
import regionToolset
import displayGroupMdbToolset as dgm
#: Step module loaded
mdb.models['Model-1'].ExplicitDynamicsStep(name='BlastLoad',     previous='Initial', description="""Apply pressure load pulse""", timePeriod=0.0002,     adiabatic=OFF, timeIncrementationMethod=AUTOMATIC_GLOBAL, scaleFactor=1,     maxIncrement=None, massScaling=PREVIOUS_STEP, linearBulkViscosity=0.06,     quadBulkViscosity=0.0)
session.viewports['Viewport: 1'].assemblyDisplay.setValues(step='BlastLoad')
mdb.models['Model-1'].fieldOutputRequests['F-Output-1'].setValues(
    numIntervals=4)
del mdb.models['Model-1'].historyOutputRequests['H-Output-1']
regionDef=mdb.models['Model-1'].rootAssembly.sets['out']
mdb.models['Model-1'].HistoryOutputRequest(name='H-Output-1', 
    createStepName='BlastLoad', variables=('S33', ), timeInterval=1e-06, 
    region=regionDef)
import load
import regionToolset
import displayGroupMdbToolset as dgm
#: Load module loaded
session.viewports['Viewport: 1'].assemblyDisplay.setValues(loads=ON, bcs=ON,
    fields=ON)
session.viewports['Viewport: 1'].view.setValues(session.views['Iso'])
a = mdb.models['Model-1'].rootAssembly
region = a.sets['fix']
mdb.models['Model-1'].DisplacementBC(name='Fix right end', createStepName='Initial',     region=region, u1=0.0, u2=0.0, u3=0.0)
a = mdb.models['Model-1'].rootAssembly
region = a.sets['back']
mdb.models['Model-1'].DisplacementBC(name='Restrain back face', createStepName='Initial',     region=region, u1=0.0)
a = mdb.models['Model-1'].rootAssembly
region = a.sets['front']
mdb.models['Model-1'].DisplacementBC(name='Restrain front face', createStepName='Initial',     region=region, u1=0.0)
a = mdb.models['Model-1'].rootAssembly
region = a.sets['bot']
mdb.models['Model-1'].DisplacementBC(name='Restrain bottom face', createStepName='Initial',     region=region, u2=0.0)
a = mdb.models['Model-1'].rootAssembly
region = a.sets['top']
mdb.models['Model-1'].DisplacementBC(name='Restrain top face', createStepName='Initial',     region=region, u2=0.0)
mdb.models['Model-1'].TabularAmplitude(name='Blast', timeSpan=STEP,     smooth=0.25, data=((0.0, 1.0), (3.88e-05, 1.0), (3.89e-05, 0.0), (3.9e-05,     0.0)))
a = mdb.models['Model-1'].rootAssembly
region = a.surfaces['load']
mdb.models['Model-1'].Pressure(name='Blast load', createStepName='BlastLoad',     region=region, magnitude=1.0E5, amplitude='Blast')
import mesh
import regionToolset
import displayGroupMdbToolset as dgm
#: Mesh module loaded
session.viewports['Viewport: 1'].assemblyDisplay.setValues(mesh=ON, loads=OFF,
    bcs=OFF, fields=OFF)
session.viewports['Viewport: 1'].assemblyDisplay.meshOptions.setValues(
    meshTechnique=ON)
p = mdb.models['Model-1'].parts['Bar']
p.seedPart(size=0.02)
#: Global seeds have been assigned.
elemType1 = mesh.ElemType(elemCode=C3D8R, elemLibrary=EXPLICIT, 
    kinematicSplit=AVERAGE_STRAIN, hourglassControl=RELAX_STIFFNESS)
elemType2 = mesh.ElemType(elemCode=C3D6, elemLibrary=EXPLICIT)
elemType3 = mesh.ElemType(elemCode=C3D4, elemLibrary=EXPLICIT)
c1 = p.cells
cells1 = c1.findAt(((-0.1, -0.0333333333333, 0.333333333333),),)
regions =(None, None, None, cells1)
p.setElementType(regions=regions, elemTypes=(elemType1, elemType2, elemType3))
p.generateMesh()
import job
#: Job module loaded
session.viewports['Viewport: 1'].assemblyDisplay.setValues(mesh=OFF)
session.viewports['Viewport: 1'].assemblyDisplay.meshOptions.setValues(
    meshTechnique=OFF)
mdb.Job(name='Bar', model='Model-1', description='Stress wave propagation in a bar (SI units)')
a = mdb.models['Model-1'].rootAssembly
a.regenerate()
mdb.saveAs('Bar')