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/)
-   -   udf temperature (https://www.cfd-online.com/Forums/fluent-udf/123911-udf-temperature.html)

rayan24 September 24, 2013 04:22

udf temperature
 
Hi,

I want to impose a different temperature a different time, i want to impose 700K between t=0 and t=10s and T=400 K between t=10s and t=50s, can you see this udf and suggest me a correction, please?

Code:

#include "udf.h"
DEFINE_PROFILE(inlet_temperature,t,i)

{
real x[ND_ND];
real r;
face_t f;
real dt=CURRENT_TIME;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);

if ( dt <= 10)
F_PROFILE(f,t,i) =700;
}

if (10 < dt <= 50)

    F_PROFILE(f,t,i) =400;
end_f_loop(f,t)
}


kornetka September 24, 2013 15:13

Hi,
two things I noticed:
1. Try changing the 2nd if statement into conjuction of conditions, i.e.
Code:

10 < dt && dt <= 50
2. I think that values for both cases (F_PROFILE=...) should be inside the face loop.
Hope this helps,
Regards, kornetka

rayan24 September 25, 2013 08:57

Yes! good

Thanks :)


All times are GMT -4. The time now is 14:01.