|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
fluent插入udf后提示chip-exec:mycell_poriness:wrong return type: void udf function expected.
源代码如下:
- /* 下面是对坐标轴在进风巷口的多孔介质孔隙率编程 */
- #include "udf.h"
- #include "metric.h"
- #define L 100
- DEFINE_PROPERTY(mycell_poriness,cell,thread)
- {
- real myc_p;
- real x[ND_ND];
- cell_t c;
- Thread *t;
- real xx1,xx2,xx3;
- begin_c_loop(c,thread)
- {
- C_CENTROID(x,c,t)
- xx1=x[0];/*x轴方向,x指向采空区后方,长150m*/
- xx2=x[1];/*y轴方向,y指向工作面平行方向,及工作面长100m,左右各50m*/
- xx3=x[2];/*z轴方向,z指向采空区高度方向,多孔介质高20m*/
- if((xx1<=150)&&(xx1>=0)&&(xx2<=50)&&(xx2>=-50))
- {
- if((xx3<=20)&&(xx3>=0)&&(xx2>=50))
- myc_p=((0.2*exp(-0.0221*xx1)+0.1)*(exp(-0.15*(L+xx2))+1));
- else if((xx3<=20)&&(xx3>=0)&&(xx2<=50))
- myc_p=((0.2*exp(-0.0221*xx1)+0.1)*(exp(-0.15*(L-xx2))+1));
- }
- else myc_p=0;
- return myc_p;
- }
- end_c_loop(c,thread)
- }
- /* 下面是对底板遗煤厚度内瓦斯溢出源项编程 */
- #include "udf.h"
- #include "metric.h"
- #define L 100
- DEFINE_PROPERTY(mysource_ch4,cell,thread)
- {
- real mys_ch4;
- real x[ND_ND];
- cell_t c;
- Thread *t;
- real xx1,xx2,xx3;
- begin_c_loop(c,thread)
- {
- C_CENTROID(x,c,t)
- xx1=x[0];/*x轴方向,x指向采空区后方,长150m*/
- xx2=x[1];/*y轴方向,y指向工作面平行方向,及工作面长100m,左右各50m*/
- xx3=x[2];/*z轴方向,z指向采空区高度方向,多孔介质高20m*/
- if((xx1<=150)&&(xx1>=0)&&(xx2<=50)&&(xx2>=-50))
- {
- if((xx3<=0)&&(xx3>=-4))
- mys_ch4=0.4;
- }
- else mys_ch4=0;
- return mys_ch4;
- }
- end_c_loop(c,thread)
- }
复制代码
fluent插入udf后提示chip-exec:mycell_poriness:wrong return type: void udf function expected. 这是什么原因啊,是不是我的函数使用的不对? |
|