|
[Sponsors] |
Magnus lift force using UDF - urgent help please |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 2, 2008, 02:50 |
Magnus lift force using UDF - urgent help please
|
#1 |
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[1]; real omgx,omgy,omgz; int j; srand((unsigned)time(NULL)); for(j=0; j<2;j++) { jd[j]=random(361); } omgx=XZOMG*cos(jd[0]*3.14/180)*cos(jd[1]*3.14/180); omgy=XZOMG*sin(jd[0]*3.14/180); omgz=XZOMG*cos(jd[0]*3.14/180)*sin(jd[1]*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)[1])+omgy*(C_W(P_CELL(p),P_CELL_THREAD(p))-P_VEL(p)[2])); } 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)[0])+omgx*(C_W(P_CELL(p),P_CELL_THREAD(p))-P_VEL(p)[2])); } 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)[1])+omgy*(C_U(P_CELL(p),P_CELL_THREAD(p))-P_VEL(p)[0])); } return (bforce/P_MASS(p)); } |
|
December 2, 2008, 10:53 |
Re: Magnus lift force using UDF - urgent help plea
|
#2 |
Guest
Posts: n/a
|
Nobody knows?
|
|
December 17, 2008, 07:03 |
Re: Magnus lift force using UDF - urgent help plea
|
#3 |
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[3] 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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Urgently Need the code of Lift force and VM force | Kai Yan | Main CFD Forum | 0 | July 16, 2008 08:07 |
Lift force or coefficient of lift | Rola | FLUENT | 1 | November 12, 2006 14:29 |
how to calculate prssure force & lift force in CFX | zaidun | CFX | 4 | March 28, 2006 03:06 |
Lift Force | Min-Hua Wang | CFX | 0 | December 2, 2003 19:21 |
Some help simulating Magnus Force using Fluent | Michele Spinolo | FLUENT | 6 | June 27, 2002 13:57 |