|
[Sponsors] |
November 4, 2010, 04:56 |
what's the problem with my udf
|
#1 |
New Member
zhangzhiyan
Join Date: Jul 2010
Location: Urumqi CHINA
Posts: 16
Rep Power: 16 |
hi all
i want to use udf in my fluent , but i donot know whatis problem with my udf : udf 1 #include "udf.h" DEFINE_DPM_DRAG(particle_drag_force,Re,p) { real w, drag_force; if (Re < 0.01) { drag_force=18.0; return (drag_force); } else if (Re < 20.0) { w = log10(Re); drag_force = 18.0 + 2.367*pow(Re,0.82-0.05*w) ; return (drag_force); } else /* Note: suggested valid range 20 < Re < 260 */ { drag_force = 18.0 + 3.483*pow(Re,0.6305) ; return (drag_force); } } that udf can be used in fluent in "define--user defined--function--interpreted" way,but it can not be used in "define--user defined --function--compiled" way, maybe i was a mistake in complied way, any one can you tell me ,how i do "compiled "way, tell me the detail. thanks specially this udf2 #include "udf.h" #include "unsteady.h" #include "stdio.h" #include "stdlib.h" #include "memory.h" DEFINE_CG_MOTION(movewall,dt,vel,omega,time,dtime) { Thread *t; cell_t c; real cx,cy; //CArray<real,real&> vx,vy; int i; int n=0; //if(!Data_Valid_P()) //return; t=DT_THREAD(dt); cx=0; cy=0; begin_c_loop(c,t) { //vx.Add(C_U(c,t)); //vy.Add(C_U(c,t)); cx=cx+C_U(c,t); cy=cy+C_V(c,t); n++; } end_c_loop(c,t); cx=cx/n; cy=cy/n; cx=0; cy=0.05; vel[0]=cx; vel[1]=cy; //Message("\n n=%d, vx=%f, vy=%f\n",n,vel[0],vel[1]); } i do have no idea to do it. it can be compiled in vc,but cannot be bulid. it showed: --------------------Configuration: dymanic mesh - Win32 Debug-------------------- Compiling... dymanic mesh.c C:\Documents and Settings\Urumqi primaryschool\桌面\动网\dynamic\dymanic mesh.c(34) : warning C4305: '=' : truncation from 'const double ' to 'float ' C:\Documents and Settings\Urumqi primaryschool\桌面\动网\dynamic\dymanic mesh.c(13) : warning C4101: 'i' : unreferenced local variable dymanic mesh.obj - 0 error(s), 0 warning(s) --------------------Configuration: dymanic mesh - Win32 Debug-------------------- Linking... LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/dymanic mesh.exe : fatal error LNK1120: 1 unresolved externals 执行 link.exe 时出错. dymanic mesh.exe - 1 error(s), 0 warning(s) and how can i use it in fluent , maybe in the some way . all of that ,what i want to know is how i can use compiled way in fluent ,for i donot know how i can get the libudf file can you help me? thank you all! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM | Rizwan | Fluent UDF and Scheme Programming | 40 | March 18, 2018 07:05 |
Problem with my udf | july | Fluent UDF and Scheme Programming | 3 | June 20, 2010 07:56 |
UDF problem | mansha goraya | FLUENT | 0 | October 29, 2007 01:31 |
udf compiling problem | akr | FLUENT | 3 | August 22, 2007 08:14 |
UDF problem | chiseung | FLUENT | 4 | January 10, 2002 10:58 |