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 for modelling heat loss in 2D (https://www.cfd-online.com/Forums/fluent-udf/77268-udf-modelling-heat-loss-2d.html)

Shrinand June 18, 2010 01:54

UDF for modelling heat loss in 2D
 
HI. I need help on how to construct a UDF, which can account for heat loss in a 2D channel. Thus effectively it will model 3D results from the 2D.

More details-http://FastFreeFileHosting.com/file/40127/UDf-bmp.html

shri2802 February 29, 2016 05:47

heat loss through walls
 
#include "udf.h"
#include "math.h"
#include "sg.h"

DEFINE_PROFILE(HTCh, t, i)
{
face_t f;
Thread *tco;
cell_t co; /**thread data**/
real Tc=0; /**centraoid temperature of cells **/
real Ts2=0; /** secondary side temperature for Grashof no **/
real q=0; /** heat flux at face **/
begin_f_loop(f, t)
{
Ts = F_T(f,t);
co =F_C0(f,t);
tco=THREAD_T0(t);
Tc=C_T(co,tco);
BOUNDARY_FACE_GEOMETRY(f,t,A,ds,es,A_by_es,dr0);
area = sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]);
theta=area/A_by_es;

q=kl*abs(cos(theta))*(Tc-Ts)/ds;

Ts2=Ts-(log(d/di)*q*di/(2*ki)); //for cylinder
// Ts2=Ts- abs(dt*q/ki); // for rectangular slab

shri2802 February 29, 2016 05:50

This code will work better at solid meshed surface, but if u wish to use if fluid region you have to consider convective and transient energy terms too.
"Ts2" will give insulated body temperature, if u don't have insulation you can use directly "Ts" to calculate Gr number and using that u can relate with heat transfer coefficients.


All times are GMT -4. The time now is 23:21.