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*z5z+3 W/m^3. Please help me. Thank you.

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*z5z+3 W/m^3. Hook this UDF to appropriate panel for energy source. PS: I havent tested it for any error.*/  Sujith S Nair 
Re: Heat source UDF, please
Thanks a lot.

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 CCENTROID or CFACE 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) } 
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:28. 