| 查看: 2797 | 回复: 9 | |||
高歌旅客Les银虫 (小有名气)
|
[求助]
udf编写多孔介质气固换热系数遇到问题,求助~~~ 已有4人参与
|
|
在做多孔介质局部非热平衡模型,设置系数h时用udf编程,udf可以编译,但是初始化的时候总是报错,求助大神,到底怎么回事呢???? #include "udf.h" #include "metric.h" #include "sg.h" #include "mem.h" #include "math.h" #define Dp 0.00006 #define zeta 0.6 DEFINE_PROFILE(Velocity_inlet,thread,position) { real u; real t; face_t f; begin_f_loop(f,thread) { t=RP_Get_Real("flow-time" ;F_PROFILE(f,thread,position)=5*sin(188.5*t); } end_f_loop(f,thread) } DEFINE_PROFILE(Pressure_outlet,thread,position) { real p; real t; face_t f; begin_f_loop(f,thread) { t=RP_Get_Real("flow-time" ;F_PROFILE(f,thread,position)=4500000+1170000*sin(188.5*t); } end_f_loop(f,thread) } /*3. This module calculates the Heat transfer coefficient h(loc) for both the solid and the fluid phase based on the particle Reynolds Number Rep. */ double heat_t_coeff(cell_t c,Thread *t) { //FILE *t; //*HTC = (kf*(2+1.1Pr^0.333*Re^0.6))/dp;*/ double Pr,Re,HTC,U,dv,Rep,Area,Ux; //Interstial area between the solid and the Fluid Area=4.0*(1-zeta)/Dp; //void diameter dv=(4.0*zeta)/Area; //Average velocity U=sqrt(pow(C_U(c,t),2.)+pow(C_V(c,t),2.)); // modified Reynolds Number based on the void diameter Re=(U*dv*C_R(c,t))/C_MU_EFF(c,t); //Particle Reynolds Number based on Diamter of the particle(Dp). // Rep = (U*Dp*C_R(c,t))/C_MU_EFF(c,t); Rep=(U*Dp*C_R(c,t))/C_MU_L(c,t); //Fluid Prandtl Number // Pr = (C_MU_EFF(c,t)*C_CP(c,t))/C_K_L(c,t); // Pr = (C_MU_L(c,t)*C_CP(c,t))/therm_conduct(C_T(c,t)) ; Pr=(C_MU_L(c,t)*C_CP(c,t))/C_K_L(c,t) ; // C_UDMI(c,t,1)=therm_conduct(C_T(c,t)); /*Use this part of the code for E2 model of HTC*/ // printf("hello" ;// HTC = (C_K_L(c,t)*(2.0 +(1.1*pow(Pr,0.333)*pow(Rep,0.6))))/Dp; // HTC = (therm_conduct(C_T(c,t)) *(2.0 +(1.1*pow(Pr,0.333)*pow(Rep,0.6))))/Dp; // HTC = (C_K_L(c,t)*(2.0 +(1.1*pow(Pr,0.333)*pow(Rep,0.6))))/Dp; HTC=(C_K_L(c,t)*(2.0 +(1.1*pow(Pr,0.333)*pow(Rep,0.6))))/Dp; /*Use this part of code for E2 model of HTC if(Rep < 100) HTC=0.004*(C_K_EFF(c,t)/dv)*pow(Pr,0.3333)*pow(Re,1.35); else HTC =0.0156*(C_K_EFF(c,t)/dv)*pow(Pr,0.3333)*pow(Re,1.04); */ return HTC; } 初始化的时候报错如下: Error: received a fatal signal (Segmentation fault). Error Object: #f chip-exec: heat_t_coeff: wrong return type: void udf function expected Error: received a fatal signal (Segmentation fault). 求助大神!!!!!!@wuming524 |
» 猜你喜欢
北京211副教授,35岁,想重新出发,去国外做博后,怎么样?
已经有9人回复
有没有人能给点建议
已经有5人回复
假如你的研究生提出不合理要求
已经有12人回复
实验室接单子
已经有7人回复
全日制(定向)博士
已经有5人回复
萌生出自己或许不适合搞科研的想法,现在跑or等等看?
已经有4人回复
Materials Today Chemistry审稿周期
已经有4人回复
参与限项
已经有3人回复
对氯苯硼酸纯化
已经有3人回复
所感
已经有4人回复
» 本主题相关价值贴推荐,对您同样有帮助:
udf编写多孔介质气固间对流换热系数
已经有3人回复
多孔介质燃烧编写UDF气固两相控制方程的问题
已经有5人回复
FMStation
至尊木虫 (知名作家)
- 仿真EPI: 1
- 应助: 591 (博士)
- 贵宾: 0.03
- 金币: 18169.2
- 红花: 97
- 帖子: 8891
- 在线: 1486小时
- 虫号: 2400059
- 注册: 2013-04-04
- 专业: 计算机应用技术
【答案】应助回帖
感谢参与,应助指数 +1
|
http://www.cfd-online.com/Forums ... entation-fault.html The segmentation fault means that you try to access a variable, which is not saved. |
2楼2016-09-06 22:13:41
mycc
专家顾问 (正式写手)
-

专家经验: +181 - 应助: 230 (大学生)
- 金币: 2589.6
- 红花: 35
- 帖子: 531
- 在线: 58.8小时
- 虫号: 881523
- 注册: 2009-10-23
- 性别: GG
- 专业: 流体力学
- 管辖: 仿真模拟

3楼2016-09-07 08:09:55
dai26520
专家顾问 (著名写手)
-

专家经验: +219 - 仿真EPI: 1
- 应助: 224 (大学生)
- 金币: 4097
- 散金: 4143
- 红花: 107
- 帖子: 1850
- 在线: 529.6小时
- 虫号: 1619980
- 注册: 2012-02-16
- 专业: 高分子合成化学
- 管辖: 仿真模拟

4楼2016-09-07 08:35:39
高歌旅客Les
银虫 (小有名气)
- 应助: 0 (幼儿园)
- 金币: 249
- 帖子: 68
- 在线: 20.7小时
- 虫号: 3849833
- 注册: 2015-05-05
- 性别: MM
- 专业: 工程热物理相关交叉领域
5楼2016-09-07 10:18:42
mycc
专家顾问 (正式写手)
-

专家经验: +181 - 应助: 230 (大学生)
- 金币: 2589.6
- 红花: 35
- 帖子: 531
- 在线: 58.8小时
- 虫号: 881523
- 注册: 2009-10-23
- 性别: GG
- 专业: 流体力学
- 管辖: 仿真模拟

6楼2016-09-07 11:54:00
高歌旅客Les
银虫 (小有名气)
- 应助: 0 (幼儿园)
- 金币: 249
- 帖子: 68
- 在线: 20.7小时
- 虫号: 3849833
- 注册: 2015-05-05
- 性别: MM
- 专业: 工程热物理相关交叉领域
7楼2016-09-07 22:01:56
dai26520
专家顾问 (著名写手)
-

专家经验: +219 - 仿真EPI: 1
- 应助: 224 (大学生)
- 金币: 4097
- 散金: 4143
- 红花: 107
- 帖子: 1850
- 在线: 529.6小时
- 虫号: 1619980
- 注册: 2012-02-16
- 专业: 高分子合成化学
- 管辖: 仿真模拟

8楼2016-09-08 08:38:10
高歌旅客Les
银虫 (小有名气)
- 应助: 0 (幼儿园)
- 金币: 249
- 帖子: 68
- 在线: 20.7小时
- 虫号: 3849833
- 注册: 2015-05-05
- 性别: MM
- 专业: 工程热物理相关交叉领域
9楼2016-09-08 09:25:47
10楼2018-06-27 13:53:13












;
回复此楼
高歌旅客Les