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

I need you help about DUF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 31, 2001, 05:32
Default I need you help about DUF
  #1
cfdfans
Guest
 
Posts: n/a
hi

I want to calculate the multiphase flow .And I want to give a centripetal acceleration to particle.I must get the current position of particle.

I use "p->state.pos[1]" but the fluent show error

the follow is my program

#include "dpm.h" #include "sg.h" #include "prop.h"

#define C_acceler 30.0 /* centripetal acceleration */

DEFINE_DPM_BODY_FORCE(particle_body_force, p, i) {

real y,z; real alpha; face_t f; /* particle_state_t *c = &(p->state); */ float bforce; /* centripetal force */

y = p->state.pos[1]; /* particle y axis coordinate */ z = p->state.pos[2]; /* particle z axis coordinate */

alpha = acos(fabs(z)/(sqrt(pow(z,2)+pow(y,2))));

if(z>0)

{

if(y>0)

{

if(i==1) bforce=-C_acceler*sin(alpha)*P_MASS(p)*9.8;

else if(i==2) bforce=-C_acceler*cos(alpha)*P_MASS(p)*9.8;

}

else

{

if(i==1) bforce=C_acceler*sin(alpha)*P_MASS(p)*9.8;

else if(i==2) bforce=-C_acceler*cos(alpha)*P_MASS(p)*9.8;

}

}

else

{

if(y>0)

{

if(i==1) bforce=-C_acceler*sin(alpha)*P_MASS(p)*9.8;

else if(i==2) bforce=C_acceler*cos(alpha)*P_MASS(p)*9.8;

}

else

{

if(i==1) bforce=C_acceler*sin(alpha)*P_MASS(p)*9.8;

else if(i==2) bforce=C_acceler*cos(alpha)*P_MASS(p)*9.8;

}

}

return (bforce);

}

After Interpreted compile flunet show error " structure reference not implemneted" what's wrong wiht it ?what can I do , can you give me some advise, I hope you can help me ,thank you very much thanks

  Reply With Quote

Old   April 2, 2001, 16:47
Default Re: I need you help about DUF
  #2
Newbie
Guest
 
Posts: n/a
I'm not an expert but I see that you're lacking of

#include "udf.h"

also keep in count that the arrays in c begins in 0, so the positions are in state.pos[0],state.pos[1], state.pos[2]

Hope this helps Arturo
  Reply With Quote

Old   April 2, 2001, 21:04
Default Re: I need you help about DUF
  #3
cfdfans
Guest
 
Posts: n/a
thank you I have include "udf.h" in my program, when I copy it to here ,I miss it.

I have compile the example program in UDF Use's Guide 5.4.1 "Melting Index Along a Particle Trajectory" ,it failed either.

could you help me ,if you know the reason, please tell me ,thank you
  Reply With Quote

Old   April 3, 2001, 11:15
Default Re: I need you help about DUF
  #4
Newbie
Guest
 
Posts: n/a
Weird, I have compiled the same example flawlessly. In which platform are you running? Maybe you have to check your compiler installation.

Regards
  Reply With Quote

Old   April 4, 2001, 00:41
Default Re: I need you help about DUF
  #5
cfdfans
Guest
 
Posts: n/a
I use fluent 5.4 in nt4 do you use Interpreted UDFs or Compiled UDFs when you comilpe the example code.

thank you
  Reply With Quote

Old   April 4, 2001, 13:31
Default Re: I need you help about DUF
  #6
Newbie
Guest
 
Posts: n/a
I work in NT and Linux and always compile my functions, maybe that is your problem because some structures are not available in interpreted functions. Try to compile. Regards
  Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
duf source code wlt_1985 FLUENT 0 October 13, 2010 14:24


All times are GMT -4. The time now is 16:20.