24小时热门版块排行榜    

查看: 1623  |  回复: 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 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 272求调剂 +4 田智友 2026-02-28 4/200 2026-03-01 06:43 by 刘兵
[考研] 材料调剂 +4 爱擦汗的可乐冰 2026-02-28 4/200 2026-03-01 00:38 by 猫猫球alter
[基金申请] 面上模板改不了页边距吧? +5 ieewxg 2026-02-25 6/300 2026-03-01 00:10 by addressing
[考研] 317一志愿华南理工电气工程求调剂 +5 Soliloquy_Q 2026-02-28 8/400 2026-02-28 23:36 by xyx2012xyx
[考研] 272求调剂 +3 材紫有化 2026-02-28 3/150 2026-02-28 22:52 by ms629
[考研] 化工专硕348,一志愿985求调剂 +4 弗格个 2026-02-28 6/300 2026-02-28 22:00 by wang_dand
[考研] 290求调剂 +5 材料专硕调剂; 2026-02-28 6/300 2026-02-28 21:40 by gaoxiaoniuma
[考研] 295求调剂 +5 19171856320 2026-02-28 5/250 2026-02-28 21:39 by gaoxiaoniuma
[考研] 材料学调剂 +5 提神豆沙包 2026-02-28 5/250 2026-02-28 21:34 by gaoxiaoniuma
[考研] 264求调剂 +3 巴拉巴拉根556 2026-02-28 3/150 2026-02-28 21:31 by gaoxiaoniuma
[考研] 311求调剂 +8 南迦720 2026-02-28 8/400 2026-02-28 21:30 by gaoxiaoniuma
[考研] 085600材料工程一志愿中科大总分312求调剂 +8 吃宵夜1 2026-02-28 10/500 2026-02-28 20:27 by L135790
[考研] 276求调剂 +3 路lyh123 2026-02-28 4/200 2026-02-28 19:45 by 路lyh123
[考研] 0856材料求调剂 +10 hyf hyf hyf 2026-02-28 11/550 2026-02-28 18:50 by 无际的草原
[考博] 博士自荐 +3 kkluvs 2026-02-28 3/150 2026-02-28 16:59 by StarAura
[考研] 寻找调剂 +3 LYidhsjabdj 2026-02-28 3/150 2026-02-28 12:59 by miniwendy
[考研] 304求调剂 +5 曼殊2266 2026-02-28 6/300 2026-02-28 12:44 by 迷糊CCPs
[硕博家园] 博士自荐 +6 科研狗111 2026-02-26 9/450 2026-02-28 12:32 by seaskyy
[基金申请] 面上可以超过30页吧? +12 阿拉贡aragon 2026-02-22 13/650 2026-02-26 22:09 by Hahaxia
[硕博家园] 【博士招生】太原理工大学2026化工博士 +4 N1ce_try 2026-02-24 8/400 2026-02-26 08:40 by N1ce_try
信息提示
请填处理意见