Modelling multiphase heat transfer coefficient in UDF with DEFINE_PROFILE

Hi,

I am doing a multiphase simulation ( Euler-Euler )with gas and solid.

I have two heat transfer coefficients. h(wall-gas) and h(wall-solid).

The simplified equations are

h(gas-wall) = 1.54*Re_g*k_g/D

and

h(solid-wall) = D/k_s + [2 * sqrt(k_s * rho_s * cp_s / pi)]^(-1)

First, I tried to code only the h(gas-wall) as follows.

#include "udf.h"
DEFINE_PROFILE(heat_test,t,i)
{
  face_t f;
Thread *ti = THREAD_SUB_THREAD(t,0);
real D = 1;
real beta = 90;
real v_x=0., v_y=0., v_z=0.;
real vel;
real De = 0.5*D*(2*M_PI-beta+sin(beta*M_PI/180))/(M_PI-beta/2-sin((beta*M_PI/180)/2));

begin_f_loop(f,t)
{
v_x = F_U(f,ti);
v_y = F_V(f,ti);
v_z = F_W(f,ti);
vel = sqrt(v_x*v_x + v_y*v_y + v_z*v_z);
real Re = vel;
F_PROFILE(f,t,i) = 1.54*Re/De;
}
end_f_loop(f,t)
}


The above code works when I use v_x = F_U(f,t) and produces a SIGSEGV error when I use F_U(f,ti).

Is this the correct way to code this type of UDF?


Looking forward to your response.


Thanks,

Senthil

Answers

Sign In or Register to comment.