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

fnatic09 January 10, 2016 06:11

Distribution of temperature
 
Hello Guys, I've created a simple code which is used to show symmetrical temperature distribution on a disc. But it's only symmetrical in one axis direction. How to change a code to make a circular distribution in all directions not only in one axis ? Is it possible ? I've tried to enter a circle equation but it's not working..
Code:

#include "udf.h"                     
DEFINE_PROFILE(inlet_x_temperature, thread, position)           
{
real x[ND_ND]; /* this will hold the position vector */
real y;           
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);   
y = x[1];                         
if(y<=0)
{
F_PROFILE(f, thread, position) = 300-y;
}
else
{
F_PROFILE(f, thread, position) = 300+y;
}
}
end_f_loop(f, thread)
}

http://i65.tinypic.com/9la9u1.png

`e` January 10, 2016 20:27

You're currently setting the temperature profile as T(y) = |y| + 300 which agrees well with your result (independent of x).

For a radial temperature profile you must first calculate the radial component r = \sqrt{(x^2 + y^2)} (assuming the origin is at (x,y) = (0,0)) and then T(r) = r + 300.

An example code snippet:

Code:

F_PROFILE(f, thread, position) = sqrt(x[0]*x[0] + x[1]*x[1]) + 300.;

fnatic09 February 13, 2016 04:40

Everything's working fine but now I have a question how to change equation to get parabolic and circular (in all sides) temperature distribution. I attach an image to show what exactly I mean.
http://i66.tinypic.com/23wnwvp.jpg
Regards

pakk February 15, 2016 09:05

Look again at what `e` typed, but use a different equation for T.
For example: T(r)=300+r^2.

(Or, including units: T(r)=300 K+1 K m^{-2} \cdot r^2.)


All times are GMT -4. The time now is 22:29.