找回密码
 注册
查看: 2384|回复: 2

求助!!!UDF一加插入后就出现The FLUENT process could not be started

[复制链接]
发表于 2014-9-3 17:16:00 | 显示全部楼层 |阅读模式
5金钱
大神,在帮我看看吧,我的代码如下
/* 下面是对坐标轴在多孔介质中前部底面处多孔介质孔隙率编程  */
#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)
}
这次用个小的模型实验,发现打开组分运输,一插入udf后就会出现the FLUENT process could not be started。这是什么原因啊,我的case和*.c放在同一个目录了,网格质量也很好。cas文件在链接里


http://yunpan.cn/Q7VYYmcSUgpeQ  访问密码 b76b

发表于 2014-9-3 20:53:06 | 显示全部楼层
#include "udf.h"
#include "metric.h"
#define  L 100
DEFINE_PROPERTY(mycell_poriness,c,t)
{
real myc_p=0.;
real x[ND_ND];
real xx1,xx2,xx3;
begin_c_loop(c,t)
{
C_CENTROID(x,c,t)
xx1=x[0];
xx2=x[1];
xx3=x[2];
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.;
}
end_c_loop(c,t)
return myc_p;
}
编译没有错误,只是我找不到porosity加载udf的项,是不是用DEFINE_PROPERTY(mycell_poriness,c,t)定义孔隙率。
回复

使用道具 举报

 楼主| 发表于 2014-9-3 21:45:17 | 显示全部楼层
原帖由 classic1573 于 2014-9-3 20:53 发表
#include "udf.h"
#include "metric.h"
#define  L 100
DEFINE_PROPERTY(mycell_poriness,c,t)
{
real myc_p=0.;
real x[ND_ND];
real xx1,xx2,xx3;
begin_c_loop(c,t)
{
C_CENTROID(x,c,t)
xx1=x[0];
x ...

我也在vc里编译了,显示没有错误,加载项有啊,插入udf后,就在define---boundary--选中porous----然后set---在fluid窗口porous项最下方孔隙率处,点击constant下面就会有一个mycell_poriness。可能是版本问题,我再ansys13.0里的fluent里可以计算了。但是效果不好,我再看看有什么需要改进的不。
!!!现在的问题是chip-exec:mycell_poriness:wrong return type: void udf function expected.
请问怎样解决啊?????是不是我的function错了啊?

[ 本帖最后由 龙biscuit 于 2014-9-3 22:24 编辑 ]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表