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/)
-   -   Gauss plane heat source in the interface of two-phase flow (https://www.cfd-online.com/Forums/fluent-udf/237155-gauss-plane-heat-source-interface-two-phase-flow.html)

zx145833 July 2, 2021 21:01

Gauss plane heat source in the interface of two-phase flow
 
Hello,
Everyone, I have a trouble about the loading of plane heat source of welding arc in the interface of the two-phase flow (metal-air system). The partial UDF is listed as below. The delta function is introduced to transform the plane heat source to volume heat source. While it is noted that the forum needs the gradient of volume fraction of metal phase and I'm not sure the transformation is reasonable. In fact, the function is referenced from the level set method. When I test the result, the metal surface temperature doesn't increase and keeps room temperature. Anyone who can give me some suggestions and thanks a lot.

#define PI 3.14159
#define reff 0.00284 /*Arc effective radius*/
#define current 280. /*Welding current*/
#define voltage 29.5 /*Welding voltage*/
#define eta_arc 0.8 /* Arc heat efficiency*/

DEFINE_SOURCE(arc_source,c,t,dS,eqn)
{
real xc[ND_ND],x,y,z,time,Qarc,r,source,var1,delta,grad;
Thread *pri_th, *sec_th;
pri_th=THREAD_SUB_THREAD(t,0);
sec_th=THREAD_SUB_THREAD(t,1);
time=RP_Get_Real("flow-time");
C_CENTROID(xc, c, t);
x=xc[0]-xx2-v*time; /*xx2 is the initial position of arc in x
direction*/
y=xc[1];
z=xc[2];
r=sqrt(x*x+y*y);
Qarc=current*voltage;
grad=sqrt(C_UDMI(c,t,0)*C_UDMI(c,t,0)+C_UDMI(c,t,1 )*C_UDMI(c,t,1)+C_U
DMI(c,t,2)*C_UDMI(c,t,2)+0.00000001);
delta=6*C_VOF(c,sec_th)*(1-C_VOF(c,sec_th))*grad;
if(r<=reff&&C_VOF(c,sec_th)>0.&&C_VOF(c,sec_th)<1. )
{
source=eta_arc*Qarc/2./PI/(reff*reff)*exp(-r*r/(2.*reff*reff));
dS[eqn]=0;
}
else
{
source=0;
dS[eqn]=0;
}
return source*delta;
}

Cooper24 July 2, 2021 23:42

I am also working on a similar problem and had written about it in the forum yesterday. I have sent you a PM. Kindly revert back.

AlexanderZ July 7, 2021 01:32

compile your code first, read log files, fix errors


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