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/)
-   -   TIG welding heat source UDF (https://www.cfd-online.com/Forums/fluent-udf/149483-tig-welding-heat-source-udf.html)

kcgmech March 5, 2015 06:30

TIG welding heat source UDF
 
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.

`e` March 5, 2015 21:19

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.

kcgmech March 6, 2015 00:00

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)
}

`e` March 6, 2015 16:57

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 March 7, 2015 02:13

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 ?

`e` March 7, 2015 05:36

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).

kcgmech March 7, 2015 07:26

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.

`e` March 8, 2015 01:16

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)
}


kcgmech March 25, 2015 07:11

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.

pakk March 25, 2015 11:39

Quote:

Originally Posted by kcgmech (Post 538125)
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 ?

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.

kcgmech March 27, 2015 03:29

Quote:

Originally Posted by pakk (Post 538179)
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)
}

pakk March 27, 2015 03:38

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.

piyupant February 29, 2016 02:16

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

canhoto February 25, 2019 08:34

Help getting started.
 
Quote:

Originally Posted by kcgmech (Post 534517)
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.

Hi! A student of mine is trying to simulate the same problem. Did you make it work? Can you send us your case for us to use as a base? Your work will be properly cited of course. Thanks.


All times are GMT -4. The time now is 07:19.