CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   DEFINE_DPM_INJECTION_INIT Question (https://www.cfd-online.com/Forums/fluent/86624-define_dpm_injection_init-question.html)

TedBrogan March 28, 2011 15:35

DEFINE_DPM_INJECTION_INIT Question
 
I am trying to inject particles when the volume fraction in a cell becomes less than 0.3 (first step in eventually trying to replace VOF droplets with particles). However, I cannot even get FLUENT to do the particle injection via UDF. I have an injection defined and I link this UDF to the injection. Can anyone tell me where I'm going wrong? Thanks.


#include "udf.h"

DEFINE_DPM_INJECTION_INIT(init_particles,I)
{
real threshold = 0.3;
real x[1];
Particle *p;
Domain *d = Get_Domain(1);
int ID = 2;
Thread *t1 = Lookup_Thread(d,ID);
cell_t c1;

thread_loop_c(t1,d)
{
begin_c_loop(c1,t1)
{
if(C_VOF(c1,t1) < threshold)
{
C_CENTROID(x,c1,t1);
Message("Initializing*Injection:*%s\n",I->name);
loop(p,I->p_init)
{
P_DIAM(p) = 1e-3;
P_RHO(p) = 1.0;
P_FLOW_RATE(p) = 1.0;
P_POS(p)[0] = x[0];
P_POS(p)[1] = x[1];
}
}
end_c_loop(c1,t1)
}
}
}


All times are GMT -4. The time now is 05:38.