''' ----------------------------------------------------------------------------- Heat transfer analysis of a symmetric model of a two dimensional single edged notch specimen modeled using heat transfer elements (DC2D8). The *.odb file generated from this analysis is used for fracture analysis of the specimen. ----------------------------------------------------------------------------- ''' from abaqus import * from abaqusConstants import * import part, material, section, assembly, step, interaction import regionToolset, displayGroupMdbToolset as dgm, mesh, load, job #---------------------------------------------------------------------------- # Create a model Mdb() modelName = 'SingleEdgedThermMesh2' myModel = mdb.Model(name=modelName) # Create a new viewport in which to display the model # and the results of the analysis. myViewport = session.Viewport(name=modelName) myViewport.makeCurrent() myViewport.maximize() #--------------------------------------------------------------------------- # Create a part # Create a sketch for the base feature mySketch = myModel.Sketch(name='plateProfile',sheetSize=200.0) mySketch.sketchOptions.setValues(viewStyle=AXISYM) mySketch.setPrimaryObject(option=STANDALONE) mySketch.rectangle(point1=(-10.0, 0.0), point2=(10.0, 40.0)) myPlate = myModel.Part(name='Plate', dimensionality=TWO_D_PLANAR, type=DEFORMABLE_BODY) myPlate.BaseShell(sketch=mySketch) mySketch.unsetPrimaryObject() del myModel.sketches['plateProfile'] myViewport.setValues(displayedObject=myPlate) # Partition the edge for the crack pickedEdge = myPlate.edges.findAt((1,0,0)) myPlate.PartitionEdgeByParam(edges=pickedEdge, parameter=0.5) # Partition the plate face1 = myPlate.faces.findAt((0,20,0)) t = myPlate.MakeSketchTransform(sketchPlane=face1, sketchPlaneSide=SIDE1, origin=(0.0,20.0,0.0)) mySketch = myModel.Sketch(name='partitionProfile', sheetSize=89.44, gridSpacing=2.23, transform=t) mySketch.setPrimaryObject(option=SUPERIMPOSE) myPlate.projectReferencesOntoSketch(sketch=mySketch, filter=COPLANAR_EDGES) mySketch.sketchOptions.setValues(gridOrigin=(0.0, -20.0)) mySketch.ArcByCenterEnds(center=(0.0,-20.0), point1=(0.28,-20.0), point2=(-0.28,-20.0), direction=COUNTERCLOCKWISE) mySketch.Line(point1=(10.0,-10.0), point2=(-10.0,-10.0)) mySketch.Line(point1=(0.0,-20.0), point2=(10.0,-10.0)) mySketch.Line(point1=(0.0,-20.0), point2=(-10.0,-10.0)) pickedFaces = myPlate.faces.findAt((0,20,0)) myPlate.PartitionFaceBySketch(faces=pickedFaces, sketch=mySketch) mySketch.unsetPrimaryObject() del myModel.sketches['partitionProfile'] # Create a set for the entire part faces1 = myPlate.faces myPlate.Set(faces=faces1, name='faces') #--------------------------------------------------------------------------- # Assign material properties # Create linear elastic material myModel.Material(name='HEAT') myModel.materials['HEAT'].Conductivity(table=((0.0007872,),)) myModel.materials['HEAT'].Density(table=((0.2829,),)) myModel.materials['HEAT'].SpecificHeat(table=((0.1431,),)) myModel.HomogeneousSolidSection(name='SolidHomogeneous', material='HEAT', thickness=1.0) region = myPlate.sets['faces'] # Assign the above section to the part myPlate.SectionAssignment(region=region, sectionName='SolidHomogeneous') #--------------------------------------------------------------------------- # Create an assembly myAssembly = myModel.rootAssembly myViewport.setValues(displayedObject=myAssembly) myAssembly.DatumCsysByDefault(CARTESIAN) myAssembly.Instance(name='myPlate-1', part=myPlate, dependent=OFF) myPlateInstance = myAssembly.instances['myPlate-1'] # Create a set for the entire instance faces1 = myPlateInstance.faces myAssembly.Set(faces=faces1, name='All') # Create a set for the left edge e1 = myPlateInstance.edges.findAt(((-10.,3,0.),), ((-10.,25,0.),),) myAssembly.Set(edges=e1, name='leftEdge') # Create a set for the right edge e1 = myPlateInstance.edges.findAt(((10.,3,0.),), ((10.,25,0.),),) myAssembly.Set(edges=e1, name='rightEdge') #--------------------------------------------------------------------------- # Create a step for performing a heat transfer analysis myModel.HeatTransferStep(name='Step-1', previous='Initial', description='Heat transfer step', response=STEADY_STATE, amplitude=RAMP) # Create a history output for the temperature regionDef = myAssembly.sets['All'] myModel.historyOutputRequests['H-Output-1'].setValues(variables=('NT', ), region=regionDef, sectionPoints=DEFAULT, rebar=EXCLUDE) #--------------------------------------------------------------------------- # Create loads and boundary conditions # Assign boundary conditions region = myAssembly.sets['leftEdge'] myModel.TemperatureBC(name='leftEdgeBC', createStepName='Step-1', region=region, fixed=OFF, distribution=UNIFORM, magnitude=1000.0) region = myAssembly.sets['rightEdge'] myModel.TemperatureBC(name='rightEdgeBC', createStepName='Step-1', region=region, fixed=OFF, distribution=UNIFORM, magnitude=-1000.0) #--------------------------------------------------------------------------- # Create a mesh # Assign meshing controls to different regions pickedRegions = myPlateInstance.faces.findAt(((-0.048303,0.014643,0.),), ((0.050153,0.016175,0.),), ((0.,0.031845,0.),),) myAssembly.setMeshControls(regions=pickedRegions, elemShape=QUAD_DOMINATED, technique=SWEEP) pickedRegions = myPlateInstance.faces.findAt(((-5.062731,1.838048,0.),), ((0.,4.8235,0.),), ((5.062731,1.838048,0.),), ((0.042229,25.4511,0.),),) myAssembly.setMeshControls(regions=pickedRegions, technique=STRUCTURED) # Seed all the edges pickedEdges = myPlateInstance.edges.findAt(((-0.140,0.,0.),), ((-0.098995,0.098995,0.),), ((0.098995,0.098995,0.),), ((0.140,0.,0.),),) myAssembly.seedEdgeByNumber(edges=pickedEdges, number=1, constraint=FIXED) pickedEdges = myPlateInstance.edges.findAt(((-0.258686,0.107151,0.),), ((0.258686,0.107151,0.),),) myAssembly.seedEdgeByNumber(edges=pickedEdges, number=3, constraint=FIXED) pickedEdges = myPlateInstance.edges.findAt(((0.,0.280,0.),),) myAssembly.seedEdgeByNumber(edges=pickedEdges, number=6, constraint=FIXED) pickedEdges = myPlateInstance.edges.findAt(((-10.,5.,0.),), ((10.,5.,0.),),) myAssembly.seedEdgeByNumber(edges=pickedEdges, number=3, constraint=FIXED) pickedEdges = myPlateInstance.edges.findAt(((0.,10.,0.),),) myAssembly.seedEdgeByNumber(edges=pickedEdges, number=6, constraint=FIXED) pickedEdges1 = myPlateInstance.edges.findAt(((1.498956,0.,0.),), ((1.070671,1.070671,0.),),) pickedEdges2 = myPlateInstance.edges.findAt(((-1.458195,0.,0.),), ((-1.070671,1.070671,0.),),) myAssembly.seedEdgeByBias(end1Edges=pickedEdges1, end2Edges=pickedEdges2, ratio=4, number=5, constraint=FIXED) pickedEdges1 = myPlateInstance.edges.findAt(((10.,13.195586,0.),),) pickedEdges2 = myPlateInstance.edges.findAt(((-10.,13.195586,0.),),) myAssembly.seedEdgeByBias(end1Edges=pickedEdges1, end2Edges=pickedEdges2, ratio=3, number=3, constraint=FIXED) pickedEdges = myPlateInstance.edges.findAt(((0.,40.,0.),),) myAssembly.seedEdgeByNumber(edges=pickedEdges, number=6, constraint=FIXED) elemType1 = mesh.ElemType(elemCode=DC2D8, elemLibrary=STANDARD) elemType2 = mesh.ElemType(elemCode=DC2D6, elemLibrary=STANDARD) faces1 = myPlateInstance.faces pickedRegions =(faces1, ) myAssembly.setElementType(regions=pickedRegions, elemTypes=(elemType1,elemType2)) partInstances =(myPlateInstance, ) myAssembly.generateMesh(regions=partInstances) #--------------------------------------------------------------------------- # Create the job and submit it for analysis myJob = mdb.Job(name=modelName, model=modelName, description='Heat transfer analysis') mdb.saveAs(pathName=modelName) #---------------------------------------------------------------------------