Fluent 批量添加线面、点面、平面的scheme实现  【转载】

您所在的位置:网站首页 fluent如何创建平面 Fluent 批量添加线面、点面、平面的scheme实现  【转载】

Fluent 批量添加线面、点面、平面的scheme实现  【转载】

2023-10-19 15:33| 来源: 网络整理| 查看: 265

转载自http://chan1629.blog.163.com/blog/static/19595703220137219166686

新建一个filename.scm,文件,用记事本打开。 在文件中输入以下内容:

(define y) "定义变量y

(do ((y 2 (+ y 1))) ((> y 301)) ''利用do过程实现循环,循环变量为y,初始值是2,每次加1,当y大于301时循环终止,

(ti-menu-load-string

(format #f "file /rcd moving100m-train--1-~05d " y)) ''ti-menu-load-string命令相当有用,在scm文件中利用它实现fluent中菜单命令,format语句,跟c语言中的printf功能同,这条语句也很重要,实现了向双引号内传递变量的功能。~05d 表示一个五位"数",低位为y,不足五位在高位用0补齐,常用。

(ti-menu-load-string "report/surface-integrals/area-weighted-avg (12 13) temperature yes temperature.srp yes") ''此语句输出id为12 13的面上的面平均静温到temperature.srp 文件。这些个语句怎么用,格式怎样,需要自己摸索。

(ti-menu-load-string "report/surface-integrals/area-weighted-avg (12 13) pressure yes pressure.srp yes")''同上

(ti-menu-load-string "report/surface-integrals/area-weighted-avg (12 13) velocity-magnitude yes velocity.srp yes")'同上

)''此括号为do过程的结束括号。

 

打开fluent,设置好工作目录,把刚才的filename.scm,文件放入工作目录内。

 

在TUI内按回车键后输入:(load "filenam.scm")

 

则会循环打开300个cas和dat文件,打开dat文件后,输出面12 13上的静温,静压和速度大小。

=====================================================================================

点面1:

(define (hy-create-point-surface name x y z)

(ti-menu-load-string

(format #f "/surface/point-surface ~a ~a ~a" name x y z)

)

)

(hy-create-point-surface "p1" 0 0 0)

=================================================================================================

点面2:

(do ((x 0 (+ x 0.2)) ) ((> x 1.0))

(ti-menu-load-string

(format #f "/surface/point-surface x-~3.1f ~a 0 0"))

)

=====================================================================================

线面:

(define m)

(define n)

(define i)

(do ((i 1 (+ i 1)) (m 156 (+ m 104)) (n 52 (+ n 104))) ((> i 15))

(ti-menu-load-string

(format #f "/surface/line-surface PL_i-~02d_1 45.6691 24.8664 ~a -45.669 24.8664 ~a\n" i m n))

(ti-menu-load-string

(format #f "/surface/line-surface PL_i-~02d_2 45.6691 -24.8664 ~a -45.669 -24.8664 ~a\n" i n m))

)



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3