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

Volumetric Heat Source define

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 13, 2018, 23:18
Default Volumetric Heat Source define
  #1
New Member
 
NhanLe
Join Date: Jan 2016
Posts: 7
Rep Power: 10
NhanLe is on a distinguished road
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.
NhanLe is offline   Reply With Quote

Old   November 14, 2018, 23:56
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Use DEFINE_SOURCE macro instead of DEFINE_PROFILE

More information you may find in Ansys Fluent Customization manual

best regards
AlexanderZ 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 17:02
Problem compiling a custom Lagrangian library brbbhatti OpenFOAM Programming & Development 2 July 7, 2014 12:32
[swak4Foam] build problem swak4Foam OF 2.2.0 mcathela OpenFOAM Community Contributions 14 April 23, 2013 14:59
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 20:08
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 02:24


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