# TIG welding heat source UDF

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

 March 5, 2015, 07:30 TIG welding heat source UDF #1 New Member   Ganesh K C Join Date: Oct 2014 Location: Tiruchirappalli, India Posts: 29 Rep Power: 4 Dear Fluent Experts, I am trying to solve TIG welding heat transfer and fluid flow model. how i can make a moving heat source UDF in Fluent. As i have understood that it can be given as Heat Flux boundary condition. how to make UDF for that? if possible kindly show me some sample UDF of moving Gaussian circular heat source on a flat plate. thank you. ARJUN A ASOK likes this.

 March 5, 2015, 22:19 #2 Senior Member   Join Date: Mar 2015 Posts: 800 Rep Power: 11 In what way is the heat source moving, spatially or temporally? If the heat source changes with time (transient) then see this example by macfly and add in your moving Gaussian circular heat source equation.

 March 6, 2015, 01:00 #3 New Member   Ganesh K C Join Date: Oct 2014 Location: Tiruchirappalli, India Posts: 29 Rep Power: 4 hai 'e' thanks for your prompt reply. i try to model TIG welding of 300mm x 250mm x 10 mm size austenitic steel plate. weld length is 300mm. i try to bring the molten pool to center of plate and taking results. i.e 150mm from welding starting location. in model, the heat source is applied at 0s at (x,y,z) = (0,0,10). heat source is applied as heat flux boundary on the top surface of plate. i consider gaussian heat source equation for the power distribution. so heat source moves 0 - 150 mm length with 1mm/s speed. applying this moving heat source can be performed using DEFINE_PROFILE. i have seen a tutorial in udf manual for applying parabolic boundary example but i need to use the udf for TRANSIENT condition. so can anybody show some example ? based on some references i prepared this, kindly check this. /* ----- Gaussian Heat Source Profile ------ */ #include "udf.h" DEFINE_PROFILE (gaussian_heat_flux, thread, position) { face_t f; float Q, r, x[ND_ND], c[ND_ND], vel; real current_time, dt; current_time = RP_Get_Real("flow-time"); dt = RP_Get_Real ("physical-time-step"); vel = 1e-3; c[0] = 0; c[1] = 0; c[2] = vel * current_time; begin_f_loop(f, thread) { F_CENTROID (x, f, thread); Q = 14*300*0.9; r = 0.0065; F_PROFILE(f, thread, position) = (3*Q*r)/(2*3.14*(pow(r,3))); } end_f_loop(f, thread) } Last edited by kcgmech; March 6, 2015 at 07:09. Reason: example code included

 March 6, 2015, 17:57 #4 Senior Member   Join Date: Mar 2015 Posts: 800 Rep Power: 11 Firstly, be careful with using C data types. As a general rule of thumb, use real data types because this allows Fluent to select either floats or doubles, depending on if single or double precision is enabled. Always include a trailing period after integer values to avoid unexpected evaluations. What exact equation are you trying to evaluate for F_PROFILE? It currently appears uniform across the surface. This expression should be a function of x (and y if 2D); where x is moved through time (using c[2] in your script). kcgmech likes this.

 March 7, 2015, 03:13 #5 New Member   Ganesh K C Join Date: Oct 2014 Location: Tiruchirappalli, India Posts: 29 Rep Power: 4 a rectangular block model (x = 0.125m, y=0.01m, z=0.3m) i need to use in which the z-axes is the welding path. i need to apply moving heat source from the start point to end as strain line path. in the previous code the equation is wrong. the equation i want to apply is F_PROFILE (f, thread, position) = (3*Q / pi * r^2) * exp (-3) where, Q = 300*14; r = 0.00675 m could you please make a UDF using this ?

 March 7, 2015, 06:36 #6 Senior Member   Join Date: Mar 2015 Posts: 800 Rep Power: 11 The equation you have stated is not a function of position or time; both Q and r are constants. The same heat source would be applied to the entire surface. Is the heat a point/line source or restricted to a small region (either uniformly or smoothly dissipated)? I'm not familiar with TIG welding simulations which was why I asked about what equation you're using (with some context).

 March 7, 2015, 08:26 #7 New Member   Ganesh K C Join Date: Oct 2014 Location: Tiruchirappalli, India Posts: 29 Rep Power: 4 q (r) = (3Q/pi rh) * exp (-3r^2 / rh^2) surface heat intensity q, varies with radius r. this is the Gaussian equation. for this process Max peak intensity is constant and radius is also constant but this constant intensity source is moving along the z-axis. i want to apply this equation on a line (z-axis). it starts at one end and moving with the speed of 1mm/s. UDF for this transient heat source need to be prepared.

 March 8, 2015, 02:16 #8 Senior Member   Join Date: Mar 2015 Posts: 800 Rep Power: 11 What is h? Your equation still doesn't appear to be a function of distance from the heat source. Regardless, let us assume the equation you're working with is of the form: Q(d) = A*exp(-B*d) where A and B are constants and d is the distance from the welding heat source. Also, assume the origin is located at the starting end of the plate. Here is a code segment of the key steps: Code: ```zTIG = vel * current_time; begin_f_loop(f, thread) { F_CENTROID (x, f, thread); d = sqrt( (x[2]-zTIG)*(x[2]-zTIG) + x[1]*x[1] ); // d^2 = z^2 + y^2 F_PROFILE(f, thread, position) = A*exp(-B*d); } end_f_loop(f, thread) }```

 March 25, 2015, 08:11 #9 New Member   Ganesh K C Join Date: Oct 2014 Location: Tiruchirappalli, India Posts: 29 Rep Power: 4 as you have suggested i have changed F_PROFILE(f, thread, position) = (3*Q*r)/(2*3.14*(pow(r,3))) * exp (-3 * (c[2]*c[2] + c[1]*c[1] ) / pow (r,2)) but the temperature distribution is not as i expected. is there any other way to troubleshoot this problem ? also how to add Lorentz force in fluent without MHD module.

March 25, 2015, 12:39
#10
Senior Member

Join Date: Nov 2013
Posts: 1,066
Rep Power: 14
Quote:
 Originally Posted by kcgmech as you have suggested i have changed F_PROFILE(f, thread, position) = (3*Q*r)/(2*3.14*(pow(r,3))) * exp (-3 * (c[2]*c[2] + c[1]*c[1] ) / pow (r,2)) but the temperature distribution is not as i expected. is there any other way to troubleshoot this problem ?

How can we advise you? We don't know what you were expecting, and we don't know which result you got.

March 27, 2015, 04:29
#11
New Member

Ganesh K C
Join Date: Oct 2014
Location: Tiruchirappalli, India
Posts: 29
Rep Power: 4
Quote:
 Originally Posted by pakk Change your expectation. How can we advise you? We don't know what you were expecting, and we don't know which result you got.
Dear Sir,
i try to simulate tig welding in fluent. in that i need to apply a moving heat flux on top surface of a rectangular steel plate. i have made a udf for the moving heat source as follows but it is not working. can you check the following udf whether it is correct ? how can i make a udf to apply a moving heat source on a butt joint model?

#include "udf.h"
DEFINE_PROFILE(gaussian_profile,t,i)
{
real x[ND_ND], c[ND_ND];
face_t f;
real current_time, dt;
real vel;
real r;
current_time = CURRENT_TIME; //sec
dt = CURRENT_TIMESTEP;
vel = 1e-3; //m per sec
r = 0.006;
c[0] = 0;
c[1] = 0;
c[2] = vel*current_time; //c = center of the weld position vector
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
F_PROFILE(f,t,i) = (3*3200 / (3.14*pow(r,2))) * exp (-3*((c[0]*c[0]) + (c[1]*c[1])) / pow(r,2));
}
end_f_loop(f,t)
}

 March 27, 2015, 04:38 #12 Senior Member   Join Date: Nov 2013 Posts: 1,066 Rep Power: 14 What you now have, seems to be a valid UDF. Your problem is that you implement the wrong function. `e` has told you already a few times that your function is not dependent on time or space. It still is not. Your main equation is: Code: `F_PROFILE(f,t,i) = (3*3200 / (3.14*pow(r,2))) * exp (-3*((c[0]*c[0]) + (c[1]*c[1])) / pow(r,2));` Because I know that c[0]=0, that c[1]=0 is and that r=0.006, I can simplify this to: Code: `F_PROFILE(f,t,i) = (3*3200 / (3.14*pow(0.006,2))) * exp (-3*((0*0) + (0*0)) / pow(0.006,2));` which is the same as Code: `F_PROFILE(f,t,i) = 8.49e7;` So you are applying a uniform constant heat flux. You don't need a UDF for that. `e` has told you this already a few times. If you ask a question, and you get an answer, you should read the answer carefully.

 February 29, 2016, 03:16 #13 New Member   Piyush Join Date: Apr 2015 Location: Kolkata Posts: 10 Rep Power: 4 Ganesh I am experiencing the same problem. I need to define a gaussian heat profile moving in x direction. can you provide your udf. Thanks beforehand

 Tags gaussian heat source, welding

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post GGerber OpenFOAM Installation 54 April 24, 2015 16:02 kokizzu OpenFOAM Installation 4 May 26, 2014 09:17 zxj160 OpenFOAM 18 July 30, 2013 13:14 prince_pahariaa FLUENT 0 December 16, 2011 07:54 benson621 Fluent UDF and Scheme Programming 4 December 8, 2011 12:54

All times are GMT -4. The time now is 06:04.