# # Getting Started with ABAQUS # # Script for rubber mount 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() ## ## Sketch profile of the mount ## s = mdb.models['Model-1'].ConstrainedSketch(name='__profile__', sheetSize=0.3) g, v, d, c = s.geometry, s.vertices, s.dimensions, s.constraints s.sketchOptions.setValues(decimalPlaces=3, viewStyle=AXISYM) s.setPrimaryObject(option=STANDALONE) s.ConstructionLine(point1=(0.0, -100.0), point2=(0.0, 100.0)) s.FixedConstraint(entity=g[2]) mdb.models['Model-1'].sketches['__profile__'].sketchOptions.setValues( gridFrequency=4) s.rectangle(point1=(0.01, 0.0), point2=(0.025, 0.01)) s.DistanceDimension(entity1=g[2], entity2=v[0], textPoint=(0.00998260825872421, -0.00830297358334064), value=0.01) s.VerticalDimension(vertex1=v[0], vertex2=v[1], textPoint=(0.0, 0.00851448811590672), value=0.03) s.ObliqueDimension(vertex1=v[0], vertex2=v[3], textPoint=(0.025699570775032, -0.00830297358334064), value=0.05) s.CircleByCenterPerimeter(center=(0.085, 0.025), point1=(0.06, 0.00740899052470922)) s.CoincidentConstraint(entity1=v[5], entity2=g[5]) s.DistanceDimension(entity1=g[2], entity2=v[4], textPoint=(0.0811913833022118, -0.023865295574069), value=0.1) s.VerticalDimension(vertex1=v[2], vertex2=v[4], textPoint=(0.115524396300316, 0.0262394621968269), value=0.0) s.ObliqueDimension(vertex1=v[5], vertex2=v[3], textPoint=(0.0519323498010635, 0.0), value=0.005) s.autoTrimCurve(curve1=g[7], point1=(0.124150268733501, -0.00965208746492863)) s.autoTrimCurve(curve1=g[5], point1=(0.0601795427501202, 0.020298857241869)) s.autoTrimCurve(curve1=g[4], point1=(0.0557677671313286, 0.0308697782456875)) s.RadialDimension(curve=g[8], textPoint=(0.0725325122475624, 0.0207393132150173), radius=0.047169905660283) d[6].setValues(reference=ON) session.viewports['Viewport: 1'].view.fitView() p = mdb.models['Model-1'].Part(name='Mount', dimensionality=AXISYMMETRIC, type=DEFORMABLE_BODY) p = mdb.models['Model-1'].parts['Mount'] p.BaseShell(sketch=s) s.unsetPrimaryObject() session.viewports['Viewport: 1'].setValues(displayedObject=p) del mdb.models['Model-1'].sketches['__profile__'] ## ## 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) ## f, e, d = p.faces, p.edges, p.datums t = p.MakeSketchTransform( sketchPlane=f.findAt(coordinates=(0.043333, 0.001667, 0.0), normal=(0.0, 0.0, 1.0)), sketchPlaneSide=SIDE1, origin=(0.033052, 0.014514, 0.0)) s = mdb.models['Model-1'].ConstrainedSketch(name='__profile__', sheetSize=0.134, gridSpacing=0.003, transform=t) g, v, d1, c = s.geometry, s.vertices, s.dimensions, s.constraints s.sketchOptions.setValues(decimalPlaces=3) s.setPrimaryObject(option=SUPERIMPOSE) p.projectReferencesOntoSketch(sketch=s, filter=COPLANAR_EDGES) s.Line(point1=(0.026948, -0.009514), point2=(-0.03, -0.009514)) s.HorizontalConstraint(entity=g.findAt((-0.001526, -0.009514))) s.PerpendicularConstraint(entity1=g.findAt((0.026948, -0.012014)), entity2=g.findAt((-0.001526, -0.009514))) pickedFaces = f.findAt(((0.043333, 0.001667, 0.0), )) p.PartitionFaceBySketch(faces=pickedFaces, sketch=s) s.unsetPrimaryObject() del mdb.models['Model-1'].sketches['__profile__'] ## ## Assign rubber section ## p = mdb.models['Model-1'].parts['Mount'] f = p.faces faces = f.findAt(((0.042303, 0.006937, 0.0), )) region = regionToolset.Region(faces=faces) p.SectionAssignment(region=region, sectionName='RubberSection', offset=0.0) ## ## Assign steel section ## faces = f.findAt(((0.043333, 0.003333, 0.0), )) region = regionToolset.Region(faces=faces) p.SectionAssignment(region=region, sectionName='SteelSection', offset=0.0) a = mdb.models['Model-1'].rootAssembly session.viewports['Viewport: 1'].setValues(displayedObject=a) ## ## Set coordinate system (done by default) ## 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' ## e = a.instances['Mount-1'].edges edges = e.findAt(((0.020708, 0.03, 0.0), )) a.Set(edges=edges, name='Middle') ## ## Create geometry set 'Out' ## v = a.instances['Mount-1'].vertices verts = v.findAt(((0.01, 0.0, 0.0), )) a.Set(vertices=verts, name='Out') ## ## Create surface 'Bottom' ## s = a.instances['Mount-1'].edges side1Edges = s.findAt(((0.0475, 0.0, 0.0), )) a.Surface(side1Edges=side1Edges, name='Bottom') ## ## 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')) regionDef=a.sets['Out'] mdb.models['Model-1'].HistoryOutputRequest(name='H-Output-1', createStepName='Compress mount', variables=('U1', 'U2', 'U3'), region=regionDef) session.viewports['Viewport: 1'].assemblyDisplay.setValues(loads=ON, bcs=ON, predefinedFields=ON) ## ## Apply pressure load ## region = a.surfaces['Bottom'] mdb.models['Model-1'].Pressure(name='Pressure', createStepName='Compress mount', region=region, magnitude=500000.0) ## ## Apply symmetry bc to set "Middle' ## region = a.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) session.viewports['Viewport: 1'].assemblyDisplay.setValues(mesh=ON, loads=OFF, bcs=OFF, predefinedFields=OFF) session.viewports['Viewport: 1'].assemblyDisplay.meshOptions.setValues( meshTechnique=ON) ## ## Assign edge seeds ## p = mdb.models['Model-1'].parts['Mount'] e = p.edges pickedEdges = e.findAt(((0.0225, 0.005, 0.0), ), ((0.0475, 0.0, 0.0), ), ((0.020708, 0.03, 0.0), )) p.seedEdgeByNumber(edges=pickedEdges, number=30) pickedEdges = e.findAt(((0.053289, 0.023434, 0.0), ), ((0.01, 0.01125, 0.0), )) p.seedEdgeByNumber(edges=pickedEdges, number=14) pickedEdges = e.findAt(((0.01, 0.00125, 0.0), ), ((0.06, 0.00375, 0.0), )) p.seedEdgeByNumber(edges=pickedEdges, number=1) ## ## Use structured meshing ## f = p.faces pickedRegions = f p.setMeshControls(regions=pickedRegions, technique=STRUCTURED) ## ## Assign element type to the rubber ## elemType1 = mesh.ElemType(elemCode=CAX4H, elemLibrary=STANDARD) elemType2 = mesh.ElemType(elemCode=CAX3, elemLibrary=STANDARD) faces = f.findAt(((0.042303, 0.006937, 0.0), )) pickedRegions =(faces, ) p.setElementType(regions=pickedRegions, elemTypes=(elemType1, elemType2)) ## ## Assign element type to the steel ## elemType1 = mesh.ElemType(elemCode=CAX4I, elemLibrary=STANDARD) elemType2 = mesh.ElemType(elemCode=CAX3, elemLibrary=STANDARD) faces = f.findAt(((0.043333, 0.003333, 0.0), )) pickedRegions =(faces, ) p.setElementType(regions=pickedRegions, elemTypes=(elemType1, elemType2)) ## ## Generate mesh ## p.generateMesh() 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')