# Magnus lift force using UDF - urgent help please

 Register Blogs Members List Search Today's Posts Mark Forums Read December 2, 2008, 01:50 Magnus lift force using UDF - urgent help please #1 Angela Wang Guest   Posts: n/a Hi everybody, My case is a particle-air two phase flow in pipeline. My model to simulate the particle motion is the Discrete Phase Model.I want to include Magnus lift force using UDF. The rotate w (r/s) is got from the experiments. And the calculation involve the relative velocity of the particles. I use the macros -- P_CELL(p),P_CELL_THREAD(p)to get the cell information the particle are currently in. And then use the macro C_V(c,t)(here c=P_CELL(p) and t=P_CELL_THREAD(p))to get the air velocity of the cell in which particle is lying. When I compiled the UDF, the error came up as follows: error C2223: left of '->storage'must point to struct/union I don't know what's wrong. Here is my udf: DEFINE_DPM_BODY_FORCE(particle_body_force,p,i) { real bforce; int jd; real omgx,omgy,omgz; int j; srand((unsigned)time(NULL)); for(j=0; j<2;j++) { jd[j]=random(361); } omgx=XZOMG*cos(jd*3.14/180)*cos(jd*3.14/180); omgy=XZOMG*sin(jd*3.14/180); omgz=XZOMG*cos(jd*3.14/180)*sin(jd*3.14/180); if(i==0) { bforce=1/8*3.14*pow(0.002,3.0)*1.68*(omgz*(C_V(P_CELL(p),P_ CELL_THREAD(p))-P_VEL(p))+omgy*(C_W(P_CELL(p),P_CELL_THREAD(p))-P_VEL(p))); } if(i==1) { bforce=1/8*3.14*pow(0.002,3.0)*1.68*(omgz*(C_U(P_CELL(p),P_ CELL_THREAD(p))-P_VEL(p))+omgx*(C_W(P_CELL(p),P_CELL_THREAD(p))-P_VEL(p))); } if(i==2) { bforce=1/8*3.14*pow(0.002,3.0)*1.68*(omgx*(C_V(P_CELL(p),P_ CELL_THREAD(p))-P_VEL(p))+omgy*(C_U(P_CELL(p),P_CELL_THREAD(p))-P_VEL(p))); } return (bforce/P_MASS(p)); }  December 2, 2008, 09:53 Re: Magnus lift force using UDF - urgent help plea #2 Angela Wang Guest   Posts: n/a Nobody knows?  December 17, 2008, 06:03 Re: Magnus lift force using UDF - urgent help plea #3 KJ Larsen Guest   Posts: n/a Hello Angela Don't know if this is any help: I assume random(361) generates a random number is it returned as an integer as jd[j] expects? In your initialisation I think you need to specify int jd so that it is a 3 row column vector as I don't think the second and third variables for jd[j] can be added. Although it shouldn't cause a problem as you have it, it is easiest to put cell_t c = P_CELL(p); and Thread *t = P_CELL_THREAD(p); (where cell_t and Thread are data types for Fluent pointers) as initialised variables and then you can just type C_U(c,t) etc. Cheers. Kris Thread Tools Search this Thread Show Printable Version Email this Page Search this Thread: Advanced Search Display Modes Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are Off Pingbacks are On Refbacks are On Forum Rules Similar Threads Thread Thread Starter Forum Replies Last Post Kai Yan Main CFD Forum 0 July 16, 2008 07:07 Rola FLUENT 1 November 12, 2006 13:29 zaidun CFX 4 March 28, 2006 02:06 Min-Hua Wang CFX 0 December 2, 2003 18:21 Michele Spinolo FLUENT 6 June 27, 2002 12:57

All times are GMT -4. The time now is 10:49.