CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

Heat source UDF, please

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By Sujith

Reply
 
LinkBack Thread Tools Display Modes
Old   December 20, 2006, 14:42
Default Heat source UDF, please
  #1
Sasha
Guest
 
Posts: n/a
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.
  Reply With Quote

Old   December 21, 2006, 06:01
Default Re: Heat source UDF, please
  #2
Sujith
Guest
 
Posts: n/a
#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
samyak likes this.
  Reply With Quote

Old   December 21, 2006, 15:27
Default Re: Heat source UDF, please
  #3
Sasha
Guest
 
Posts: n/a
Thanks a lot.
  Reply With Quote

Old   May 5, 2012, 01:11
Default
  #4
New Member
 
juliana
Join Date: May 2012
Posts: 2
Rep Power: 0
leila2 is on a distinguished road
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)
}
leila2 is offline   Reply With Quote

Old   October 14, 2014, 01:32
Default hi
  #5
Member
 
Qureshi M Z I
Join Date: Sep 2013
Posts: 54
Rep Power: 3
m zahid is on a distinguished road
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
m zahid is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
swak4foam building problem GGerber OpenFOAM Installation 54 April 24, 2015 16:02
how to load the heat source to wall david yang Main CFD Forum 1 October 12, 2009 13:34
UDF: PROFILE + SOURCE Nuno FLUENT 0 September 1, 2008 15:31
how to define volme heat source in udf ? wanghong FLUENT 0 February 24, 2006 04:53
Please help me run UDF code for source Suga FLUENT 1 February 3, 2006 04:40


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