CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF problem- time dependent temperature at inlet (https://www.cfd-online.com/Forums/fluent/147692-udf-problem-time-dependent-temperature-inlet.html)

kaeran January 27, 2015 11:38

UDF problem- time dependent temperature at inlet
 
Hello everyone,

I am relatively new to UDF and I am facing a problem in interpreting an UDF defined by me.
The UDF is a time dependent temperature profile for the inlet of 3D model.
While interpreting the UDF, I received a problem stating that there is an error in line 11: subscripted expression is not an array or pointer: int.

the UDF is as follows,

#include "udf.h"

DEFINE_PROFILE(temp_inlet, thread, position)
{
face_t f;
real X[ND_ND];
real t = CURRENT_TIME;

begin_f_loop(f, thread)
{
F_CENTROID(f,thread,position) = (3.0e-10*t*t*t*t*t) - (3.0e-07*t*t*t*t) + (0.0001*t*t*t) - (0.0217*t*t) + (1.8728*t) + 70.839
}
end_f_loop(f, thread)
}


I would like to know if this UDF is correct and also will it work on HP cluster (parallel nodes)??:confused:

If this UDF is wrong please give me suggestions to improve it.

Thank you in advance

sircorp June 16, 2015 21:48

Quote:

Originally Posted by kaeran (Post 529239)
Hello everyone,

I am relatively new to UDF and I am facing a problem in interpreting an UDF defined by me.
The UDF is a time dependent temperature profile for the inlet of 3D model.
While interpreting the UDF, I received a problem stating that there is an error in line 11: subscripted expression is not an array or pointer: int.

the UDF is as follows,

#include "udf.h"

DEFINE_PROFILE(temp_inlet, thread, position)
{
face_t f;
real X[ND_ND];
real t = CURRENT_TIME;

begin_f_loop(f, thread)
{
F_CENTROID(f,thread,position) = (3.0e-10*t*t*t*t*t) - (3.0e-07*t*t*t*t) + (0.0001*t*t*t) - (0.0217*t*t) + (1.8728*t) + 70.839
}
end_f_loop(f, thread)
}


I would like to know if this UDF is correct and also will it work on HP cluster (parallel nodes)??:confused:

If this UDF is wrong please give me suggestions to improve it.

Thank you in advance


Please use the Power sign. 10*t*t*t**t*t is different than t^5 or 10^5

F_CENTROID(f,thread,position) = (3.0e-(pow(t,5) - (3.0e-07*pow(t,4) + (0.0001*pow(t,3) - (0.0217*pow(t,2)) + (1.8728*t) + 70.839

Shane


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