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

Udf for moving heat flux in 2D cylindrical geometry

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 20, 2015, 00:27
Default Udf for moving heat flux in 2D cylindrical geometry
  #1
New Member
 
devia
Join Date: Mar 2015
Posts: 2
Rep Power: 0
devia21 is on a distinguished road
Hello every body,
Now, I trying to analysis a heat flux in a moving electron beam melting on the cylindrical top surface of material in 2D. But I have a problem to simulate a moving heat flux on different position of material (in position 0mm, 5mm,10mm,15mm and 20mm), can you give me any suggestion for my simulation?
The simple sketch of the geometry is in attached:

This is my udf, but I didn't get the true contour.
Quote:
#include "udf.h"
DEFINE_PROFILE(EB_flux,t,i)
{
real x[ND_ND];
face_t f;
real flux;
real r;
real the_current_time;
real ti=1;
real abs = 0.75; // absorption of co
real I = 10000.0; // EB power
real sigma = 0.005;
real emis = 0.37; //emissivity
real epsilon = 0.0000000567; //stefan-boltzmann
real Tinf = 298.0; // environment temp
real heff; // effective heat transfer coeff
real Le =6397000 ; //latent heat of evaporation
real M = 0.05893; // molar weight
real C = 8.314; // ideal gas constant
real P ; // saturated vapor pressure


begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
r = x[1];

heff = epsilon*emis*(F_T(f,t)*F_T(f,t)+Tinf*Tinf)*(F_T(f, t)+Tinf);
if ( ( F_T(f,t) >= 1363.0 && F_T(f,t) < 1522.0 ) )

P = 1.013*pow( 10.0, 5.0 )*pow( 10.0 , (-(22209.0/F_T(f,t))-0.000223*F_T(f,t)+7.9366) );

else if ( F_T(f,t) >= 1522.0 && F_T(f,t) < 3200.0 )

P = 0.0050019*pow( 1.0052706 , F_T(f,t) );

else if ( F_T(f,t) >= 3200.0 )

P = 1.013*pow(10.0 , 5.0);

the_current_time = CURRENT_TIME;

if ((the_current_time>=0) && (the_current_time<10))
{
if ( F_T(f,t) < 1363.0 )

flux = abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-r*r/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf);

else if ( F_T(f,t) >= 1363.0 && F_T(f,t) < 1522.0 )

flux = abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-r*r/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf)-Le*M*P/sqrt(2*3.14159*M*C*F_T(f,t));

else if ( F_T(f,t) >= 1522.0 && F_T(f,t) < 3200.0 )

flux = abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-r*r/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf)-Le*M*P/sqrt(2*3.14159*M*C*F_T(f,t));

else if ( F_T(f,t) >= 3200.0 )

flux = abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-r*r/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf)-Le*M*P/sqrt(2*3.14159*M*C*F_T(f,t));
}

else if ((the_current_time>=10.0) && (the_current_time<20.0))
{
if ( F_T(f,t) < 1363.0 )

flux = (abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-((r-0.005)*(r-0.005))/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf));

else if ( F_T(f,t) >= 1363.0 && F_T(f,t) < 1522.0 )

flux = (abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-((r-0.005)*(r-0.005))/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf)-Le*M*P/sqrt(2*3.14159*M*C*F_T(f,t)));

else if ( F_T(f,t) >= 1522.0 && F_T(f,t) < 3200.0 )

flux = (abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-((r-0.005)*(r-0.005))/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf)-Le*M*P/sqrt(2*3.14159*M*C*F_T(f,t)));

else if ( F_T(f,t) >= 3200.0 )

flux = (abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-((r-0.005)*(r-0.005))/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf)-Le*M*P/sqrt(2*3.14159*M*C*F_T(f,t)));
}

else if ((the_current_time>=20) && (the_current_time<30))
{
if ( F_T(f,t) < 1363.0 )

flux = (abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-((r-0.01)*(r-0.01))/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf));

else if ( F_T(f,t) >= 1363.0 && F_T(f,t) < 1522.0 )

flux = (abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-((r-0.01)*(r-0.01))/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf)-Le*M*P/sqrt(2*3.14159*M*C*F_T(f,t)));

else if ( F_T(f,t) >= 1522.0 && F_T(f,t) < 3200.0 )

flux = (abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-((r-0.01)*(r-0.01))/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf)-Le*M*P/sqrt(2*3.14159*M*C*F_T(f,t)));

else if ( F_T(f,t) >= 3200.0 )

flux = (abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-((r-0.01)*(r-0.01))/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf)-Le*M*P/sqrt(2*3.14159*M*C*F_T(f,t)));
}
else if ((the_current_time>=30) && (the_current_time<40))
{

if ( F_T(f,t) < 1363.0 )

flux = (abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-((r-0.015)*(r-0.015))/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf));

else if ( F_T(f,t) >= 1363.0 && F_T(f,t) < 1522.0 )

flux = (abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-((r-0.015)*(r-0.015))/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf)-Le*M*P/sqrt(2*3.14159*M*C*F_T(f,t)));

else if ( F_T(f,t) >= 1522.0 && F_T(f,t) < 3200.0 )

flux = (abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-((r-0.015)*(r-0.015))/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf)-Le*M*P/sqrt(2*3.14159*M*C*F_T(f,t)));

else if ( F_T(f,t) >= 3200.0 )

flux = (abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-((r-0.015)*(r-0.015))/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf)-Le*M*P/sqrt(2*3.14159*M*C*F_T(f,t)));
}
else if ((the_current_time>=40) && (the_current_time<50))
{
if ( F_T(f,t) < 1363.0 )

flux = (abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-((r-0.02)*(r-0.02))/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf));

else if ( F_T(f,t) >= 1363.0 && F_T(f,t) < 1522.0 )

flux = (abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-((r-0.02)*(r-0.02))/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf)-Le*M*P/sqrt(2*3.14159*M*C*F_T(f,t)));

else if ( F_T(f,t) >= 1522.0 && F_T(f,t) < 3200.0 )

flux = (abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-((r-0.02)*(r-0.02))/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf)-Le*M*P/sqrt(2*3.14159*M*C*F_T(f,t)));

else if ( F_T(f,t) >= 3200.0 )

flux = (abs*I*(1.0/(2.0*3.1415926*sigma*sigma))*ti*exp(-((r-0.02)*(r-0.02))/(2*sigma*sigma))-heff*(F_T(f,t)-Tinf)-Le*M*P/sqrt(2*3.14159*M*C*F_T(f,t)));
}


F_PROFILE(f,t,i)=flux;
}
end_f_loop(f,t)
}


DEFINE_INIT(initial,d)
{
cell_t c;
Thread *t;
/* loop over all cell threads in the domain */
thread_loop_c(t,d)
{
/* loop over all cells */
begin_c_loop_all(c,t)
{
C_T(c,t) = 300.0;
}
end_c_loop_all(c,t)
}
}
Attached Images
File Type: jpg square.jpg (29.8 KB, 7 views)
devia21 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
Define_profile UDF for Transient Heat flux boundary condition Amoljoshi Fluent UDF and Scheme Programming 2 June 20, 2018 21:55
Heat flux profile UDF B.Hamada Fluent UDF and Scheme Programming 11 July 18, 2014 21:39
chtMultiRegionFoam heat flux sailor79 OpenFOAM Running, Solving & CFD 0 September 27, 2013 08:08
Customize Heat Flux Distribution Using UDF Ken Adams FLUENT 0 May 25, 2007 15:25
UDF for heat flux Kyung Han FLUENT 0 June 9, 2005 00:58


All times are GMT -4. The time now is 05:49.