CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Udf problem (http://www.cfd-online.com/Forums/fluent-udf/107769-udf-problem.html)

alexsatan October 6, 2012 06:56

Udf problem
 
HI,ALL

I am doing a simulation about two phases--air and water. I use dpm to interact with water , if i do nothing about DPM, DPM will interact with air phase, so I want to use UDF to remove DPM when it reach into air phase, here I write a UDF, when I interpreted it in Fluent, an error"undeclared variable" come out, and I donnot know why. Can anybody tell me ?

here is the UDF:

# include "udf.h"
# include "dpm.h"
DEFINE_DPM_SCALAR_UPDATE (reDPM,c,t,in,p)
{
cell_t c;
real vof_g = C_VOF (c,pt[0]);

if (vof_g>=0.1)
p->reDPM=-1;
else
return vof_g;
}

sadjad.s October 6, 2012 07:25

hi.
first, the 4th line is extra, because cell identifer "c" has been defined by second argument.
second you should define pt as a phase pointer variable (ie "Thread **pt;")

alexsatan October 7, 2012 05:37

Quote:

Originally Posted by sadjad.s (Post 385196)
hi.
first, the 4th line is extra, because cell identifer "c" has been defined by second argument.
second you should define pt as a phase pointer variable (ie "Thread **pt;")

hi:

I modified the UDF ,but there still is a error"line 5,parse error"

here is the UDF:

# include "udf.h"
# include "dpm.h"
DEFINE_DPM_SCALAR_UPDATE (reDPM,c,t,in,p)
{
Thread **pt;
real vof_g = C_VOF (c,pt[0]);

if (vof_g>=0.1)
p-> reDPM = -1;
else
return vof_g;
}


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