|
[Sponsors] |
January 6, 2007, 10:50 |
Help: UDF of "particle body force" !!!
|
#1 |
Guest
Posts: n/a
|
Happy new year, everyone I hope get help from you. I have compiled a UDF about particle body force, but it doesn't work. The physic model is this: the particle is injecting into enclosure. The body force forces on particles according to different positions of particles. My UDF is:
#include "udf.h" #include "dpm.h" #include "surf.h" #define C1 2.2 #define C2 1.5 DEFINE_DPM_BODY_FORCE(p_b_force,p,i) { cell_t c=RP_CELL(&(p->cCell)); Thread *t = RP_THREAD(&(p->cCell)); Particle *p; real bforce; if(i==1) bforce=0; else if(i==0) { bforce=C1*P_POS(p)[0]+C2*P_POS(p)[1]; } return (bforce/P_MASS(p)); } but it has some problem as follows: (system "move user_nt.udf libudf\ntx86\2d")0 (system "copy C:\Fluent.Inc\fluent6.1.22\src\makefile_nt.udf libudf\ntx86\2d\makefile") (chdir "libudf")() (chdir "ntx86\2d")() 004.c ..\..\src\004.c(10) : error C2082: redefinition of formal parameter 'p' Done. Opening library "libudf"... Error: open_udf_library: the system can not find the library。 Error Object: () If I delete the code "Particle *p", it will be still have a error as follows: Error: get_udf_function: function p_b_force has wrong type: 27 != 17 Error Object: () Hope your reply. Thanks a lot! |
|
January 8, 2007, 12:29 |
Re: Help: UDF of "particle body force" !!!
|
#2 |
Guest
Posts: n/a
|
It is not required to define Particle *p, This will be passed as an argument buy fluent itself (p_b_force,p,i).
Error: get_udf_function: function p_b_force has wrong type: 27 != 17 Error Object: () This error usually occurs when you are hooking the udf at wrong position. Regards, Sujith S Nair |
|
January 9, 2007, 08:45 |
Re: Help: UDF of "particle body force" !!!
|
#3 |
Guest
Posts: n/a
|
sujith:
Thank you very much.Maybe you are right.I have been chosen "Initialization--p_b_force"in "User-Defined Fuctions" panel when i set injection properies of particles. I have do it according to your advice. It remain have some problems. i haven`t see any particles in the region after computing. Maybe,My programs have some problems. I have to check it. Thank you again!!! |
|
January 16, 2007, 21:17 |
Re: Help: UDF of "particle body force" !!!
|
#4 |
Guest
Posts: n/a
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF in Fluent | Andrew | Fluent UDF and Scheme Programming | 5 | March 7, 2016 04:38 |
Force can not converge | colopolo | CFX | 13 | October 4, 2011 23:03 |
UDF force on a face | enry | Fluent UDF and Scheme Programming | 10 | March 23, 2011 11:48 |
Problem with a simple UDF to calculate cell-averaged particle values | kmayank | FLUENT | 1 | January 18, 2011 02:40 |
Magnus lift force using UDF - urgent help please | Angela Wang | FLUENT | 2 | December 17, 2008 07:03 |