CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Heat source UDF, please (http://www.cfd-online.com/Forums/fluent-udf/43175-heat-source-udf-please.html)

Sasha December 20, 2006 14:42

Heat source UDF, please
 
Hi, guys. I need to write an UDF for volumetric heat production in a 3D problem. The heat source strength is a say parabollic function of say Z coordinate, e.g. q_dot=2*z*z-5z+3 W/m^3. Please help me. Thank you.

Sujith December 21, 2006 06:01

Re: Heat source UDF, please
 
#include "udf.h"

DEFINE_SOURCE(heat_source,c,t,dS,eqn) { real x[ND_ND]; real source;

C_CENTROID(x,c,t);

source = 2*x[2]*x[2]-5*x[2]+3; dS[eqn] = 0.0;

return source; }

/*Z coordinate, e.g. q_dot=2*z*z-5z+3 W/m^3. Hook this UDF to appropriate panel for energy source. PS: I havent tested it for any error.*/

------- Sujith S Nair

Sasha December 21, 2006 15:27

Re: Heat source UDF, please
 
Thanks a lot.

leila2 May 5, 2012 01:11

hi,
I need to write an UDF for 2D heat source (on a face).The source has a parabolic function (source=x*x+2*x+1 ) Do I use C-CENTROID or C-FACE in my programm?
Please help me. Thank you.
DEFINE_SOURCE(energy_source,c,t,dS,eqn)
{
real x[ND_ND];
real source;
cell_t c;
begin_c_loop(c,t)
{
C_CENTROID(x,c,t);
source = x*x+2*x+1;
dS[eqn] = 2*x+2;
return source;
}
end_c_loop(c,t)
}

m zahid October 14, 2014 01:32

hi
 
hi
i am facing the similar problem. my UDF of source term is showing zero output. here is my Udf , if anybody know the problem please help me .

DEFINE_SOURCE(xmom,c,t,dS,eqn)
{
real x[ND_ND];
real source,ve;
C_CENTROID(x,c,t);
ve=sqrt((pow(C_U(c,t),2.0)+pow(C_V(c,t),2.0)+pow(C _W(c,t),2.0)));
source =-1.225*0.2*0.55* C_U(c,t)*ve;
C_UDMI(c,t,0)=source;
return source;
}


thanks


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