CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF for a horizontal temperature profile (http://www.cfd-online.com/Forums/fluent-udf/43764-udf-horizontal-temperature-profile.html)

 CD February 15, 2007 06:15

UDF for a horizontal temperature profile

Hello,

I'm trying to write an UDF for a temperature profile to use as an boundary condition on a horizontal wall (2D). I used the following UDF, but when I plot an xy-plot of the wall surface temperature it is just a constant. Can anybody tell me what I'm doing wrong?

Kind regards,

CD

/* test.c UDF for specifying temperature profile boundary condition on the bottom */

#include "udf.h"

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

real y;

face_t f;

{

y=x[1];

F_PROFILE(f, thread, position) = ... */ here stands the profile function as a function of y /*

}

}

 Rizwan February 15, 2007 16:36

Re: UDF for a horizontal temperature profile

this should be proper. dint chek it (as simulation running on my system) but thsi my understnading that temperature is varying along horizontal (along x) i guess .

#include "udf.h"

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

real y;

face_t f;

{

y=x[0];

F_PROFILE(f, thread, position) = ... */ here stands the profile function as a function of y /*

}

}

 Ted February 16, 2007 05:10

Re: UDF for a horizontal temperature profile

Thank you for your time and help Rizwan!

Ted

 Rizwan February 16, 2007 07:30

Re: UDF for a horizontal temperature profile

I wish you could hav told whether its working according to what u needed or not. Regards waiting for ur input.

 Ted February 17, 2007 15:02

Re: UDF for a horizontal temperature profile

I was using the y-coordinate of a horizontal walll instead of the x-coordinate, so logically the result of my profile function was a constant. With your correction the UDF is now working just as I hoped. Thanks again!

Greetings Ted

 str6073 July 20, 2013 10:51

hi guys

i need a udf for a work. i'll explain what i need . I want to provide a linear varying temperature boundary condition on the circular side of a cylinder . can you help me?? My idea about udf is very small.

tempereture udf for wall BC

I am trying to write UDF for wall of vertical pipe temperature that increase with increasing depth (Z). UDF is as follow

#include "udf.h"
{
face_t f;
real x[ND_ND];
/*loop over each of the face of this zone*/
{
}
}

but fluent gets some error as below:

..\..\src\tempgrad.c(10) : error C2223: left of '->storage' must point to struct/union
..\..\src\tempgrad.c(10) : error C2065: 'NV' : undeclared identifier
..\..\src\tempgrad.c(10) : error C2065: 'F' : undeclared identifier
..\..\src\tempgrad.c(10) : error C2065: 'z' : undeclared identifier
..\..\src\tempgrad.c(10) : error C2109: subscript requires array or pointer type
..\..\src\tempgrad.c(11) : error C2143: syntax error : missing ';' before '}'

could any one can help me what is the problem?????

 Zaktatir December 15, 2013 17:07

 mmunige August 5, 2016 20:13

UDF for temperature variation with time and space

Respected members

I have to write a UDF for temperature variation along with time and flow domain. actually temperature is varying with time at four points in flow domain, (different relation for time and temperature at these points.
for example at x=0.20m i have following code:

{
face_t f;
{

real t = RP_Get_Real("flow-time");
if ( t <= 100.0 )

{

}
else if (100.0 < t && t <= 180.0 )
{
F_PROFILE(f,thread,position) = -8.34641*pow(10,-6)*pow(t,4.0)+ 5.49800*pow(10,-3)*pow(t,3.0)- 1.35243*pow(t,2.0)+ 1.47648*pow(10,2.0)*t - 5.51650*pow(10,3.0);
}
else

{
}
}

}
at x=0.40m (second point) i have following relations:

if ( t <= 100.0 )

{
}
else if (100.0 < t && t <= 180.0 )
{
}
else
{