CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

Magnus lift force using UDF - urgent help please

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   December 2, 2008, 02:50
Default 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[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)); }

  Reply With Quote

Old   December 2, 2008, 10:53
Default Re: Magnus lift force using UDF - urgent help plea
  #2
Angela Wang
Guest
 
Posts: n/a
Nobody knows?

  Reply With Quote

Old   December 17, 2008, 07:03
Default 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[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
  Reply With Quote

Reply

Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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 07: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 02: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 12:57


All times are GMT -4. The time now is 02:03.