| 查看: 3430 | 回复: 11 | ||
| 当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖 | ||
leixiaobo713银虫 (正式写手)
|
[求助]
fluent中UDF编译的问题!
|
|
|
本人想编的程序是这样的: 材料是有初始温度的,而且初始温度为X(X轴坐标)的函数;模拟开始后,在很短时间内材料的温度将发生变化,变化的温度为初始温度的函数,在一定时间后(上面提到的很短时间),材料的温度仅随流体的流动而自然发生变化,没有再生热源。我变得程序是这样的,虽然能编译,但是模拟一开始就出现错误,请高手指点,本人是小白,谢谢! #include "udf.h" DEFINE_PROFILE(unsteady_temperature,thread,position) { real t, temperature; face_t f; real x; begin_f_loop(f,thread) { t=RP_Get_Real("flow-time" ;if(t<=0.000000001) {temperature=325.0-0.115*x; F_PROFILE(f,thread,position) =temperature+(297.68625-7.37218/(1+exp((temperature-299.65187)/7.97379))); } else F_PROFILE(f,thread,position) =temperature; } end_f_loop(f,thread); } 模拟出现的错误提示: Updating solution at time level N... done. iter continuity x-velocity y-velocity energy time/iter chip-exec: unsteady_temperature: wrong return type: float udf function expectedchip-exec: unsteady_temperature: argument 1: incorrect type (36): int expectedchip-exec: unsteady_temperature: argument 2: incorrect type (5): pointer expected Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: () |
» 猜你喜欢
北京211副教授,35岁,想重新出发,去国外做博后,怎么样?
已经有9人回复
有没有人能给点建议
已经有5人回复
假如你的研究生提出不合理要求
已经有12人回复
实验室接单子
已经有7人回复
全日制(定向)博士
已经有5人回复
萌生出自己或许不适合搞科研的想法,现在跑or等等看?
已经有4人回复
Materials Today Chemistry审稿周期
已经有4人回复
参与限项
已经有3人回复
对氯苯硼酸纯化
已经有3人回复
所感
已经有4人回复
» 本主题相关商家推荐: (我也要在这里推广)

12楼2014-10-30 19:57:31
fangdian
木虫 (正式写手)
- 应助: 201 (大学生)
- 金币: 2836.4
- 散金: 64
- 红花: 33
- 帖子: 818
- 在线: 206.9小时
- 虫号: 1926821
- 注册: 2012-08-06
- 专业: 多相流热物理学
【答案】应助回帖
★ ★
感谢参与,应助指数 +1
xiegangmai: 金币+2, 谢谢参与! 2013-09-08 22:06:42
感谢参与,应助指数 +1
xiegangmai: 金币+2, 谢谢参与! 2013-09-08 22:06:42
| 是不是温度没有赋初值?如果t<=0.000000001条件达不到temperature等于多少呢??还有,即使满足t<=0.000000001,那么x值为多少?x不知道的话,温度也确定不了了啊 |
» 本帖已获得的红花(最新10朵)
2楼2013-09-04 08:41:46
leixiaobo713
银虫 (正式写手)
- 应助: 1 (幼儿园)
- 金币: 1228.5
- 散金: 148
- 红花: 4
- 帖子: 490
- 在线: 121.9小时
- 虫号: 1997539
- 注册: 2012-09-13
- 性别: GG
- 专业: 金属功能材料

3楼2013-09-04 09:11:56
leixiaobo713
银虫 (正式写手)
- 应助: 1 (幼儿园)
- 金币: 1228.5
- 散金: 148
- 红花: 4
- 帖子: 490
- 在线: 121.9小时
- 虫号: 1997539
- 注册: 2012-09-13
- 性别: GG
- 专业: 金属功能材料
|
#include "udf.h" DEFINE_PROFILE(unsteady_temperature,thread,position) { real t, temperature=298.0; face_t f; real x[ND_ND]; F_CENTROID(x,f,thread); begin_f_loop(f,thread) { t=RP_Get_Real("flow-time" ; if(t>0&&t<=0.1) F_PROFILE(f,thread,position)=temperature; else if(t>=0.1&&t<0.4) { temperature=298.0+5*x[1]; F_PROFILE(f,thread,position) =temperature+(297.68625-7.37218/(1+exp((temperature-299.65187)/7.97379))); } else { temperature=F_PROFILE(f,thread,position); F_PROFILE(f,thread,position) =temperature; } } end_f_loop(f,thread); } 我改成这样,还是上面的问题啊,请指教! FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: () |

4楼2013-09-04 11:13:42












;
回复此楼
leixiaobo713