CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF for unsteady spray (http://www.cfd-online.com/Forums/fluent/40843-udf-unsteady-spray.html)

Fernando May 5, 2006 14:13

UDF for unsteady spray
 
Hi to all

Can anybody enlighten me in the writing of an UDF to define unsteady mass flow rate in a spray? I have tried the subroutine below but it does not want to compile.

#include "udf.h" #include "surf.h" #include "dpm.h"

DEFINE_DPM_INJECTION_INIT(pulse_spray, I) {

real spray;

Particle *p;

cell_t cell;

Thread *cthread;

loop(p, I->p_init)

{

cell = P_CELL(p);

cthread = P_CELL_THREAD(p);

real t=RP_Get_Real("flow-time");

P_FLOW_RATE(p) = 0.00011+0.00009*cos(200*M_PI*t);

spray=P_FLOW_RATE(p);

}

return spray

Thanks

Fernando


Adriano May 6, 2006 07:04

Re: UDF for unsteady spray
 
Hi, i think your problem is in the definition of the pointer 'p'. in subroutine you're using *p need to be passed to macros as Tracked_Particle type, so let's try to declare: 'Tracked_Particle *p' instead of 'Particle *p

I might be wrong but, It could be a solution.

Seeu Adriano Z

Fernando May 6, 2006 13:52

Re: UDF for unsteady spray
 
Thanks Adriano. I tried it but it still does not want to compile.

Adriano May 8, 2006 12:19

Re: UDF for unsteady spray
 
I'm working in a similar code and I've similar problems... so mahh?!?!


Fernando May 9, 2006 08:47

Re: UDF for unsteady spray
 
Adriano, I have corrected the UDF and it is compiling fine. If you see this send me an e-mail and I will send you the file. lopar30@hotmail.com

Regards

Fernando


All times are GMT -4. The time now is 08:52.