资源预览内容
第1页 / 共104页
第2页 / 共104页
第3页 / 共104页
第4页 / 共104页
第5页 / 共104页
第6页 / 共104页
第7页 / 共104页
第8页 / 共104页
第9页 / 共104页
第10页 / 共104页
亲,该文档总共104页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
A-1ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.April 28, 2009 Inventory #002598ANSYS 12.0 Training ManualCFX 12.0Introduction to CFXPart E Appendix A-E, 104 PagesA-2ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.April 28, 2009 Inventory #002598Appendix AScripting and AutomationIntroduction to CFX Scripting and AutomationA-3ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.April 28, 2009 Inventory #002598Training Manual Introduction CFX User Environment (CUE) architecture State and Session Files Introduction to Perl CCL and Perl “Power Syntax” Perl subroutines MacrosOverviewScripting and AutomationA-4ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.April 28, 2009 Inventory #002598Training Manual Need for scripting and automation Increase productivity by simplifying repetitive tasks Standardize practices Save and re-use data IntroductionScripting and AutomationA-5ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.April 28, 2009 Inventory #002598Training Manual CUE is the common development environment for all CFX products CUE applications employ a client-server architecture The user interfaces with the “client”, while the “server” processes the data The most common client is a graphical user interface, but line and batch interfaces also existServerClientUser InputCCLCFX User EnvironmentScripting and AutomationA-6ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.April 28, 2009 Inventory #002598Training Manual Default mode of operation Graphical client driven by user input User loads results, states, runs sessions and macrosEngineGUIUserCCLGUI ModeScripting and AutomationA-7ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.April 28, 2009 Inventory #002598Training Manual Open session launched from command line or within a script by specifying -line flag e.g. cfx5post line Client includes viewer and a command line input CCL objects and commands are input one line at a time Allows interactive scripts with control outside of script Line input modes exist for TurboGrid, Pre, Post, Solver (solver uses ccl flag)EngineLine Input / ViewerUser/ScriptCCLLine Input ModeScripting and AutomationA-8ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.April 28, 2009 Inventory #002598Training Manual Closed session (not interactive) launched from command line or script Direct to engine No viewer Session file specified at run time Session file may include interactive commands, load states, results, etc. Must end with a quit statementEngineScriptCCLBatch ModeScripting and AutomationA-9ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.April 28, 2009 Inventory #002598Training Manual Session files contain a list of commands and CCL objects Can record the commands executed during a session to a file and then play back the file at a later date or in batch mode Can write/modify session files in a text editor Produced in Pre, Post, TurboGrid Session files can perform actions, for example Input / OutputSession FilesScripting and AutomationA-10ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.April 28, 2009 Inventory #002598Training Manual State files are a snap-shot of the current state of all objects Can be created to save or load a number of objects Contain CCL objects-parameter definitions Can write / modify state files using a text editor Produced in Pre, Post, TurboGrid State files cannot perform actionsState FilesA-11ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.April 28, 2009 Inventory #002598Introduction to PerlScripting and AutomationA-12ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.April 28, 2009 Inventory #002598Training Manual Perl is a public domain scripting language that combines the features and purposes of many command languages and tools It is a fully featured programming language (even supports Object Oriented programming) Has replaced shell scripting, awk, sed, regexp, grep, etc. inside of CFX Good text handling and parsing capabilitiesWhat is Perl?Scripting and AutomationA-13ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.April 28, 2009 Inventory #002598Training Manual Advantages Powerful, consistent, fully-featured programming language System interoperability (Windows/Unix) Strong user base $name = ; chomp($name); if ($name eq “Steve”) print “Hi Steve! Good to see you again!n”; #friendly greeting else print “Hello, $name. Nice to meet you.n”; #ordinary greeting Perl ExampleScripting and AutomationA-16ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.April 28, 2009 Inventory #002598Training Manual Perl statements are terminated by a semicolon (;) Whitespace and indentation do not matter Except for making the code readable. Everything is case sensitive Comments are preceded by
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号