CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   [Help] identify the cell next to the liquid/vapor interface (https://www.cfd-online.com/Forums/fluent/224018-help-identify-cell-next-liquid-vapor-interface.html)

hmagielucky February 4, 2020 16:58

[Help] identify the cell next to the liquid/vapor interface
 
Dear all,

I would like to identify the cell next to the liquid/vapor interface using Fluent UDF code. I have looked through the manual, and it mentioned that i can use F_C0, However, I never get it right. Can anyone help me check my code? Which parts of the code i am making mistake? or the idea is wrong. thanks ahead.


So the thing I did to my code is that first I define a value to C_UDMI( c, ct, 4) to all cell of the domain


mp_thread_loop_c(ct,domain,pt)
{
begin_c_loop(c,ct)
{
C_UDMI(c,ct,4)=0;
}
end_c_loop (c,ct)
}

Then I go to subdomain which is a vapor domain. I tried to use F_C0 to find the interface ( which should be a boundary of the vapor phase)

sub_domain_loop(subdomain,domain, phase_domain_index)
{
if (DOMAIN_ID(subdomain) == 3)
thread_loop_c(cell_thread,subdomain)
{
begin_c_loop_all(c,cell_thread)
{

c0 = F_C0(f,f_thread);
t0 = F_C0_THREAD(f,f_thread);

}
end_c_loop_all(c,cell_thread)
C_UDMI(c,cell_thread,4)=0;
}
}

vinerm February 5, 2020 03:29

F_c0()
 
F_C0() is not what you understood it is. F_C0(f,t) returns the cell ID of the cell of which face f is primary face with the thread t. It has got nothing to do with the interface. You have to use C_VOF to identify the cell that contains the interface.

hmagielucky February 5, 2020 12:13

Dear Vinerm,

Your answer is so so so helpful. I have solved my problem.

thank you so much again.

----------------------------------------------------------------------
Regards,
Maggie


All times are GMT -4. The time now is 12:27.