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/)
-   -   uninitialized local variable 't' used (http://www.cfd-online.com/Forums/fluent-udf/105323-uninitialized-local-variable-t-used.html)

Blackhawks84 July 27, 2012 12:56

uninitialized local variable 't' used
 
Hello all,

I have recieved this error on line 12: mf_source_memory_limit20.c(12) : warning C4700: uninitialized local variable 't' used

It does not like t-> and I am unsure why......thank you in advance for your time.

Bradley



Here is my code:

# include"udf.h"
# include"mem.h"
# include"metric.h"
# include"math.h"
/*calculating and storing the source term*/
DEFINE_EXECUTE_AT_END(source_term)
{
#if !RP_HOST
Domain *d;
face_t f;
cell_t c0;
Thread *t,*t0=t->t0; /*this is line 12*/
double vof;
double vof_grad;
double st;
int Zone_ID = 6; /*zone id boundary conditions, 6 = base wall*/
double m_flux = 34.234; /*define mass flux, units: kg/(s*m^2)*/
d=Get_Domain(2); /*liquid domain*/
/*loops over all faces on the base wall in the liquid domain*/
t = Lookup_Thread(d,Zone_ID);
begin_f_loop(f,t)
{
t0 = THREAD_T0(t);
c0 = F_C0(f,t);
vof = C_UDSI(c0,t0,0);
vof_grad = C_UDMI(c0,t0,0);
/*loops over all cells adjacent to wall*/
if ((vof_grad < 0.001)||(vof < 0.001)||(vof > 0.999))
{
C_UDMI(c0,t0,1) = 0.0;
}
else
{
st = -1*(2*vof*vof_grad*m_flux);
C_UDMI(c0,t0,1) = st;
}
}
end_f_loop(f,t)
#endif
}


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