CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   UDF for modelling heat loss in 2D (

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-

shri2802 February 29, 2016 06:47

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

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);
area = sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]);


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

shri2802 February 29, 2016 06: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 15:40.