# Modelling multiphase heat transfer coefficient in UDF with DEFINE_PROFILE

senthilathiban
Member

in Fluids

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

Tagged:

## Answers

Because the wall has only one temperature and that is the mixture level.

I am not using temperature field. I am using only velocity field.

What is the thread "ti" in your UDF? Where are you hooking the UDF?

Thread ti is the phase thread of primary phase in the multiphase simulation. I am hooking the UDF in the boundary conditions for wall as convection heat transfer coefficient.

Okay that will explain the issue: There is no phase velocity associated with wall boundary. You can however access the near wall cell velocity values of each phase.

I also tried with the adjacent cell thread and it produced the same error.

DEFINE_PROFILE(heat_gas_wall,t,i)

{

face_t f;

Message0("TEst 00000000000");

/*face thread*/

Thread *ti = THREAD_SUB_THREAD(t,0);

Thread *tj = THREAD_SUB_THREAD(t,1);

/*cell thread*/

Thread *tci = THREAD_T0(ti);

Thread *tcj = THREAD_T0(tj);

cell_t c = F_C0(f,ti);

Message0("TEst 0");

real v_x=0., v_y=0., v_z=0.;

real vel;

v_x = C_U(c,tcj) - C_U(c,tci);

v_y = C_V(c,tcj) - C_V(c,tci);

v_z = C_W(c,tcj) - C_W(c,tci);

vel = sqrt(v_x*v_x + v_y*v_y + v_z*v_z);

..

....

....

}

Yes because it is wrong: you are no doing any loops. Check the documentation to know how things are working.

The loops are below. I didn't post the full code. The full code is lengthy. I kept three dots in the bottom..!!

I cannot forecast what you are telling with your 3 dots.