CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Trouble getting current temperature in a UDF (https://www.cfd-online.com/Forums/fluent/126034-trouble-getting-current-temperature-udf.html)

sparke03 November 6, 2013 13:36

Trouble getting current temperature in a UDF
 
I'm trying to write a UDF that will apply a new temperature to a wall at each time step. However, I keep getting an error message whenever I attempt to use F_T(f,t) or C_T(c,t). Here is my UDF:

DEFINE_PROFILE(WALL_NomOps,thread,i)
{
face_t f;
float t;
real current_temp;
begin_f_loop(f,thread)
{
t=N_TIME;
current_temp= F_T(f,t);
F_PROFILE(f,thread,i)=(4.19778032257033*pow(10,-15))*pow(t,6)+(-3.07012244075472*pow(10,-11))*pow(t,5)+(9.33165359014658*pow(10,-08))*pow(t,4)+(-0.000150853451771018)*pow(t,3)+(0.136765032525550) *pow(t,2)+(-65.9156858075105)*t+13191.0819218154+current_temp;
}
end_f_loop(f,thread)
}

I keep getting the error:

"invalid type conversion: float -> pointer to char."

Does anyone know what this error message means and how to fix it?

Thanks!

wond November 7, 2013 09:42

Replace the 'float' with 'real'

wond November 7, 2013 09:51

In addition, replace 't' with 'T'.
At the begining of your UDF, the t is a thread not a temperature subsequent yet. This will clash.


All times are GMT -4. The time now is 10:56.