gsi_mount_caemodel.py
#
# Getting Started with ABAQUS
#
# Script for rubber mount 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()
##
## Switch to the part module
##
import part
##
## Sketch profile of the mount
##
s = mdb.models['Model-1'].Sketch(name='__profile__', sheetSize=0.3)
g, v, d = s.geometry, s.vertices, s.dimensions
s.sketchOptions.setValues(sheetSize=0.3, gridSpacing=0.005, grid=ON,
gridFrequency=2, constructionGeometry=ON, dimensionTextHeight=0.005,
decimalPlaces=3, viewStyle=AXISYM)
s.ObliqueConstructionLine(point1=(0.0, -0.15), point2=(0.0, 0.15))
s.Spot(point=(0.01, 0.0))
s.Spot(point=(0.06, 0.0))
s.Spot(point=(0.01, 0.005))
s.Spot(point=(0.06, 0.005))
s.Spot(point=(0.01, 0.03))
s.Spot(point=(0.1, 0.03))
s.HorizontalConstructionLine(point=(0.01, 0.03))
s.ConstructionCircleByCenterPerimeter(center=(0.1, 0.03), point1=(0.06, 0.005))
s.HorizontalDimension(vertex1=v[4], vertex2=v[6], textPoint=(
0.0573202632367611, -0.0174999982118607))
s.VerticalDimension(vertex1=v[12], vertex2=v[4], textPoint=(
-0.0113071873784065, 0.00102941319346428))
s.RadialDimension(curve=g[20], textPoint=(0.0898039191961288,
0.0046895444393158))
s.VerticalDimension(vertex1=v[4], vertex2=v[8], textPoint=(
0.00058823823928833, 0.0056045763194561))
s.HorizontalDimension(vertex1=v[1], vertex2=v[12], textPoint=(
0.00859477370977402, 0.042663399130106))
s.Line(point1=(0.06, 0.005), point2=(0.06, 0.0))
s.Line(point1=(0.06, 0.0), point2=(0.01, 0.0))
s.Line(point1=(0.01, 0.0), point2=(0.01, 0.005))
s.Line(point1=(0.01, 0.005), point2=(0.01, 0.03))
s.Line(point1=(0.01, 0.03), point2=(0.052830094339717, 0.03))
s.ArcByCenterEnds(center=(0.1, 0.03), point1=(0.06, 0.005), point2=(
0.052830094339717, 0.03))
p = mdb.models['Model-1'].Part(name='Mount', dimensionality=AXISYMMETRIC,
type=DEFORMABLE_BODY)
p = mdb.models['Model-1'].parts['Mount']
p.BaseShell(sketch=s)
p = mdb.models['Model-1'].parts['Mount']
session.viewports['Viewport: 1'].setValues(displayedObject=p)
del mdb.models['Model-1'].sketches['__profile__']
##
## Switch to the property module
##
import material
import section
##
## Create material 'Rubber'
##
mdb.models['Model-1'].Material('Rubber')
mdb.models['Model-1'].materials['Rubber'].Hyperelastic(type=POLYNOMIAL,
table=())
mdb.models['Model-1'].materials['Rubber'].hyperelastic.UniaxialTestData(table=((
0.054E6, 0.0380), (0.152E6, 0.1338), (0.254E6, 0.2210), (0.362E6, 0.3450),
(0.459E6, 0.4600), (0.583E6, 0.6242), (0.656E6, 0.8510), (0.730E6,
1.4268)))
mdb.models['Model-1'].materials['Rubber'].hyperelastic.BiaxialTestData(table=((
0.089E6, 0.0200), (0.255E6, 0.1400), (0.503E6, 0.4200), (0.958E6, 1.4900),
(1.703E6, 2.7500), (2.413E6, 3.4500)))
mdb.models['Model-1'].materials['Rubber'].hyperelastic.PlanarTestData(table=((
0.055E6, 0.0690), (0.324E6, 0.2828), (0.758E6, 1.3862), (1.269E6, 3.0345),
(1.779E6, 4.0621)))
##
## Create material 'Steel'
##
mdb.models['Model-1'].Material('Steel')
mdb.models['Model-1'].materials['Steel'].Elastic(table=((200.E9, 0.3), ))
##
## Create solid sections for the rubber and steel
##
mdb.models['Model-1'].HomogeneousSolidSection(name='RubberSection',
material='Rubber', thickness=1.0)
mdb.models['Model-1'].HomogeneousSolidSection(name='SteelSection',
material='Steel', thickness=1.0)
##
## Partition the part into two regions (rubber and steel regions)
##
p1 = mdb.models['Model-1'].parts['Mount']
f, v0, e, d0 = p1.faces, p1.vertices, p1.edges, p1.datums
faces=(
f.findAt((0.0586877545080395,
0.00594571892225157, 0.0), (0.0, 0.0, 1.0)), )
p1.PartitionFaceByShortestPath(point1=v0.findAt((0.06, 0.005,
0.0), ), point2=v0.findAt((0.01,
0.005, 0.0), ), faces=faces)
##
## Assign rubber section
##
p0 = mdb.models['Model-1'].parts['Mount']
f = p0.faces
region=(None, None,
f.findAt(((0.0420210878413729,
0.00761238558891823, 0.0), (0.0, 0.0, 1.0)), ), None)
p0 = mdb.models['Model-1'].parts['Mount']
p0.SectionAssignment(region=region, sectionName='RubberSection')
##
## Assign steel section
##
p0 = mdb.models['Model-1'].parts['Mount']
f = p0.faces
region=(None, None,
f.findAt(((0.0433333333333333,
0.00333333333333333, 0.0), (0.0, 0.0, 1.0)), ), None)
p0 = mdb.models['Model-1'].parts['Mount']
p0.SectionAssignment(region=region, sectionName='SteelSection')
##
## Switch to the assembly module
##
import assembly
import part
a = mdb.models['Model-1'].rootAssembly
session.viewports['Viewport: 1'].setValues(displayedObject=a)
##
## Set coordinate system (done by default)
##
a = mdb.models['Model-1'].rootAssembly
a.DatumCsysByDefault(CARTESIAN)
##
## Instance the mount
##
p = mdb.models['Model-1'].parts['Mount']
a.Instance(name='Mount-1', part=p, dependent=ON)
##
## Create geometry set 'Middle'
##
a = mdb.models['Model-1'].rootAssembly
e1 = a.instances['Mount-1'].edges
a.Set(edges=e1.findAt((
(0.0421225707547877, 0.03, 0.0), ), ), name='Middle')
##
## Create geometry set 'Out'
##
a = mdb.models['Model-1'].rootAssembly
v1 = a.instances['Mount-1'].vertices
a.Set(vertices=v1.findAt(
((0.01, 0.0, 0.0), ), ), name='Out')
##
## Create surface 'Bottom'
##
a = mdb.models['Model-1'].rootAssembly
e1 = a.instances['Mount-1'].edges
side1Edges = e1[4:5]
a.Surface(name='Bottom', side1Edges=e1.findAt(((
0.0225, 0.0, 0.0), ), ))
##
## Switch to the step module
##
import step
##
## Create a static general step
##
mdb.models['Model-1'].StaticStep(name='Compress mount', previous='Initial',
description="""Apply axial pressure load to mount""", timePeriod=1,
adiabatic=OFF, maxNumInc=100, stabilization=None,
timeIncrementationMethod=AUTOMATIC,
initialInc=0.01, minInc=1e-05, maxInc=1, matrixSolver=SOLVER_DEFAULT,
amplitude=RAMP, extrapolation=LINEAR, fullyPlastic="", nlgeom=ON)
session.viewports['Viewport: 1'].assemblyDisplay.setValues(
step='Compress mount')
##
## Modify output requests
##
mdb.models['Model-1'].fieldOutputRequests['F-Output-1'].setValues(
variables=('S', 'PE', 'PEEQ', 'PEMAG', 'NE', 'LE', 'U', 'RF',
'CF', 'CSTRESS', 'CDISP'))
a0=mdb.models['Model-1'].rootAssembly
regionDef=a0.sets['Out']
mdb.models['Model-1'].HistoryOutputRequest(name='H-Output-1',
createStepName='Compress mount', variables=('U1', 'U2', 'U3'),
region=regionDef)
##
## Switch to load module
##
import load
session.viewports['Viewport: 1'].assemblyDisplay.setValues(loads=ON, bcs=ON,
fields=ON)
##
## Apply pressure load
##
a0 = mdb.models['Model-1'].rootAssembly
region = a0.surfaces['Bottom']
mdb.models['Model-1'].Pressure(name='Pressure',
createStepName='Compress mount', region=region, magnitude=500000.0)
##
## Apply symmetry bc to set "Middle'
##
a0 = mdb.models['Model-1'].rootAssembly
region = a0.sets['Middle']
mdb.models['Model-1'].DisplacementBC(name='Symmetry',
createStepName='Compress mount', region=region, u2=0.0)
##
## Suppress visibility of datum geometry
##
session.viewports['Viewport: 1'].assemblyDisplay.geometryOptions.setValues(
geometryEdgesInShaded=OFF, datumPoints=OFF, datumAxes=OFF, datumPlanes=OFF,
datumCoordSystems=OFF)
##
## 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 edge seeds
##
p = mdb.models['Model-1'].parts['Mount']
e = p.edges
edges=(
e.findAt((
0.0421225707547877, 0.03, 0.0), ),
e.findAt((0.0475,
0.005, 0.0), ),
e.findAt((0.0225,
0.0, 0.0), ))
p.seedEdgeByNumber(edges=edges, number=30)
edges=(
e.findAt((0.01,
0.02375, 0.0), ),
e.findAt((
0.0569094989957453, 0.0108112344534015, 0.0), ))
p.seedEdgeByNumber(edges=edges, number=14)
edges=(
e.findAt((0.01,
0.00375, 0.0), ),
e.findAt((0.06,
0.00125, 0.0), ))
p.seedEdgeByNumber(edges=edges, number=1)
##
## Use structured meshing
##
f = p.faces
regions=(
f.findAt((
0.0433333333333333, 0.00333333333333333, 0.0), (0.0, 0.0, 1.0)),
f.findAt((
0.0420210878413729, 0.00761238558891823, 0.0), (0.0, 0.0, 1.0)))
p.setMeshControls(regions=regions, technique=STRUCTURED)
##
## Assign element type to the rubber
##
elemType1 = mesh.ElemType(elemCode=CAX4H)
elemType2 = mesh.ElemType(elemCode=CAX3)
regions=(None, None,
f.findAt(((
0.0420210878413729, 0.00761238558891823, 0.0), (0.0, 0.0, 1.0)), ), None)
p.setElementType(regions=regions, elemTypes=(elemType1, elemType2))
##
## Assign element type to the steel
##
elemType1 = mesh.ElemType(elemCode=CAX4I)
elemType2 = mesh.ElemType(elemCode=CAX3)
regions=(None, None,
f.findAt(((
0.0433333333333333, 0.00333333333333333, 0.0), (0.0, 0.0, 1.0)), ), None)
p.setElementType(regions=regions, elemTypes=(elemType1, elemType2))
##
## 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='Mount', model='Model-1',
description='Axisymmetric mount analysis under axial loading',
modelPrint=ON)
a = mdb.models['Model-1'].rootAssembly
a.regenerate()
##
## Save model database
##
mdb.saveAs('Mount')