《ANSYS 12.0 官方培训手册-Introduction to CFX-PART E》由会员分享,可在线阅读,更多相关《ANSYS 12.0 官方培训手册-Introduction to CFX-PART E(104页珍藏版)》请在金锄头文库上搜索。
1、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 A
2、utomationIntroduction 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 subr
3、outines 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 Introductio
4、nScripting 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 th
5、e “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 Ma
6、nual 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 launch
7、ed 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
8、(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 N
9、o 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 #002598Trainin
10、g 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 action
11、s, 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 Contai
12、n 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 Auto
13、mationA-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 Obj
14、ect 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 Advantag
15、es 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 Exam
16、pleScripting 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