CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Volumetric Heat Source define (https://www.cfd-online.com/Forums/fluent-udf/211238-volumetric-heat-source-define.html)

NhanLe November 13, 2018 22:18

Volumetric Heat Source define
 
Hi all, I am a newbie and dealing with simulating a laser irradiating a metal subtrate. When defining the heat source, I used the Gaussian distribution heat flux as defined by the UDF below (x,y plane)

#include "udf.h"
#define PI 3.1415926 //Pi, a constant
#define sigma_q 0.35 //Absorptivity
#define P 146.8 //Laser power
#define R 5.250e-3 //Radius of laser beam
#define v 3.000e-3 //Scanning velocity
DEFINE_PROFILE(heat_flux,thread,position) //The UDF profile will have the name “heat_flux”
{
face_t f; //Define face variable
double x[ND_ND],r,time,vol; //Define face centroid vector, distance, time, and exponential for laser
double tempp,conv,emiss; //Define temperature, convection and emission energy
time=RP_Get_Real("flow-time"); //Acquire time from FLUENT solver
begin_f_loop(f,thread) //Loop through all relevant boundary faces
{
tempp=F_T(f,thread); //Get the temperature of the face
F_CENTROID(x,f,thread); //Acquire the face centroid location
r=sqrt(pow((x[0]+R-v*time),2.0)+pow(x[1]-0.085725,2.0)); //Determine distance from beam center
conv=0.0*17.0*(tempp-299.4); //Calculate convective losses
emiss=0.0*5.67e-8*(pow(tempp,4.0)-pow(299.0,4.0)); //Calculate radiation losses
if (conv<0.0) {conv=0.0;} //Prevent convection if surface is colder than surroundings
if (emiss<0.0) {emiss=0.0;} //Prevent radiation if surface is colder than surroundings
//calculate the intensity with convective and radiation losses in the next two lines
vol=2.0*r*r/(R*R);
F_PROFILE(f,thread,position)=(2.0*P*sigma_q*exp(-vol)/(PI*R*R)-conv-emiss); //Set face flux
end_f_loop(f,thread)
}

However, I would like to construct a 3-D volumetric heat source by implementing the absorptivity profile along the thickness (Tabulated data). I have learnt that I should use the HEAT GENERATION RATE UDF, can anyone shed a light for me about the issue ? Thanks and have a good day.

AlexanderZ November 14, 2018 22:56

Use DEFINE_SOURCE macro instead of DEFINE_PROFILE

More information you may find in Ansys Fluent Customization manual

best regards


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