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

Marangoni shear stress in laser welding

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 12, 2022, 03:30
Default Marangoni shear stress in laser welding
  #1
New Member
 
Pourya
Join Date: Apr 2022
Posts: 1
Rep Power: 0
Pourya.heidari73 is on a distinguished road
DEAR all
I want to simulate the laser welding with the FLUENT. I just activate the solidification and melting (without VOF). I face a problem to import the Marangoni effect into my simulation. In the BOUNDARY CONDITION (MARANGONI STRESS), I found the formula for surface tension gradient variation base on the temperature. Since I could not import the surface tension gradient by UDF in the MARANGONI STRESS, I try to import this effect by UDF in the SPECIFIED SHEAR. I attach the formula for this part and shot screen of specified stress. To be honest, I do not know which Macro I should use to write this formula. I try DEFINE_PROPERTY and DEFINE_PROFILE. In my UDF, I consider the surface tension graidient as a constant. Everytime I run this code, Fluent would close. It is very painful. Please help me to find the error of this UDF.
Here you can find the UDF that I wrote for this part.
DEFINE_PROFILE(marangonix, t, i)
{
face_t f;
cell_t c;
Thread *tc;
real grad_temp, gama_temp;
begin_f_loop(f,t)
{
c=F_C0(f,t);
tc = THREAD_T0(t);
//tc=F_C0_THREAD(f,t);
grad_temp= C_T_G(c,tc)[0];
gama_temp=-0.00043;
F_PROFILE(f,t,i)=gama_temp*grad_temp;
}
end_f_loop(f,t)
}

DEFINE_PROFILE(marangoniy, t, i)
{
face_t f;
cell_t c;
Thread *tc;
real grad_temp, gama_temp;
begin_f_loop(f,t)
{
c=F_C0(f,t);
tc = THREAD_T0(t);
//tc=F_C0_THREAD(f,t);
grad_temp= C_T_G(c,tc)[1];
gama_temp=-0.00043;
F_PROFILE(f,t,i)=gama_temp*grad_temp;
}
end_f_loop(f,t)
}

DEFINE_PROFILE(marangoniz, t, i)
{
face_t f;
cell_t c;
Thread *tc;
real grad_temp, gama_temp;
begin_f_loop(f,t)
{
c=F_C0(f,t);
tc = THREAD_T0(t);
//tc=F_C0_THREAD(f,t);
grad_temp= C_T_G(c,tc)[2];
gama_temp=-0.00043;
F_PROFILE(f,t,i)=gama_temp*grad_temp;
}
end_f_loop(f,t)
}


I really appreciate, if you help me to solve this issue.
Attached Images
File Type: png Formula.PNG (34.0 KB, 15 views)
File Type: png specified.PNG (27.1 KB, 13 views)

Last edited by Pourya.heidari73; July 15, 2022 at 13:06.
Pourya.heidari73 is offline   Reply With Quote

Old   January 18, 2023, 11:30
Default
  #2
New Member
 
UK
Join Date: May 2019
Location: uk
Posts: 25
Rep Power: 6
redlemon44 is on a distinguished road
Probably best using FLOW-3D WELD for this (https://www.flow3d.com/products/flow3d-weld/) as all the physics are already there and no udfs are needed
redlemon44 is offline   Reply With Quote

Old   March 20, 2024, 23:34
Smile Resolved
  #3
New Member
 
ankit
Join Date: Oct 2015
Posts: 2
Rep Power: 0
ankit_tiwari is on a distinguished road
I have written the following code for a similar problem (following this thread). These gradients are though cell center temperature gradients and I am working on calculations of face center gradients. There is a trick to get this code work (see end of the post)


#include "udf.h"
#include "mem.h"
DEFINE_PROFILE(marangonix, t, i)
{
face_t f;
cell_t c;
Thread *tc;
real grad_temp[ND_ND],gama_tempx;
gama_tempx = -0.000199; /*surface tension gradient with temperature for Nb*/
begin_f_loop(f,t)
{
c = F_C0(f,t);
tc = THREAD_T0(t);
NV_V(grad_temp, =, C_T_G(c,tc));
if (F_T(f,t) > 2741)
{
F_PROFILE(f,t,i)=gama_tempx*grad_temp[0];
}
else
{
F_PROFILE(f,t,i)= 0;
}
}
end_f_loop(f,t)
}
DEFINE_PROFILE(marangoniy, t, i)
{
face_t f;
cell_t c;
Thread *tc;
real grad_temp[ND_ND], gama_tempy;
gama_tempy = -0.000199; /*surface tension gradient with temperature for Nb*/
begin_f_loop(f,t)
{
c=F_C0(f,t);
tc = THREAD_T0(t);
NV_V(grad_temp, =, C_T_G(c,tc));
if (F_T(f,t) > 2741)
{
F_PROFILE(f,t,i)=gama_tempy*grad_temp[1];
}
else
{
F_PROFILE(f,t,i)= 0;
}
}
end_f_loop(f,t)
}


To run this code:
  • Run Command "solve/set/expert/" in fluent console. And say "yes" for "Keep Solver Memory from being freed".
  • This will keep gradient values stored which will be called from UDF.
  • If we hook this UDF directly after initialization. Fluent will give error and exit as variable values are not there for calculation.
  • Run calculation for one tiny time step say 1E-6 seconds without hooking UDF. This will store values of gradients.
  • Stop the solution after one time step and now hook your UDF. This shall now work


ankit_tiwari 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
Shear Stress Calculation in the flow. auburnuser FLOW-3D 11 May 12, 2018 13:49
Cannot achieve negative wall shear stress values in CFD Post (ANSYS) SAtkins CFX 3 August 3, 2016 14:27
How is Marangoni shear stress calculated in FLUENT princekar FLUENT 0 May 21, 2015 08:06
shear stress scalar definitions? Novak Elliott CFX 0 April 6, 2003 01:45
What is the detail definition of wall shear stress zjm FLUENT 0 January 2, 2002 07:43


All times are GMT -4. The time now is 14:15.