Scheme Language in Fluent.ppt
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《Scheme Language in Fluent.ppt》由会员分享,可在线阅读,更多相关《Scheme Language in Fluent.ppt(34页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、PERA Global, ShanghailA dialect of LISP, a very old programming language.lIts grammar is very simple and its commands have a general form like: (Command Name, argument1,argument2.).lThe Scheme Command in FLUENT:1) Run simulation processes automatically(Journal file) 2) Extend the Interface of Fluent
2、. 1.Arithmetic Functions+ - * / , entspricht UPN, mehr als 2 Argumente mglich: (+ 2 4 5) 11 (/ 6 3) 2 (/ 2) ; similar to (/ 1 2) 0.5 (abs x), (sqrt x), (expt x y) = x y, (exp x) = e x, (log x) = ln x, (sin x), (cos x), (atan x), (atan x y) = arctan(x/y), Integer(!)-Functions: (remainder 45 6) 3 (mod
3、ulo 5 2) 1 (truncate x), (round x), (ceiling x), (floor x), . (max x y .), (min x y .) (apply max (1 5 8 3 4) ; find the maximum in a list 8 2.Global and Local VariablesGlobal variable defintion: (define x 3) (+ x 1) 4 No difference in variable types(integer,real,string).Changing variable values is
4、not possible in functions, which only local varialbes are valid:(set! x 1) to change variable values (display x) or (write x) to output variable values Integer (2), Float (2.5), Boolean (#t fr true, #f false) Strings (this is a text string) and Symbols: symbol, for example.: (define x this-is-a-symb
5、ol) Global variables and self-defined functions are valid until the end of Fluent. Lokale Scheme-Variablen Local varable definition:(let (var1 value1) (var2 value2) .) ;variables are valid only in this scope)3.“Format“ command (format #f format var1 and var like printf in C, . var1 var2 . ) l Tilde
6、() is used instead of %: a general format (Strings without ) d Integer 04d always 4 digits with enough 0 before (5 wird zu 0005) f floating number4.2f 1.2 -1.20 s String with (format #f string: s ! text) becomes string: text ! There are a few of ways to call scheme in FLUENT.1. Input the command in
7、the text interface There are a few of ways to call scheme in FLUENT.The scheme command can be also input in menu “Solve/Execute-Commands”, which will be executed by each iteration or time step. There are a few of ways to call scheme in FLUENT.Call in FLUENT menu using “File/Read/Scheme” to read a .s
8、cm file.If the scheme file is saved as .fluent and in the same directory as the case file, then it can be automatically loaded when the case file is read.FLUENT commands can be called in Scheme in two ways: Command in text interface(ti-menu-load-string “display/contour temperature 30 100”)It will re
9、turn “#t” if success, “#f” if failureThis is the normal and fast way to use fluent commands GUI command(not a common way)These commands are used in journal file, for example:(cx-gui-do cx-activate-item “Velocity Vectors*PanelButtons*PushButton1(OK)”) Call UDF in Scheme:(%udf-on-demand udf-eod-name)
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Scheme Language in Fluent
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内