|
[Sponsors] |
UDF library is not compiled for 2d on the current platform(win64). |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 20, 2016, 02:40 |
UDF library is not compiled for 2d on the current platform(win64).
|
#1 |
Member
Nate Lau
Join Date: Mar 2016
Posts: 33
Rep Power: 10 |
I am new to UDF. I want to write an UDF to solve the mass flux at inlet, but there is an error when compiling:
The UDF library you are trying to load is not compiled for 2d on the current platform(win64). I do not know how can I revise the 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; } |
|
March 20, 2016, 02:49 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Ensure your workflow is correct by checking my compiling process for Fluent UDFs with an existing library loaded.
|
|
March 20, 2016, 02:55 |
|
#3 |
Member
Nate Lau
Join Date: Mar 2016
Posts: 33
Rep Power: 10 |
Hi, 'e', many thanks for your suggestion. I have followed your step, however, it still doesn't work.
In addition, I found errors when I build the 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' So I think there must be something wrong with my code itself. Thank you again. |
|
March 20, 2016, 21:58 |
|
#4 |
Member
Nate Lau
Join Date: Mar 2016
Posts: 33
Rep Power: 10 |
It works after some revises:
#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); } |
|
March 21, 2016, 00:01 |
|
#5 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Copying your UDF to a text editor showed an extra (invalid) character on lines 5 and 12 as indicated with your error messages. The other three errors are self-explanatory. It's good to hear the UDF is working now.
|
|
March 21, 2016, 23:36 |
|
#6 |
Member
Nate Lau
Join Date: Mar 2016
Posts: 33
Rep Power: 10 |
Thank you very much.
|
|
Tags |
fluent, udf, udf and programming, udf compile, udf eror |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compiled UDF on BATCH file | Bionico | Fluent UDF and Scheme Programming | 3 | June 4, 2018 17:44 |
calling result of a UDF into current time step | Komon | Fluent UDF and Scheme Programming | 1 | April 1, 2012 20:53 |
cannot load UDF library | jayilosa | Fluent UDF and Scheme Programming | 3 | November 16, 2011 13:44 |
Help! Compiled UDF problem 4 Wave tank tutorial | Shane | FLUENT | 1 | September 3, 2010 03:32 |
building compiled udf s in windows | sourav | FLUENT | 8 | August 18, 2005 02:46 |