ImageVerifierCode 换一换
格式:PDF , 页数:11 ,大小:358.92KB ,
资源ID:226687      下载积分:15 金币
快捷注册下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/226687.html】到电脑端继续下载(重复下载【60天内】不扣币)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

开通VIP折扣优惠下载文档

            查看会员权益                  [ 下载后找不到文档?]

填表反馈(24小时):  下载求助     关注领币    退款申请

开具发票请登录PC端进行申请

   平台协调中心        【在线客服】        免费申请共赢上传

权利声明

1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前可先查看【教您几个在下载文档中可以更好的避免被坑】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时联系平台进行协调解决,联系【微信客服】、【QQ客服】,若有其他问题请点击或扫码反馈【服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【版权申诉】”,意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:0574-28810668;投诉电话:18658249818。

注意事项

本文(在abaqus中利用python语言建模例子.pdf)为本站上传会员【曲****】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4009-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

在abaqus中利用python语言建模例子.pdf

1、3.1 Creating a partThe first example shows how you can use an Abaqus/CAE script to replicate the functionality of Abaqus/CAE.The script does the following:Creates a new model in the model database.Creates a two-dimensional sketch.Creates a three-dimensional,deformable part.Extrudes the two-dimension

2、al sketch to create the first geometric feature of the part.Creates a new viewport.Displays a shaded image of the new part in the new viewport.The new viewport and the shaded part are shown in Figure 3 7.Figure 3-1 The example creates a new viewport and a part.YQ Viewport for Model A Model:Model A P

3、art:Part A B QThe example scripts from this manual can be copied to the user5 s working directory by using the Abaqus fetch utility:abaqus fetch job=scriptNamewhere scriptName.py is the name of the script(see“Execution procedure for fetching sample input files,“Section 3.2.12 of the Abaqus Analysis

4、Users Manual).Use the following command to retrieve the script for this example:xyCoordsOuter 二(TO,30),(10,30),(40,-30),(30,-30),(20,-10),(-20,-10),(-30,-30),(-40,-30),(-10,30)for i in range(len(xyCoordsInner)-l):mySketch.Line(pointl=xyCoordsInneri,point2=xyCoordsInneri+1)for i in range(len(xyCoords

5、Outer)-1):mySketch.Line(point 1=xyCoordsOuteri,point2=xyCoords0uteri+1)myPart=myModel.Part(name=,Part A,,dimensionality=THREE_D,type=DEFORMABLE_BODY)myPart.BaseSolidExtrude(sketch=mySketch,depth=20.0)myViewport=session.Viewport(name=,Viewport for Model A,origin=(10,10),width=150,height=100)myViewpor

6、t.setValues(displayedObject=myPart)myViewport.partDisplay.setValues(renderStyle=SHADED)3.1.2 How does the script work?This section explains each portion of the example script.from abaqus import*This statement makes the basic Abaqus objects accessible to the script.It also provides access to a defaul

7、t model database using the variable named mdb.The statement,from abaqusConstants import*,makes the Symbolic Constants defined by the Abaqus Scripting Interface available to the script,import sketch import partThese statements provide access to the objects related to sketches and parts,sketch and par

8、t are cal led Python modules.The next statement in the script is shown in Figure 3-2.You can read this statement from right to left as follows:1.Create a new model named Model A.2.Store the new model in the model database mdb.3.Assign the new model to a variable called myModel.Figure 3-2 Creating a

9、new model.3.Assign a variable to the new model1.Create a new model named Model AmyModel=mdb.Model(name=1 Model A)2.Store the new model in the model database mdbmySketch=myModel.ConstrainedSketch(name=,Sketch A,sheetSize=200.0)This statement creates a new sketch object named Sketch A in myModel.The v

10、ariable mySketch is assigned to the new sketch.The sketch will be placed on a sheet 200 units square.Note the following:A command that creates something(an“object“in object-oriented programming terms)is called a constructor and starts with an uppercase character.You have seen the Model and Sketch co

11、mmands that create Model objects and Sketch objects,respectively.The command uses the variable myModel that we created in the previous statement.Using variables with meaningful names in a script makes the script easier to read and understand.xyCoordsInner=(-5,20),(5,20),(15,0),(-15,0),(-5,20)xyCoord

12、sOuter=(-10,30),(10,30),(40,-30),(30,-30),(20,-10),(-20,-10),(-30,-30),(-40,-30),(-10,30)These two statements define the X-andcoordinates of the vertices that form the inner and outer profile of the letter A.The variable xyCoordsInner refers to the vertices of the inner profile,and the variable xyCo

13、ordsOuter refers to the vertices of the outer profile,for i in range(len(xyCoordsInner)-1):mySketch.Line(pointl=xyCoordsInneri,point2=xyCoordsInneri+1)This loop creates the inner profile of the letter A in mySketch.Four lines are created using the 产 and coordinates of the vertices in xyCoordsInner t

14、o define the beginning point and the end point of each line.Note the following:Python uses only indentation to signify the start and the end of a loop.Python does not use the brackets of C and C+.The len()function returns the number of coordinate pairs in xyCoordsInnerfive in our example.The range()

15、function returns a sequence of integers.In Python,as in C and C+,the index of an array starts at zero.In our example range(4)returns 0,1,2,3.For each iteration of the loop in the example the variable i is assigned to the next value in the sequence of integers.Similarly,a second loop creates the oute

16、r profile of the A character.myPart=myModel.Part(name=,Part A,dimensionality=THREE_D,type=DEFORMABLE_BODY)This statement creates a three-dimensional,deformable part named Part A in myModel.The new part is assigned to the variable myPart.myPart.BaseSolidExtrude(sketch=mySketch,depth=20.0)This stateme

17、nt creates a base solid extrude feature in myPart by extruding mySketch through a depth of 20.0.myViewport=session.Viewport(name=,Viewport for Model A,origin=(20,20),width=150,height=100)This statement creates a new viewport named Viewport for Model A in session.The new viewport is assigned to the v

18、ariable myViewport.The origin of the viewport is at(20,20),and it has a width of 150 and a height of 100.myViewport.setValues(displayedObject=myPart)This statement tells Abaqus to display the new part,myPart,in the new viewport,myViewport.myViewport.partDisplayOptions.setValues(renderStyle=SHADED)Th

19、is statement sets the render style of the part display options in myViewport to shaded.As a result,myPart appears in the shaded render style.3.2 Reading from an output databaseThe second example shows how you can use the Abaqus Scripting Interface to read an output database,manipulate the data,and d

20、isplay the results using the Visualization module in Abaqus/CAE.The Abaqus Scripting Interface allows you to display the data even though you have not written it back to an output database.The script does the following:Opens the tutorial output database.Creates variables that refer to the first and

21、second steps in the output database.Creates variables that refer to the last frame of the first and second steps.Creates vari ables that refer to the di splacement fi eld output i n the last frame of the first and second steps.Creates variables that refer to the stress field output in the last frame

22、 of the first and second steps.Subtracts the displacement field output from the two steps and puts the result in a variable called deltaDisplacement.Subtracts the stress field output from the two steps and puts the result in a variable called deltaStress.Selects deltaDisplacement as the default defo

23、rmed variable.Selects the von Mises invariant of deltaStress as the default field output variable.Plots a contour plot of the result.The resulting contour plot is shown in Figure 3-3.Figure 3-3 The resulting contour plot.S-S/Mises(Aug:75%)+4.012e-02+3.678e-02+3.344e-02+3.01 le-02+2.677e-02+2.343e-02

24、2.010e-02+1.676e-02+1.342e-02+1.009e-02+6.750e-03+3.414e-03+7.711e-05XStep:Session Step,Step for Viewer non-persistent fields Session FramePrimary Var:S-S?MisesDeformed Var:U-U Deformation Scale Factor:+1.000e+00Use the following commands to retrieve the script and the output databasethat is readby

25、 the script:abaqus fetch abaqus fetchjob=odbExample job=viewer_tutorial3.2.1 The example script odbExample.pyScript to open an output database,superimpose variables from the last frame of different steps,and display a contour plot of the result.from abaqus import*from abaqusConstants import*import v

26、isualizationmyViewport=session.Viewport(name=,Superposition example,origin=(10,10),width=150,height=100)#Open the tutorial output database.myOdb=visualization.openOdb(path=viewer_tutorial.odb,)#Associate the output database with the viewport.myViewport.setValues(displayedObject=myOdb)#Create variabl

27、es that refer to the first two steps.f irstStep=myOdb.stepsStep-1secondStep=myOdb.steps Step-2#Read displacement and stress data from the last frame#of the first two steps.frame1=firstStep.frames-1frame2=secondStep.frames-1displacement!=framel.fieldOutputsU,displacement2=frame2.fieldOutputsU,stressl

28、framel.fieldOutputsS5stress2=frame2.fieldOutputsS#Find the added displacement and stress caused by the loading in the second step.deltaDisplacement=displacement2-displacement1deltaStress=stress2-stressl#Create a Mises stress contour plot of the result.myViewport.odbDisplay.setDeformedVariable(delta

29、Displacement)myViewport.odbDisplay.setPrimaryVariable(field=deltaStress,outputPosit ion=INTEGRATION_POINT,refinement=(INVARIANT,Mises)myViewport.odbDisplay.display.setValues(plotState=(CONTOURS_ON_DEF,)3.2.2 How does the script work?This section explains each portion of the example script.from abaqu

30、s import*from abaqusConstants import*These statements make the basic Abaqus objects accessible to the script as well as all the Symbolic Constants defined in the Abaqus Scripting Interface.import visualizationThis statement provides access to the commands that replicate the functionality of the Visu

31、alization module in Abaqus/CAE(Abaqus/Viewer).myViewport=session.Viewport(name=,Superposition example)This statement creates a new viewport named Superposition example in the session.The new viewport is assigned to the variable myViewport.The origin and the size of the viewport assume the default va

32、lues.odbPath=viewer_tutorial.odbThis statement creates a path to the tutorial output database.myOdb=session.openOdb(path=odbPath)This statement uses the path variable odbPath to open the output database and to assign it to the variable myOdb.myViewport.setValues(displayedObject=myOdb)This statement

33、displays the default plot of the output database in the viewport.firstStep=myOdb.stepsStep-1secondStep=myOdb.steps5 Step-25These statements assign the first and second steps in the output database to the variables firstStep and secondStep.frame1=firstStep.frames-1frame2=secondStep.frames-1These stat

34、ements assign the last frame of the first and second steps to the variables frame1 and frame2.In Python an index of 0 refers to the first item in a sequence.An index of-1 refers to the last item in a sequence.displacement!=framel.fieldOutputsUdisplacement?二 frame2.fieldOutputsU,These statements assi

35、gn the displacement field output in the last frame of the first and second steps to the variables displacement!and displacement2.stressl=framel.fieldOutputsSstress2=frame2.fieldOutputsSSimilarly,these statements assign the stress field output in the last frame of the first and second steps to the va

36、riables stressl and stress2.deltaDisplacement=displacement2-displacement1This statement subtracts the displacement field output from the last frame of the two steps and puts the resulting field output into a new variable deltaDisplacement.deltaStress=stress2-stresslSimilarly,this statement subtracts

37、 the stress field output and puts the result in the variable deltaStress.myViewport.odbDisplay.setDeformedVariable(deltaDisplacement)This statement uses deltaDisplacement,the displacement field output variable that we created earlier,to set the deformed variable.This is the variable that Abaqus will

38、 use to display the shape of the deformed model.myViewport.odbDisplay.setPrimaryVariable(field=deltaStress,outputPosition=INTEGRATION_POINT,refinement=(INVARIANT,Mises)This statement uses deltaStress,our stress field output variable,to set the primary variable.This is the variable that Abaqus will d

39、isplay in a contour or symbol plot.myViewport.odbDisplay.display.setValues(plotState=(C0NT0URS_0N_DEF,)The final statement sets the plot state to display a contour plot on the deformed model shape.3.3 SummaryThe examples illustrate how a script can operate on a model in a model database or on the da

40、ta stored in an output database.The details of the commands in the examples are described in later sections;however,you should note the following:You can run a script from the Abaqus/CAE startup screen when you start a session.After a session has started,you can run a script from the FileRun Script

41、menu or from the command line interface.A script is a sequence of commands stored in ASCII format and can be edited with a standard text editor.A set of example scripts are provided with Abaqus.Use the abaqus fetch command to retrieve a script and any associated files.You must use the import stateme

42、nt to make the required set of Abaqus Scripting Interface commands available.For example,the statement import part provides the commands that create and operate on parts.A command that creates something(an“object”in object-oriented programming terms)is called a constructor and starts with an upperca

43、se character.For example,the fol lowing statement uses the Model constructor to create a model object.myModel=mdb.Model(name=Model A)The model object created ismdb.models 5 Model A You can use a variable to refer to an object.Variables make your scripts easier to read and understand.myModel refers t

44、o a model object in the previous example.A Python script can include a loop.The start and end of a loop is controlled by indentation in the script.Python includes a set of built-in functions.For example,the len()function returns the length of a sequence.You can use commands to replicate any operation that can be performed interactively when you are working with Abaqus/CAE;for example,creating a viewport,displaying a contour plot,and setting the step and the frame to display.

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服