Dear collegues,
I want to calculate for UDS source term formula like this:
is the scalar solved for the UDS transport equation. In Fluent units for source in UDS are
in this case is used as a unit for scalar
I assumed this equation could by written like that:
so I wrote a UDF (shown below) and I am not sure if I can use a gradient of UDSI like that. In Fluent in Solution Controls -> Equations I deselected equation for User Scalar 1, User Scalar 0 is selected.
This part is put in DEFINE_ADJUST
thread_loop_c (t,super_domain)
{
begin_c_loop_all (c, t)
{
t01 = THREAD_SUB_THREADS(t); /*this part is used only to show fluent proper phase */
t02 = t01[0];
t03 = t01[1];
C_UDSI(c,t03, 1) = C_VOF(c,t03);
/* C_UDSI(c,t03,0) is a phi for which I want to calculate source term */
C_UDMI(c,t03,1) = 5*C_R(c, t03)*C_UDSI(c,t03,0)*(C_U(c,t03)* C_UDSI_G(c,t03,1)[0]+C_V(c,t03)* C_UDSI_G(c,t03,1)[1]+C_W(c,t03)* C_UDSI_G(c,t03,1)[2])/3;
}
end_c_loop_all (c,t)
}
and then in DEFINE_SOURCE in return I put value of C_UDMI calculated in DEFINE_ADJUST.