24小时热门版块排行榜    

查看: 1695  |  回复: 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 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 今天系统多次维护,明天很可能放榜! +6 zju2000 2026-08-16 6/300 2026-08-17 10:01 by xter9665
[基金申请] 哪位老哥知道今年的国自然具体哪一天放榜? +10 Ldrop2023 2026-08-13 10/500 2026-08-17 09:59 by 小豌豆_发芽
[教师之家] 售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急 +3 6GojgJvkDudM 2026-08-16 3/150 2026-08-17 09:49 by xLVPIRuSvCUe
[基金申请] 欢迎发来filecode的Mz6后的代码验证其规律 +32 医学老男孩 2026-08-13 74/3700 2026-08-16 21:05 by 医学老男孩
[论文投稿] 岩土工程学报什么时候才能终审完呐 25+3 yeager111 2026-08-10 4/200 2026-08-16 20:42 by tfang
[基金申请] 时间戳又变了8-15 +13 archvillain 2026-08-15 25/1250 2026-08-16 20:13 by zhaosm1982
[精细化工] 招聘 金属平磨液,抛光液研发工程师 +3 小天0311 2026-08-14 3/150 2026-08-16 07:31 by H9PLUS
[基金申请] 关于Filecode分析方法 +10 majunge000 2026-08-10 13/650 2026-08-15 12:26 by hanpeng972
[基金申请] 各位道友,我要去昆明玩几天,回来见。 +7 Tide man 2026-08-14 8/400 2026-08-15 01:11 by arzu_hma
[硕博家园] 读博的好处 +4 lnee 2026-08-11 4/200 2026-08-14 10:20 by ahsoarli
[基金申请] 静等基金结果 +8 gjjjzhong 2026-08-10 21/1050 2026-08-13 17:56 by 且听虎啸
[基金申请] 重要来源:本周末出结果 +10 瞬息宇宙 2026-08-12 10/500 2026-08-13 15:46 by likettle
[基金申请] 不应该看fileCode +7 且听虎啸 2026-08-12 9/450 2026-08-13 14:27 by flydreamws
[基金申请] Filecode 又变了,巨变 +3 WH3796 2026-08-12 4/200 2026-08-13 14:13 by 小木虫6752397
[基金申请] 结合人工智能,周易传统文化,filecode打分制来了,3分以上希望很大。 +3 Tide man 2026-08-12 4/200 2026-08-13 08:35 by ZJTJZ
[基金申请] 2019年青年基金涵评意见,大家看看几个A,几个B? +11 Tide man 2026-08-11 11/550 2026-08-13 07:35 by 撸猫猫
[基金申请] 帮忙看看fileCode +7 wwncly 2026-08-10 13/650 2026-08-11 19:36 by 冰心玉壶晴
[基金申请] 为什么网上很多人说本周 12号出结果 +6 瞬息宇宙 2026-08-10 7/350 2026-08-11 19:25 by Tide man
[基金申请] 什么时候出结果,有咨询渠道??? +3 Tide man 2026-08-11 3/150 2026-08-11 17:54 by kudofaye
[基金申请] 确定了,国自然21号放榜 +6 布布和一二 2026-08-10 7/350 2026-08-10 19:15 by 2000zf36392
信息提示
请填处理意见