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

difference between using Define-Source and Define_Profile as a heat source

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By flotus1

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 28, 2013, 13:21
Default difference between using Define-Source and Define_Profile as a heat source
  #1
New Member
 
jafar
Join Date: Jun 2013
Posts: 2
Rep Power: 0
jghorbanian is on a distinguished road
Dear friends,

I am working on the Melting/solidification problem in which laser is used as a heat source. I am solving a 2d problem and the domain is a rectangular and the dimension of the domain is in micron scale. Due to the problem, I used two methods:
1- use heat flux and put it on the wall by Define_Profile; here is the UDF
#include "udf.h"

/* All dimensions are in SI units */
DEFINE_PROFILE(laser_beam,thread,index) /*Boundary condition for the flow of energy through the laser */

{
real x[ND_ND]; /* Position vector, ND reads whether 2D or 3D case */

real r; /* spatial coordinate */
real ht;
face_t f;
real omega=6e-6; /*width of the laser beam */
real I_0=1.8e+4; /*Intensity */
real end_t=14.0e-9; /* pulse duration */
real taw=7.0;
real tmax=7.0e-9;
real t=CURRENT_TIME;


begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread); /* reads coordinates from */

r=x[1];

ht=pow((t/tmax),taw)*exp(taw*(1-t/tmax));

if (t < end_t)

F_PROFILE(f,thread,index) = I_0*ht*exp(-r*r/(omega*omega))/(end_t);

else
F_PROFILE(f,thread,index) = 0.0;

}
end_f_loop(f,thread);
}

2- use heat source by Define_Source; here is the UDF
#include "udf.h"
#define ac 1.38e+8 /*absorption coefficient */
#define rc 0.79 /* reflectivity */
#define omega 6.0e-6 /*width of the laser beam */
#define I_0 1.8e+4 /*Intensity */
#define end_t 14.0e-9 /* pulse duration */
#define taw 7.0
#define tmax 7.0e-9

/* All dimensions are in SI units */

DEFINE_SOURCE(cell_x_source, cell, thread, dS, eqn)
{
real x[ND_ND]; /* Position vector, ND reads whether 2D or 3D case */

real r; /* spatial coordinate */
real z;
real ht;
real source;
real t=CURRENT_TIME;
/* real dt=CURRENT_TIMESTEP; */
C_CENTROID(x,cell, thread);

ht=pow((t/tmax),taw)*exp(taw*(1-t/tmax));
r=x[1];
z=x[0];

if (t < end_t)
{
source = (ac*(1-rc)*I_0*ht*exp(-r*r/(omega*omega))*exp(-ac*z))/end_t;
dS[eqn] = 0.0;
}
else
{
source = dS[eqn] = 0.;
}
return source;
}

I completely understand if you don't know about the details of equations (Source and F_PROFILE), but from the heat transfer point of view they mostly are the same which are qdot and q-double-prime respectively.

Now my problem is when I run two different cases (using source and profile ), the temperatures are way different. When I use the Source the maximum temperature is about 500 K and for the profile the temperature is around 4800 K. I should point out that other parameters , conditions and solution method and ... are the same.

Please help me if you have any idea, because I have been stuck more than 4 months at this point.

Last edited by jghorbanian; August 28, 2013 at 14:23.
jghorbanian is offline   Reply With Quote

Old   August 29, 2013, 12:34
Default
  #2
New Member
 
jafar
Join Date: Jun 2013
Posts: 2
Rep Power: 0
jghorbanian is on a distinguished road
My friends,

I realized that I didn't include reflectivity coefficient ,(1-rc), for the first case, q-double-prime. So the equation for the Profile will be:
F_PROFILE(f,thread,index) = (1-rc)*I_0*ht*exp(-r*r/(omega*omega))/(end_t);
After that, the pick temperature getting so closer to each other in both cases, but they are still different.
for the q-double prime (Profile) is around 1050 K and for the qdot (Source) is around 500 K.

Any idea?
jghorbanian is offline   Reply With Quote

Old   August 29, 2013, 14:08
Default
  #3
Super Moderator
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,427
Rep Power: 49
flotus1 has a spectacular aura aboutflotus1 has a spectacular aura about
I did something similar a about a year ago.
There is a difference between using a volumetric heat source and a heat flux at the boundary.

The volumetric heat source (unit W/m³) in fluent is applied to the whole cell. Thus the power of the heat source depends on the size of the cell.
The heat flux on the other hand does not depend on the cell size. Maybe this is where the mismatch between the two approaches arises.

To be more precise, the equation you use for the volumetric heat source is evaluated at the cell centroid.
I guess that the value at the centroid of the first cell is already very low, and consequently this very low value is applied to the cell as a heat source.
That would at least explain why the temperatures are lower for this approach.
jghorbanian likes this.
flotus1 is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On



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