‌定制你的Fluent界面:个性化设置指南‌

Fluent可以实现界面定制

使用scheme语言可以之间对Fluent界面进行修改定制,同时这种语言还可以链接到UDF中,和UDF进行交互

使用方法:

1. 新建txt文档,写好scheme语言的脚本,将后缀名更改为.scm格式

2. 打开Fluent,点击左上角file-read-Scheme

3. 读取Scheme文件,然后会在界面显示代码定制的内容。

比如y+计算器就可以直接在Fluent界面显示

和之前文章四十五、壁面函数理论及y+的确定小程序结果对比,基本相同

下面是这个Y+计算器的代码:

代码经过复制粘贴之后格式好像就变了,我试了一下,复制到txt文档,不能正常使用,这里还是贴出来给大家参考。

代码源文件我会放在文章末尾的链接中,也会放在群文件,供大家使用

(define apply-cb #t)

(define update-cb #f)

;事件函数

(define (apply-cb . args)

   (display "")

)

(define (update-cb . args)

  (cx-set-real-entry real1 1.0);默认主流速度

  (cx-set-real-entry real2 1.215);密度

  (cx-set-real-entry real3 1.8e-5);粘度

  (cx-set-real-entry real4 0.5);特征长度

  (cx-set-real-entry real5 1.0);y+

)

(define (click . args)

   (define density (cx-show-real-entry real2))

   (define velocity (cx-show-real-entry real1))

   (define mu (cx-show-real-entry real3))

   (define length (cx-show-real-entry real4))

   (define ypl (cx-show-real-entry real5))

   (define re ( / ( * length ( * density velocity)) mu))

   (define cf (/ 0.026 (expt re (/ 1 7))))

   (define iwall (* 0.5 (* velocity (* velocity (* cf density)))))

   (define ufric (sqrt (/ iwall density)))

   (define DeltaS (* 2 (/ (/ (* ypl mu) ufric ) density )))

   (cx-set-real-entry real6 DeltaS)

   (cx-set-real-entry real7 re)

)

;界面布局

(define yplus (cx-create-panel "y+计算器" apply-cb update-cb))

(define table1 (cx-create-table yplus "Data Inputs"))

(define real1 (cx-create-real-entry table1 "Velocity(m/s):" 'row 0))

(define real2 (cx-create-real-entry table1 "Density(kg/m3):" 'row 1))

(define real3 (cx-create-real-entry table1 "Viscosity(Pa*s):" 'row 2))

(define real4 (cx-create-real-entry table1 "Length(m):" 'row 3))

(define real5 (cx-create-real-entry table1 "YPlus:" 'row 4))

(define button1 (cx-create-button yplus "Calculate" 'activate-callback click 'row 1))

(define table2 (cx-create-table yplus "Data Outputs") 'row 2)

(define real6 (cx-create-real-entry table2 "DeltaS(m):" 'row 1))

(define real7 (cx-create-real-entry table2 "Re:" 'row 2))

(cx-show-panel yplus)

https://pan.baidu.com/s/19LUcQJSPzGvuFWCbV4Q5Eg?pwd=b3s3 

提取码:b3s3

公众号:Fluent学习笔记。为了方便大家学习交流,我创建了QQ群:863690217,大家可以在其中讨论相关的问题,同时我会将所有文章的源文件都放到QQ群中,还会放一些其它的学习文件。欢迎大家加入。

QR Code
微信扫一扫,欢迎咨询~

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 155-2731-8020
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

手机不正确

公司不为空