24小时热门版块排行榜    

查看: 1614  |  回复: 3

snecu

新虫 (小有名气)

[求助] UDF is not compiled for 2d on the current platform(win64).

大家好,本人UDF小白,想写一个UDF求进口的mass flux,我知道fluent可以直接积分出来,我在这里做一下UDF的联系。
code如下:
#include "udf.h"
#define rvol1_ID 5 //inlet ID
DEFINE_EXECUTE_AT_END(mfinlet)
{
        real massflux=0;
        Domain *d;
        Thread *thread, *t0, *t1;
        cell_t c0, c1;
        face_t f;
        real NV_VEC(psi_vec), NV_VEC(A);
        d= Get_Domain(1);  /* returns fluid domain pointer*/
        thread=Lookup_Thread(d, rvol1_ID);
        begin_f_loop(f,thread)
                {
                             t0=THREAD_T0(f,thread); c0=F_C0(f,thread);              
                              NV_D(psi_vec,=,C_U(c0,t0),C_V(c0,t0));
                              F_AREA(A,f,thread);
                             massflux+=NV_DOT(psi_vec,A);
                }
        end_f_loop(f,thread)
                massflux*=1.225;
}
我compile时,可以建立libudf,但是不能编译,显示如下错误,
The UDF library you are trying to load is not compiled for 2d on the current platform(win64).
不知道哪里出错了,是不是我的代码哪里不对?望指教
回复此楼

» 本帖已获得的红花(最新10朵)

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

snecu

新虫 (小有名气)

另外,在建立library时也出错了:
..\..\src\mfinlet.c(5) : error C2018: unknown character '0x7f'
..\..\src\mfinlet.c(12) : error C2018: unknown character '0x7f'
..\..\src\mfinlet.c(15) : warning C4002: too many actual parameters for macro 'THREAD_T0'
..\..\src\mfinlet.c(15) : error C2223: left of '->t0' must point to struct/union
..\..\src\mfinlet.c(16) : warning C4003: not enough actual parameters for macro 'NV_D'
2楼2016-03-20 15:00:59
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

snecu

新虫 (小有名气)

送红花一朵
修改了一下,可以了、
#include "udf.h"
#define rvol1_ID 15 //face ID
DEFINE_EXECUTE_AT_END(mfinlet)
{
     FILE *fp1;
        real massflux=0.0;
     real time1=CURRENT_TIME;
        Domain *d;
        Thread *thread, *t0, *t1;
        cell_t c0, c1;
        face_t f;
        real psi_vec[ND_ND],A[ND_ND];
        d= Get_Domain(1);  /* returns fluid domain pointer*/
        thread=Lookup_Thread(d, rvol1_ID);
        begin_f_loop(f,thread)
                {
                             t0=THREAD_T0(thread); c0=F_C0(f,thread);              
                              NV_D(psi_vec,=,C_U(c0,t0),C_V(c0,t0));
                              F_AREA(A,f,thread);
                             massflux+=NV_DOT(psi_vec,A);
                }
        end_f_loop(f,thread)
      massflux*=1.225;
        fp1=fopen("ab_MF.txt","a";
        fprintf(fp1,"%g     %g\n",time1,massflux);
        fclose(fp1);

}
3楼2016-03-20 16:09:53
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

纺大一哥

铁虫 (小有名气)

4楼2016-03-20 16:43:26
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 snecu 的主题更新
信息提示
请填处理意见