你可以定制自己的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)



原文链接:

你可以定制自己的Fluent界面!使用scheme语言可以之间对Fluent界面进行修改定制,同时这种语言还可以链接到UDF中,和UDF进行交互https://mp.weixin.qq.com/s/3dhXlirAk5aCHFKbNriqQQ

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值