# Udf for moving heat flux in 2D cylindrical geometry

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

April 20, 2015, 00:27
Udf for moving heat flux in 2D cylindrical geometry
#1
New Member

devia
Join Date: Mar 2015
Posts: 2
Rep Power: 0
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
 square.jpg (29.8 KB, 7 views)