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 in UDF (https://www.cfd-online.com/Forums/fluent-udf/151225-parse-error-udf.html)

Agad15 April 7, 2015 02:53

Parse error in UDF
 
Hello,

I am trying to implement following UDF at a air-water boundary. While interpreting it is giving " line 3: parse error"

I have even tried copying both case and UDF into C:\Fluent.Inc\ntbin\ntx86, but of no use. Please try to help me what went wrong

#include "udf.h"
static real mu = 1.7894e-05 /*** viscosity of gas (in this case air) ***/
DEFINE_PROFILE(liquid, t, i)
{
face_t f;
cell_t c;
Thread *gaswall, *cellthread;
Domain *d;
int zone_ID = 1;
d = Get_Domain(1); /*** returns fluid domain pointer ***/
airwall = Lookup_Thread(d,zone_ID);
begin_f_loop(f, t)
{
c = F_C0(f,gaswall);
cellthread = THREAD_T0(gaswall);
F_PROFILE(f, t, i) = -mu*C_U_G(c,cellthread)[1];
}
end_f_loop(f, t)
}
DEFINE_PROFILE(gas, t, i)
{
face_t f;
Thread *liquidwall;
Domain *d;
int zone_ID = 2;
d = Get_Domain(1); /* returns fluid domain pointer */
waterwall = Lookup_Thread(d,zone_ID);
begin_f_loop(f, t)
{
F_PROFILE(f, t, i) = F_U(f,waterwall);
}
end_f_loop(f, t)
}

`e` April 7, 2015 03:08

You're missing a semicolon on your static variable initialisation, your code should be:

Code:

static real mu = 1.7894e-05;
Instead of declaring a static variable, you could use a material property macro C_MU_L or C_MU_T for laminar or turbulent viscosity, respectively.

Agad15 April 7, 2015 03:16

Thanks for your quick reply.

Though I have inserted ; as you said, I am still getting the parse error message. Any other suggestions?

Is there anything wrong with "line 3" ?


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