In the first case (single phase case) liquid enters the tube and absorbs heat energy which is produced by the solid region. There is no phase change happening here. The following UDF is used to calculate the source term in single phase flow. The UDF works correctly.

#include "udf.h"

DEFINE_EXECUTE_AT_END(s_calculation)

{

Domain *d=Get_Domain(1);

int zone_id=6;

Thread *t = Lookup_Thread(d,zone_id);

cell_t c;

thread_loop_c(t,d)

{

begin_c_loop(c,t)

{

C_UDMI(c,t,0)=C_T(c,t)*0.25;

}

end_c_loop(c,t)

}

}

DEFINE_SOURCE(energy, c, t, dS, eqn)

{

real x[ND_ND];

real source;

source =1680000*C_UDMI(c,t,0);

dS[eqn] = 0;

return source;

}

In second case, liquid enters the tube and undergoes phase change due heat addition.

How to rewrite above UDF for this multiphase case.

More Manu Francis's questions See All
Similar questions and discussions