CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)

 ahvz March 22, 2013 06:24

about Time-Temperature profile for transient analysis

Hi there,

How to define/import a time-temperature into FLUENT regarding to make transient analysis?

Example:

at time(sec) Temp(C)

0 20
20 18
40 15
...

 vasava March 22, 2013 09:45

You can try this.

#include "udf.h"

{
face_t f;
real t = CURRENT_TIME;

if (t>=t1 && t<=t2){
}

if (t>=t2 && t<=t3){
}
.......... and so on
}

 ahvz March 22, 2013 10:06

I don't have any background upon UDF.

I thought it would be even simpler than that procedure, because I already did in ANSYS APDL by importing time-temperature profile as a text file to making transient analysis (temperature as a time dependent).

it seems in FLUENT is different and I should go to learn UDF and so on...

regards,

 ahvz March 23, 2013 07:19

still stuck with UDF...

I think Define_profile examples are not what I need (at least I don't know)

how to define the below variables to the boundary conditions ? I need example file regarding to transient analysis.

My problem variables are:

Time (sec) Temp(C)
300 22
600 20
900 24
1200 20
1500 15
1800 16.5
2100 10.5
2400 12
2700 12.263
3000 12.079
3300 11.977
3600 11.973
3900 11.781
4200 11.809
4500 11.603
4800 11.577
5100 11.486
5400 11.459
5700 11.375
6000 11.308
6300 11.289
6600 11.192
6900 11.148
7200 11.125

for now, I am here...

/************************************************** *********************
udfexample.c
UDF for specifying transient temperature profile boundary condition
************************************************** **********************/

#include "udf.h"

{
face_t f;

 jthiakz March 23, 2013 07:49

looking at the data. I could fit this in two linear equations and the same i can fit is UDF using simple expressions. other wise (method-2)you have to use mulitple if statements in UDF.
Method-1 ,
Plot the first curve (from 300 to 900 data) usign XY plot and get linear equation(Y=mx+C).
Plot the second curve (from 900 to 7200) and do the same.

 ahvz March 25, 2013 08:28

Indeed, I only defined temperature and for the time will be considered by the time steps in another field of software

Would you please providing feedback upon below texts ? I'm not sure if its correct.

/************************************************** *********************
udfexample.c
UDF for specifying transient temperature profile boundary condition
************************************************** **********************/

#include "udf.h"

{
face_t f;
real t = CURRENT_TIME;
{

if (t>=t1 && t<=t2){
}

if (t>=t2 && t<=t3){
}

if (t>=t3 && t<=t4){
}
if (t>=t4 && t<=t5){
}
if (t>=t5 && t<=t6){
}
if (t>=t6 && t<=t7){
}
if (t>=t7 && t<=t8){
}
if (t>=t8 && t<=t9){
}
if (t>=t9 && t<=t10){
}
if (t>=t10 && t<=t11){
}
if (t>=t11 && t<=t12){
}

}

 jthiakz March 25, 2013 09:50

# Need to define real variable for t1 to tn..
# what is that 10 to 20 , it suppose to be your temperature value..
# you used <= && >=, but for your case any one you can be used
means either <= && > or <&&>=

 vasava March 25, 2013 10:21

I think you must use curve fitting for the UDF. Else you will have lots of problem with convergence especially during the 'jumps'.

 ahvz March 25, 2013 19:32

Dear jthiakz,

Is it mandatory to define time variable also? can't I consider time steps from forwarded setting of the software instead of defining a new variable for time ? am I wrong ?

the values of 10, 11, 12,.... are temperature values.

 ahvz March 25, 2013 19:35

Dear Vasava,

I think "curve fitting" is usfule when there are regular temperature variation while in my case I dont have such a regular variables for the temeprature. thus, I think "curve fitting" is not enough for my purposes. isn't it ?

 vasava March 26, 2013 02:39

I understand your dilemma but the 'jumps' are the issue here.

 ahvz March 28, 2013 13:36

do you have any "curve fitting" example relevant ? I need step process or at least some example to do it. please providing if possible...

 diamondx March 28, 2013 20:13

put that on excel, and extract a tendency curve, it will give your the equation, go back to fluent and stick it to the UDF...

 ahvz March 30, 2013 08:50

1 Attachment(s)
I did the curve fitting and it gave me the attached document. is it write now through the program also?

I expected to do transient analysis with this temperature profile as a convection heat transfer boundary condition data:

/************************************************** *********************
udfexample.c
UDF for specifying transient temperature profile boundary condition
************************************************** **********************/

#include "udf.h"

{
face_t f;
real x[ND_ND]; /* this will hold the position vector */
real y;

{
y = x[0];

}
end_f_loop(f,t)
}

When I am doing analysis it do not conside any variables (only constant temperature as exist boundary conditions)
why Fluent do not show that the file is attached to the program or not? how can I check if there is an error or not.

regards,