# #Script to generate two rivet forming models in Abaqus/CAE: # - Pure Lagrangian model # - Coupled Eulerian-Lagrangian model # # -*- coding: mbcs -*- from part import * from material import * from section import * from assembly import * from step import * from interaction import * from load import * from mesh import * from job import * from sketch import * from visualization import * from stub import * from connectorBehavior import * mdb.models.changeKey(fromName='Model-1', toName='Rivet forming - CEL') # # Rivet geometry # mdb.models['Rivet forming - CEL'].ConstrainedSketch(name='__profile__', sheetSize=20.0) mdb.models['Rivet forming - CEL'].sketches['__profile__'].ConstructionLine( point1=(0.0, -10.0), point2=(0.0, 10.0)) mdb.models['Rivet forming - CEL'].sketches['__profile__'].FixedConstraint( entity= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[2]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].ArcByCenterEnds( center=(0.0, 0.0), direction=CLOCKWISE, point1=(0.0, 1.0), point2=(1.0, 0.0)) mdb.models['Rivet forming - CEL'].sketches['__profile__'].CoincidentConstraint( entity1= mdb.models['Rivet forming - CEL'].sketches['__profile__'].vertices[2], entity2= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[2]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].CoincidentConstraint( entity1= mdb.models['Rivet forming - CEL'].sketches['__profile__'].vertices[0], entity2= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[2]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].Line(point1=(1.0, 0.0), point2=(3.0, 0.0)) mdb.models['Rivet forming - CEL'].sketches['__profile__'].HorizontalConstraint( entity= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[4]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].PerpendicularConstraint( entity1= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[3], entity2= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[4]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].Line(point1=(3.0, 0.0), point2=(3.0, 3.25)) mdb.models['Rivet forming - CEL'].sketches['__profile__'].VerticalConstraint( entity= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[5]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].PerpendicularConstraint( entity1= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[4], entity2= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[5]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].Line(point1=(3.0, 3.25), point2=(4.0, 3.25)) mdb.models['Rivet forming - CEL'].sketches['__profile__'].HorizontalConstraint( entity= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[6]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].PerpendicularConstraint( entity1= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[5], entity2= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[6]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].Line(point1=(4.0, 3.25), point2=(4.0, 8.25)) mdb.models['Rivet forming - CEL'].sketches['__profile__'].VerticalConstraint( entity= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[7]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].PerpendicularConstraint( entity1= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[6], entity2= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[7]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].Line(point1=(4.0, 8.25), point2=(0.0, 8.44635772705078)) mdb.models['Rivet forming - CEL'].sketches['__profile__'].CoincidentConstraint( entity1= mdb.models['Rivet forming - CEL'].sketches['__profile__'].vertices[7], entity2= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[2]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].Line(point1=(0.0, 8.44635772705078), point2=(0.0, 1.0)) mdb.models['Rivet forming - CEL'].sketches['__profile__'].VerticalConstraint( entity= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[9]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].sketchOptions.setValues( grid=OFF) mdb.models['Rivet forming - CEL'].sketches['__profile__'].FixedConstraint( entity= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[4]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].HorizontalConstraint( entity= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[8]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].delete(objectList=( mdb.models['Rivet forming - CEL'].sketches['__profile__'].constraints[30], )) mdb.models['Rivet forming - CEL'].sketches['__profile__'].ObliqueDimension( textPoint=(6.12089824676514, 6.64175748825073), value=6.0, vertex1= mdb.models['Rivet forming - CEL'].sketches['__profile__'].vertices[5], vertex2= mdb.models['Rivet forming - CEL'].sketches['__profile__'].vertices[6]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].ObliqueDimension( textPoint=(6.12089824676514, 0.582228660583496), value=4.46898, vertex1= mdb.models['Rivet forming - CEL'].sketches['__profile__'].vertices[3], vertex2= mdb.models['Rivet forming - CEL'].sketches['__profile__'].vertices[4]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].ObliqueDimension( textPoint=(1.64401686191559, 11.7831764221191), value=4.0, vertex1= mdb.models['Rivet forming - CEL'].sketches['__profile__'].vertices[6], vertex2= mdb.models['Rivet forming - CEL'].sketches['__profile__'].vertices[7]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].RadialDimension( curve=mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[3] , radius=1.5, textPoint=(1.36421167850494, 1.81511974334717)) mdb.models['Rivet forming - CEL'].sketches['__profile__'].ObliqueDimension( textPoint=(3.54669141769409, 3.3627917766571), value=1.1, vertex1= mdb.models['Rivet forming - CEL'].sketches['__profile__'].vertices[4], vertex2= mdb.models['Rivet forming - CEL'].sketches['__profile__'].vertices[5]) mdb.models['Rivet forming - CEL'].Part(dimensionality=THREE_D, name='Rivet', type=DEFORMABLE_BODY) mdb.models['Rivet forming - CEL'].parts['Rivet'].BaseSolidRevolve(angle=360.0, flipRevolveDirection=OFF, sketch= mdb.models['Rivet forming - CEL'].sketches['__profile__']) del mdb.models['Rivet forming - CEL'].sketches['__profile__'] # # Plate geometry # mdb.models['Rivet forming - CEL'].ConstrainedSketch(name='__profile__', sheetSize=20.0) mdb.models['Rivet forming - CEL'].sketches['__profile__'].CircleByCenterPerimeter( center=(0.0, 0.0), point1=(0.5, 0.0)) mdb.models['Rivet forming - CEL'].sketches['__profile__'].CircleByCenterPerimeter( center=(0.0, 0.0), point1=(1.5, 0.0)) mdb.models['Rivet forming - CEL'].sketches['__profile__'].RadialDimension( curve=mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[3] , radius=11.0, textPoint=(2.16842985153198, 0.752570629119873)) mdb.models['Rivet forming - CEL'].sketches['__profile__'].RadialDimension( curve=mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[2] , radius=2.95, textPoint=(1.49165344238281, 0.937847852706909)) mdb.models['Rivet forming - CEL'].Part(dimensionality=THREE_D, name='Plate', type=DEFORMABLE_BODY) mdb.models['Rivet forming - CEL'].parts['Plate'].BaseSolidExtrude(depth=2.0, sketch=mdb.models['Rivet forming - CEL'].sketches['__profile__']) del mdb.models['Rivet forming - CEL'].sketches['__profile__'] # # Die geometry # mdb.models['Rivet forming - CEL'].ConstrainedSketch(name='__profile__', sheetSize=20.0) mdb.models['Rivet forming - CEL'].sketches['__profile__'].CircleByCenterPerimeter( center=(0.0, 0.0), point1=(1.0, 0.0)) mdb.models['Rivet forming - CEL'].sketches['__profile__'].RadialDimension( curve=mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[2] , radius=10.0, textPoint=(1.86937546730042, 1.08200299739838)) mdb.models['Rivet forming - CEL'].Part(dimensionality=THREE_D, name='Die', type=DEFORMABLE_BODY) mdb.models['Rivet forming - CEL'].parts['Die'].BaseSolidExtrude(depth=1.0, sketch=mdb.models['Rivet forming - CEL'].sketches['__profile__']) del mdb.models['Rivet forming - CEL'].sketches['__profile__'] # # Eulerian domain geometry # mdb.models['Rivet forming - CEL'].ConstrainedSketch(name='__profile__', sheetSize=40.0) mdb.models['Rivet forming - CEL'].sketches['__profile__'].rectangle(point1=( -2.0, -2.0), point2=(2.0, 2.0)) mdb.models['Rivet forming - CEL'].sketches['__profile__'].ConstructionLine( angle=0.0, point1=(0.0, 0.0)) mdb.models['Rivet forming - CEL'].sketches['__profile__'].HorizontalConstraint( entity= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[6]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].ConstructionLine( angle=90.0, point1=(0.0, 0.0)) mdb.models['Rivet forming - CEL'].sketches['__profile__'].VerticalConstraint( entity= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[7]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].SymmetryConstraint( entity1= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[2], entity2= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[4], symmetryAxis= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[7]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].FixedConstraint(entity=mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[7]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].ObliqueDimension( textPoint=(-0.803647994995117, -4.68112373352051), value=17.0, vertex1= mdb.models['Rivet forming - CEL'].sketches['__profile__'].vertices[3], vertex2= mdb.models['Rivet forming - CEL'].sketches['__profile__'].vertices[0]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].FixedConstraint(entity=mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[5]) mdb.models['Rivet forming - CEL'].sketches['__profile__'].EqualLengthConstraint( entity1= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[5], entity2= mdb.models['Rivet forming - CEL'].sketches['__profile__'].geometry[2]) mdb.models['Rivet forming - CEL'].Part(dimensionality=THREE_D, name='Eulerian', type=EULERIAN) mdb.models['Rivet forming - CEL'].parts['Eulerian'].BaseSolidExtrude(depth=11.5 , sketch=mdb.models['Rivet forming - CEL'].sketches['__profile__']) del mdb.models['Rivet forming - CEL'].sketches['__profile__'] # # Sets # mdb.models['Rivet forming - CEL'].parts['Eulerian'].Set(cells= mdb.models['Rivet forming - CEL'].parts['Eulerian'].cells.getSequenceFromMask( ('[#1 ]', ), ), name='All') mdb.models['Rivet forming - CEL'].parts['Die'].Set(cells= mdb.models['Rivet forming - CEL'].parts['Die'].cells.getSequenceFromMask(( '[#1 ]', ), ), name='All') mdb.models['Rivet forming - CEL'].parts['Plate'].Set(cells= mdb.models['Rivet forming - CEL'].parts['Plate'].cells.getSequenceFromMask( ('[#1 ]', ), ), name='All') mdb.models['Rivet forming - CEL'].parts['Rivet'].Set(cells= mdb.models['Rivet forming - CEL'].parts['Rivet'].cells.getSequenceFromMask( ('[#1 ]', ), ), name='All') # # Materials # mdb.models['Rivet forming - CEL'].Material(name='Mat-1') mdb.models['Rivet forming - CEL'].materials['Mat-1'].Density(table=((7.85e-09, ), )) mdb.models['Rivet forming - CEL'].materials['Mat-1'].Elastic(table=((210000.0, 0.266), )) mdb.models['Rivet forming - CEL'].materials['Mat-1'].Plastic(table=((300.0, 0.0), (450.0, 0.02), (750.0, 0.34), (1400.0, 0.35))) mdb.models['Rivet forming - CEL'].Material(name='Mat-2') mdb.models['Rivet forming - CEL'].materials['Mat-2'].Density(table=((7.85e-09, ), )) mdb.models['Rivet forming - CEL'].materials['Mat-2'].Elastic(table=((210000.0, 0.3), )) # # Sections # mdb.models['Rivet forming - CEL'].HomogeneousSolidSection(material='Mat-2', name='Rigid', thickness=None) mdb.models['Rivet forming - CEL'].EulerianSection(data={'Mat-1-1': 'Mat-1'}, name='Rivet') # # Section assignments # mdb.models['Rivet forming - CEL'].parts['Die'].SectionAssignment(offset=0.0, offsetField='', offsetType=MIDDLE_SURFACE, region= mdb.models['Rivet forming - CEL'].parts['Die'].sets['All'], sectionName= 'Rigid') mdb.models['Rivet forming - CEL'].parts['Eulerian'].SectionAssignment(offset= 0.0, offsetField='', offsetType=MIDDLE_SURFACE, region=Region( cells=mdb.models['Rivet forming - CEL'].parts['Eulerian'].cells.getSequenceFromMask( mask=('[#1 ]', ), )), sectionName='Rivet') mdb.models['Rivet forming - CEL'].parts['Plate'].SectionAssignment(offset=0.0, offsetField='', offsetType=MIDDLE_SURFACE, region= mdb.models['Rivet forming - CEL'].parts['Plate'].sets['All'], sectionName= 'Rigid') # # Mesh the die # mdb.models['Rivet forming - CEL'].parts['Die'].PartitionCellByPlaneThreePoints( cells= mdb.models['Rivet forming - CEL'].parts['Die'].cells.getSequenceFromMask(( '[#1 ]', ), ), point1= mdb.models['Rivet forming - CEL'].parts['Die'].vertices[1], point2= mdb.models['Rivet forming - CEL'].parts['Die'].vertices[0], point3= mdb.models['Rivet forming - CEL'].parts['Die'].InterestingPoint( mdb.models['Rivet forming - CEL'].parts['Die'].edges[0], CENTER)) mdb.models['Rivet forming - CEL'].parts['Die'].PartitionCellByPlaneThreePoints( cells= mdb.models['Rivet forming - CEL'].parts['Die'].cells.getSequenceFromMask(( '[#3 ]', ), ), point1= mdb.models['Rivet forming - CEL'].parts['Die'].InterestingPoint( mdb.models['Rivet forming - CEL'].parts['Die'].edges[6], MIDDLE), point2= mdb.models['Rivet forming - CEL'].parts['Die'].InterestingPoint( mdb.models['Rivet forming - CEL'].parts['Die'].edges[5], MIDDLE), point3= mdb.models['Rivet forming - CEL'].parts['Die'].InterestingPoint( mdb.models['Rivet forming - CEL'].parts['Die'].edges[5], CENTER)) mdb.models['Rivet forming - CEL'].parts['Die'].setElementType(elemTypes=( ElemType(elemCode=C3D8R, elemLibrary=EXPLICIT, secondOrderAccuracy=OFF, kinematicSplit=AVERAGE_STRAIN, hourglassControl=DEFAULT, distortionControl=DEFAULT), ElemType(elemCode=C3D6, elemLibrary=EXPLICIT), ElemType(elemCode=C3D4, elemLibrary=EXPLICIT)), regions=( mdb.models['Rivet forming - CEL'].parts['Die'].cells.getSequenceFromMask(( '[#f ]', ), ), )) mdb.models['Rivet forming - CEL'].parts['Die'].seedPart(deviationFactor=0.1, size=0.75) mdb.models['Rivet forming - CEL'].parts['Die'].generateMesh() # # Mesh the plate # mdb.models['Rivet forming - CEL'].parts['Plate'].PartitionCellByPlaneThreePoints( cells= mdb.models['Rivet forming - CEL'].parts['Plate'].cells.getSequenceFromMask( ('[#1 ]', ), ), point1= mdb.models['Rivet forming - CEL'].parts['Plate'].InterestingPoint( mdb.models['Rivet forming - CEL'].parts['Plate'].edges[1], MIDDLE), point2= mdb.models['Rivet forming - CEL'].parts['Plate'].InterestingPoint( mdb.models['Rivet forming - CEL'].parts['Plate'].edges[0], MIDDLE), point3= mdb.models['Rivet forming - CEL'].parts['Plate'].InterestingPoint( mdb.models['Rivet forming - CEL'].parts['Plate'].edges[0], CENTER)) mdb.models['Rivet forming - CEL'].parts['Plate'].PartitionCellByPlaneThreePoints( cells= mdb.models['Rivet forming - CEL'].parts['Plate'].cells.getSequenceFromMask( ('[#3 ]', ), ), point1= mdb.models['Rivet forming - CEL'].parts['Plate'].InterestingPoint( mdb.models['Rivet forming - CEL'].parts['Plate'].edges[14], MIDDLE), point2=mdb.models['Rivet forming - CEL'].parts['Plate'].InterestingPoint( mdb.models['Rivet forming - CEL'].parts['Plate'].edges[12], MIDDLE), point3=mdb.models['Rivet forming - CEL'].parts['Plate'].InterestingPoint( mdb.models['Rivet forming - CEL'].parts['Plate'].edges[10], CENTER)) mdb.models['Rivet forming - CEL'].parts['Plate'].setElementType(elemTypes=( ElemType(elemCode=C3D8R, elemLibrary=STANDARD, secondOrderAccuracy=OFF, kinematicSplit=AVERAGE_STRAIN, hourglassControl=DEFAULT, distortionControl=DEFAULT), ElemType(elemCode=C3D6, elemLibrary=STANDARD), ElemType(elemCode=C3D4, elemLibrary=STANDARD)), regions=( mdb.models['Rivet forming - CEL'].parts['Plate'].cells.getSequenceFromMask( ('[#f ]', ), ), )) mdb.models['Rivet forming - CEL'].parts['Plate'].seedPart(deviationFactor=0.1, size=0.75) mdb.models['Rivet forming - CEL'].parts['Plate'].generateMesh() # # Partition the rivet geometry (no mesh needed for CEL model) # mdb.models['Rivet forming - CEL'].parts['Rivet'].PartitionCellByExtendFace( cells= mdb.models['Rivet forming - CEL'].parts['Rivet'].cells.getSequenceFromMask( ('[#1 ]', ), ), extendFace= mdb.models['Rivet forming - CEL'].parts['Rivet'].faces[3]) mdb.models['Rivet forming - CEL'].parts['Rivet'].PartitionCellByExtendFace( cells= mdb.models['Rivet forming - CEL'].parts['Rivet'].cells.getSequenceFromMask( ('[#2 ]', ), ), extendFace= mdb.models['Rivet forming - CEL'].parts['Rivet'].faces[4]) mdb.models['Rivet forming - CEL'].parts['Rivet'].PartitionCellByPlaneThreePoints( cells= mdb.models['Rivet forming - CEL'].parts['Rivet'].cells.getSequenceFromMask( ('[#7 ]', ), ), point1= mdb.models['Rivet forming - CEL'].parts['Rivet'].InterestingPoint( mdb.models['Rivet forming - CEL'].parts['Rivet'].edges[10], CENTER), point2=mdb.models['Rivet forming - CEL'].parts['Rivet'].vertices[4], point3=mdb.models['Rivet forming - CEL'].parts['Rivet'].vertices[0]) mdb.models['Rivet forming - CEL'].parts['Rivet'].PartitionCellByPlaneThreePoints( cells= mdb.models['Rivet forming - CEL'].parts['Rivet'].cells.getSequenceFromMask( ('[#3f ]', ), ), point1= mdb.models['Rivet forming - CEL'].parts['Rivet'].InterestingPoint( mdb.models['Rivet forming - CEL'].parts['Rivet'].edges[23], MIDDLE), point2=mdb.models['Rivet forming - CEL'].parts['Rivet'].InterestingPoint( mdb.models['Rivet forming - CEL'].parts['Rivet'].edges[27], MIDDLE), point3=mdb.models['Rivet forming - CEL'].parts['Rivet'].InterestingPoint( mdb.models['Rivet forming - CEL'].parts['Rivet'].edges[26], CENTER)) # # Mesh the Eulerian domain # mdb.models['Rivet forming - CEL'].parts['Eulerian'].setElementType(elemTypes=( ElemType(elemCode=EC3D8R, elemLibrary=EXPLICIT, hourglassControl=DEFAULT), ElemType(elemCode=UNKNOWN_WEDGE, elemLibrary=EXPLICIT), ElemType( elemCode=UNKNOWN_TET, elemLibrary=EXPLICIT)), regions=( mdb.models['Rivet forming - CEL'].parts['Eulerian'].cells.getSequenceFromMask( ('[#1 ]', ), ), )) mdb.models['Rivet forming - CEL'].parts['Eulerian'].seedPart(deviationFactor= 0.1, size=0.25) mdb.models['Rivet forming - CEL'].parts['Eulerian'].generateMesh() # # Instance parts into the assembly # mdb.models['Rivet forming - CEL'].rootAssembly.DatumCsysByDefault(CARTESIAN) mdb.models['Rivet forming - CEL'].rootAssembly.Instance(dependent=ON, name= 'Plate-1', part=mdb.models['Rivet forming - CEL'].parts['Plate']) mdb.models['Rivet forming - CEL'].rootAssembly.Instance(dependent=ON, name= 'Rivet-1', part=mdb.models['Rivet forming - CEL'].parts['Rivet']) mdb.models['Rivet forming - CEL'].rootAssembly.Coaxial(fixedAxis= mdb.models['Rivet forming - CEL'].rootAssembly.instances['Plate-1'].faces[15] , flip=ON, movableAxis= mdb.models['Rivet forming - CEL'].rootAssembly.instances['Rivet-1'].faces[45]) mdb.models['Rivet forming - CEL'].rootAssembly.FaceToFace(clearance=0.0, fixedPlane= mdb.models['Rivet forming - CEL'].rootAssembly.instances['Plate-1'].faces[9] , flip=ON, movablePlane= mdb.models['Rivet forming - CEL'].rootAssembly.instances['Rivet-1'].faces[7]) mdb.models['Rivet forming - CEL'].rootAssembly.Instance(dependent=ON, name= 'Die-1', part=mdb.models['Rivet forming - CEL'].parts['Die']) mdb.models['Rivet forming - CEL'].rootAssembly.FaceToFace(clearance=0.0, fixedPlane= mdb.models['Rivet forming - CEL'].rootAssembly.instances['Rivet-1'].faces[6] , flip=ON, movablePlane= mdb.models['Rivet forming - CEL'].rootAssembly.instances['Die-1'].faces[7]) mdb.models['Rivet forming - CEL'].rootAssembly.Instance(dependent=ON, name= 'Die-2', part=mdb.models['Rivet forming - CEL'].parts['Die']) mdb.models['Rivet forming - CEL'].rootAssembly.FaceToFace(clearance=0.0, fixedPlane= mdb.models['Rivet forming - CEL'].rootAssembly.instances['Rivet-1'].faces[9] , flip=ON, movablePlane= mdb.models['Rivet forming - CEL'].rootAssembly.instances['Die-2'].faces[4]) mdb.models['Rivet forming - CEL'].rootAssembly.Instance(dependent=ON, name= 'Eulerian-1', part=mdb.models['Rivet forming - CEL'].parts['Eulerian']) # Combine the following three translates? mdb.models['Rivet forming - CEL'].rootAssembly.translate(instanceList=( 'Eulerian-1', ), vector=(1.5, 2.0, -2.5)) mdb.models['Rivet forming - CEL'].rootAssembly.translate(instanceList=( 'Eulerian-1', ), vector=(-10.0, 0.0, 0.0)) mdb.models['Rivet forming - CEL'].rootAssembly.translate(instanceList=( 'Eulerian-1', ), vector=(8.5, -8.5, -0.45)) # mdb.models['Rivet forming - CEL'].rootAssembly.instances['Die-1'].ConvertConstraints( ) mdb.models['Rivet forming - CEL'].rootAssembly.instances['Die-2'].ConvertConstraints( ) mdb.models['Rivet forming - CEL'].rootAssembly.instances['Rivet-1'].ConvertConstraints( ) # # Create step, general contact, rigid bodies, volume fraction field, and boundary conditions # mdb.models['Rivet forming - CEL'].ExplicitDynamicsStep(description= 'Displace dies', name='Step-1', previous='Initial', timePeriod=0.001) # mdb.models['Rivet forming - CEL'].ContactProperty('Frictionless') mdb.models['Rivet forming - CEL'].ContactExp(createStepName='Step-1', name= 'General contact') mdb.models['Rivet forming - CEL'].interactions['General contact'].includedPairs.setValuesInStep( stepName='Step-1', useAllstar=ON) mdb.models['Rivet forming - CEL'].interactions['General contact'].contactPropertyAssignments.appendInStep( assignments=((GLOBAL, SELF, 'Frictionless'), ), stepName='Step-1') # a = mdb.models['Rivet forming - CEL'].rootAssembly f1=a.ReferencePoint(point=(0.0, 0.0, 10.0)) f2=a.ReferencePoint(point=(0.0, 0.0, -4.5)) f3=a.ReferencePoint(point=(0.0, 0.0, 0.0)) a.Set(name='Die-1-RefNode', referencePoints=(a.referencePoints.findAt((f1.xValue,f1.yValue,f1.zValue)),)) a.Set(name='Die-2-RefNode', referencePoints=(a.referencePoints.findAt((f2.xValue,f2.yValue,f2.zValue)),)) a.Set(name='Plate-RefNode', referencePoints=(a.referencePoints.findAt((f3.xValue,f3.yValue,f3.zValue)),)) mdb.models['Rivet forming - CEL'].RigidBody(bodyRegion= mdb.models['Rivet forming - CEL'].rootAssembly.instances['Die-1'].sets['All'] , name='Rigid-Die-1', refPointRegion= mdb.models['Rivet forming - CEL'].rootAssembly.sets['Die-1-RefNode']) mdb.models['Rivet forming - CEL'].RigidBody(bodyRegion= mdb.models['Rivet forming - CEL'].rootAssembly.instances['Die-2'].sets['All'] , name='Rigid-Die-2', refPointRegion= mdb.models['Rivet forming - CEL'].rootAssembly.sets['Die-2-RefNode']) mdb.models['Rivet forming - CEL'].RigidBody(bodyRegion= mdb.models['Rivet forming - CEL'].rootAssembly.instances['Plate-1'].sets['All'] , name='Rigid-Plate', refPointRegion= mdb.models['Rivet forming - CEL'].rootAssembly.sets['Plate-RefNode']) # mdb.models['Rivet forming - CEL'].SmoothStepAmplitude(data=((0.0, 0.0), (0.0008, 1.0)), name='Amp-1', timeSpan=STEP) mdb.models['Rivet forming - CEL'].DisplacementBC(amplitude=UNSET, createStepName='Step-1', distributionType=UNIFORM, fieldName='', fixed=OFF, localCsys=None, name='Fix plate', region= mdb.models['Rivet forming - CEL'].rootAssembly.sets['Plate-RefNode'], u1= 0.0, u2=0.0, u3=0.0, ur1=0.0, ur2=0.0, ur3=0.0) mdb.models['Rivet forming - CEL'].DisplacementBC(amplitude='Amp-1', createStepName='Step-1', distributionType=UNIFORM, fieldName='', fixed=OFF, localCsys=None, name='Displace Die-1', region= mdb.models['Rivet forming - CEL'].rootAssembly.sets['Die-1-RefNode'], u1= 0.0, u2=0.0, u3=-3.0, ur1=0.0, ur2=0.0, ur3=0.0) mdb.models['Rivet forming - CEL'].DisplacementBC(amplitude='Amp-1', createStepName='Step-1', distributionType=UNIFORM, fieldName='', fixed=OFF, localCsys=None, name='Displace Die-2', region= mdb.models['Rivet forming - CEL'].rootAssembly.sets['Die-2-RefNode'], u1= 0.0, u2=0.0, u3=2.0, ur1=0.0, ur2=0.0, ur3=0.0) # mdb.models['Rivet forming - CEL'].rootAssembly.DiscreteFieldByVolumeFraction( description='Volume faction field for rivet material', eulerianInstance= mdb.models['Rivet forming - CEL'].rootAssembly.instances['Eulerian-1'], name='Rivet VF', referenceInstance= mdb.models['Rivet forming - CEL'].rootAssembly.instances['Rivet-1']) mdb.models['Rivet forming - CEL'].MaterialAssignment(fieldList=((Region( cells=mdb.models['Rivet forming - CEL'].rootAssembly.instances['Eulerian-1'].cells.getSequenceFromMask( mask=('[#1 ]', ), )), ('Rivet VF', )), ), instanceList=( mdb.models['Rivet forming - CEL'].rootAssembly.instances['Eulerian-1'], ), name='Rivet VF', useFields=True) # # Copy CEL model to use as basis for Lagrangian simulation then delete the Eulerian # part and related features # mdb.Model(name='Rivet forming - Lagrangian', objectToCopy= mdb.models['Rivet forming - CEL']) del mdb.models['Rivet forming - Lagrangian'].rootAssembly.features['Eulerian-1'] del mdb.models['Rivet forming - Lagrangian'].predefinedFields['Rivet VF'] del mdb.models['Rivet forming - Lagrangian'].discreteFields['Rivet VF'] del mdb.models['Rivet forming - Lagrangian'].parts['Eulerian'] del mdb.models['Rivet forming - Lagrangian'].sections['Rivet'] # # Section and section assignment for the Lagrangian rivet # mdb.models['Rivet forming - Lagrangian'].HomogeneousSolidSection(material= 'Mat-1', name='Rivet', thickness=None) mdb.models['Rivet forming - Lagrangian'].parts['Rivet'].SectionAssignment( offset=0.0, offsetField='', offsetType=MIDDLE_SURFACE, region= mdb.models['Rivet forming - Lagrangian'].parts['Rivet'].sets['All'], sectionName='Rivet') # # Mesh the rivet # mdb.models['Rivet forming - Lagrangian'].parts['Rivet'].setElementType( elemTypes=(ElemType(elemCode=C3D8R, elemLibrary=EXPLICIT, secondOrderAccuracy=OFF, kinematicSplit=AVERAGE_STRAIN, hourglassControl=DEFAULT, distortionControl=DEFAULT), ElemType( elemCode=C3D6, elemLibrary=EXPLICIT), ElemType(elemCode=C3D4, elemLibrary=EXPLICIT)), regions=( mdb.models['Rivet forming - Lagrangian'].parts['Rivet'].cells.getSequenceFromMask( ('[#fff ]', ), ), )) mdb.models['Rivet forming - Lagrangian'].parts['Rivet'].seedPart( deviationFactor=0.1, size=0.25) mdb.models['Rivet forming - Lagrangian'].parts['Rivet'].generateMesh() # # Customize the output requests # mdb.models['Rivet forming - Lagrangian'].historyOutputRequests.changeKey( fromName='H-Output-1', toName='Whole model energy') mdb.models['Rivet forming - Lagrangian'].historyOutputRequests['Whole model energy'].setValues( frequency=100, variables=('ALLAE', 'ALLIE', 'ALLKE', 'ALLPD', 'ALLSE', 'ALLVD', 'ALLWK', 'ETOTAL')) mdb.models['Rivet forming - Lagrangian'].HistoryOutputRequest(createStepName= 'Step-1', timeInterval=1e-05, name='Die-1 reaction force', rebar=EXCLUDE, region= mdb.models['Rivet forming - Lagrangian'].rootAssembly.sets['Die-1-RefNode'] , filter=ANTIALIASING, sectionPoints=DEFAULT, variables=('RF3', )) mdb.models['Rivet forming - Lagrangian'].HistoryOutputRequest(createStepName= 'Step-1', timeInterval=1e-05, name='Die-2 reaction force', rebar=EXCLUDE, region= mdb.models['Rivet forming - Lagrangian'].rootAssembly.sets['Die-2-RefNode'] , filter=ANTIALIASING, sectionPoints=DEFAULT, variables=('RF3', )) mdb.models['Rivet forming - Lagrangian'].fieldOutputRequests.changeKey( fromName='F-Output-1', toName='Displacement') mdb.models['Rivet forming - Lagrangian'].fieldOutputRequests['Displacement'].setValues( numIntervals=30, variables=('UT', )) mdb.models['Rivet forming - Lagrangian'].FieldOutputRequest(createStepName= 'Step-1', name='Plastic strain', numIntervals=30, rebar=EXCLUDE, region= mdb.models['Rivet forming - Lagrangian'].rootAssembly.instances['Rivet-1'].sets['All'] , sectionPoints=DEFAULT, variables=('PEEQ', )) # mdb.models['Rivet forming - CEL'].historyOutputRequests['H-Output-1'].setValues( frequency=100, variables=('ALLAE', 'ALLIE', 'ALLKE', 'ALLPD', 'ALLSE', 'ALLVD', 'ALLWK', 'ETOTAL')) mdb.models['Rivet forming - CEL'].historyOutputRequests.changeKey(fromName= 'H-Output-1', toName='Whole model energy') mdb.models['Rivet forming - CEL'].HistoryOutputRequest(createStepName='Step-1', timeInterval=1e-05, name='Die-1 reaction force', rebar=EXCLUDE, region= mdb.models['Rivet forming - CEL'].rootAssembly.sets['Die-1-RefNode'], filter=ANTIALIASING, sectionPoints=DEFAULT, variables=('RF3', )) mdb.models['Rivet forming - CEL'].HistoryOutputRequest(createStepName='Step-1', timeInterval=1e-05, name='Die-2 reaction force', rebar=EXCLUDE, region= mdb.models['Rivet forming - CEL'].rootAssembly.sets['Die-2-RefNode'], filter=ANTIALIASING, sectionPoints=DEFAULT, variables=('RF3', )) mdb.models['Rivet forming - CEL'].fieldOutputRequests['F-Output-1'].setValues( numIntervals=30, variables=('UT', )) mdb.models['Rivet forming - CEL'].fieldOutputRequests.changeKey(fromName= 'F-Output-1', toName='Displacement') mdb.models['Rivet forming - CEL'].FieldOutputRequest(createStepName='Step-1', name='Plastic strain and volume fraction', numIntervals=30, rebar=EXCLUDE, region= mdb.models['Rivet forming - CEL'].rootAssembly.instances['Eulerian-1'].sets['All'] , sectionPoints=DEFAULT, variables=('PEEQVAVG', 'EVF')) # # Suppress Rivet instance in the CEL model and regenerate both assemblies # mdb.models['Rivet forming - CEL'].rootAssembly.features['Rivet-1'].suppress() mdb.models['Rivet forming - Lagrangian'].rootAssembly.regenerate() mdb.models['Rivet forming - CEL'].rootAssembly.regenerate() # # Create jobs and write out input files # mdb.Job(contactPrint=OFF, description='Rivet forming w/ Lagrangian', echoPrint= OFF, explicitPrecision=SINGLE, historyPrint=OFF, memory=1512, memoryUnits= MEGA_BYTES, model='Rivet forming - Lagrangian', modelPrint=OFF, multiprocessingMode=DEFAULT, name='Rivet-Forming-Lagrangian', nodalOutputPrecision=SINGLE, numCpus=1, numDomains=1, parallelizationMethodExplicit=DOMAIN, scratch='', type=ANALYSIS, userSubroutine='') mdb.Job(contactPrint=OFF, description='Rivet forming w/ CEL', echoPrint=OFF, explicitPrecision=SINGLE, historyPrint=OFF, memory=1512, memoryUnits= MEGA_BYTES, model='Rivet forming - CEL', modelPrint=OFF, multiprocessingMode=DEFAULT, name='Rivet-Forming-CEL', nodalOutputPrecision=SINGLE, numCpus=1, numDomains=1, parallelizationMethodExplicit=DOMAIN, scratch='', type=ANALYSIS, userSubroutine='') mdb.jobs['Rivet-Forming-Lagrangian'].writeInput(consistencyChecking=OFF) mdb.jobs['Rivet-Forming-CEL'].writeInput(consistencyChecking=OFF) # # Save models # mdb.saveAs('rivet_forming_example')