CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   parse error udf (https://www.cfd-online.com/Forums/fluent-udf/103779-parse-error-udf.html)

fatemeh chitgarha June 26, 2012 17:22

parse error udf
 
HI
When i interpret my UDF file, it says parse error in line 33,
#include "udf.h"
#include "sg_mem.h"
#include "outlet.h"
DEFINE_INIT(my_uds0, domain)
{
cell_t c;
Thread *t;

/* loop over all cell threads in the domain */
thread_loop_c (t,domain)
{
/* loop over all cells */
begin_c_loop_all (c,t)
{
if (C_FMEAN(c,t)>0.06)

C_UDSI(c,t,0) = 1.0;
else
C_UDSI(c,t,0) = 0.0;
}
end_c_loop_all (c,t)
}
}
DEFINE_DIFFUSIVITY(diffu,c,t,i)
{
return (C_MU_T(c,t)) / 0.9;
}

DEFINE_PROFILE(scaler_outlet,t,i)
{/*________ scaler outlet (ds/dn =0)(n:Boundary normal vector) _______*/}
real s;
face_t f;
begin_f_loop(f,t)
{
s=C_UDSI(F_C0(f,t),THREAD_T0(t),0);
F_PROFILE(f,t,i) = s;
}
end_f_loop(f,t)
}
Someone knows the problem?
plz help meeeeeeee!

forgottenman June 29, 2012 02:56

Hi
Try this one, it works.

#include "udf.h"
#include "sg_mem.h"
#include "outlet.h"
DEFINE_INIT(my_uds0, domain)
{
cell_t c;
Thread *t;

/* loop over all cell threads in the domain */
thread_loop_c (t,domain)
{
/* loop over all cells */
begin_c_loop_all (c,t)
{
if (C_FMEAN(c,t)>0.06)

C_UDSI(c,t,0) = 1.0;
else
C_UDSI(c,t,0) = 0.0;
}
end_c_loop_all (c,t)
}
}
DEFINE_DIFFUSIVITY(diffu,c,t,i)
{
return (C_MU_T(c,t)) / 0.9;
}

DEFINE_PROFILE(scaler_outlet,t,i)
{
real s;
face_t f;
begin_f_loop(f,t)
{
s=C_UDSI(F_C0(f,t),THREAD_T0(t),0);
F_PROFILE(f,t,i) = s;
}
end_f_loop(f,t)
}

fatemeh chitgarha June 29, 2012 04:33

Quote:

Originally Posted by forgottenman (Post 368825)
Hi
Try this one, it works.

#include "udf.h"
#include "sg_mem.h"
#include "outlet.h"
DEFINE_INIT(my_uds0, domain)
{
cell_t c;
Thread *t;

/* loop over all cell threads in the domain */
thread_loop_c (t,domain)
{
/* loop over all cells */
begin_c_loop_all (c,t)
{
if (C_FMEAN(c,t)>0.06)

C_UDSI(c,t,0) = 1.0;
else
C_UDSI(c,t,0) = 0.0;
}
end_c_loop_all (c,t)
}
}
DEFINE_DIFFUSIVITY(diffu,c,t,i)
{
return (C_MU_T(c,t)) / 0.9;
}

DEFINE_PROFILE(scaler_outlet,t,i)
{
real s;
face_t f;
begin_f_loop(f,t)
{
s=C_UDSI(F_C0(f,t),THREAD_T0(t),0);
F_PROFILE(f,t,i) = s;
}
end_f_loop(f,t)
}

yes THAnx, but when i hook scaler_oulet in outlet, fluent gives access violation fatal error!
Thanks in advance ...

forgottenman June 29, 2012 05:18

Close FLUENT and run it again to eliminate the error...
good luck

fatemeh chitgarha June 29, 2012 05:21

Quote:

Originally Posted by forgottenman (Post 368849)
Close FLUENT and run it again to eliminate the error...
good luck

SORRY. BUt my problem dont solve! i tested in my pc & notebook! but the same error repeated.

forgottenman June 29, 2012 05:24

save your case in another name and try it again...

fatemeh chitgarha June 29, 2012 05:30

Quote:

Originally Posted by forgottenman (Post 368851)
save your case in another name and try it again...

no! it not resolved!:(

forgottenman June 29, 2012 05:37

I tested your UDF in a case and it worked...
Set your problem from beginning:
Read the mesh file and first of all, interpret the UDF.
Then set the boundary conditions.

Let me know if it works.


All times are GMT -4. The time now is 00:27.