CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)

 cfdfans March 31, 2001 05:32

I need you help about DUF

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

#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

 Newbie April 2, 2001 16:47

Re: I need you help about DUF

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

 cfdfans April 2, 2001 21:04

Re: I need you help about DUF

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

 Newbie April 3, 2001 11:15

Re: I need you help about DUF

Weird, I have compiled the same example flawlessly. In which platform are you running? Maybe you have to check your compiler installation.

Regards

 cfdfans April 4, 2001 00:41

Re: I need you help about DUF

I use fluent 5.4 in nt4 do you use Interpreted UDFs or Compiled UDFs when you comilpe the example code.

thank you

 Newbie April 4, 2001 13:31

Re: I need you help about DUF

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

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