CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

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

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 4, 2020, 17:58
Unhappy [Help] identify the cell next to the liquid/vapor interface
  #1
New Member
 
Maggie hsu
Join Date: Apr 2014
Posts: 2
Rep Power: 0
hmagielucky is on a distinguished road
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;
}
}
hmagielucky is offline   Reply With Quote

Old   February 5, 2020, 04:29
Default F_c0()
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
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.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   February 5, 2020, 13:13
Default
  #3
New Member
 
Maggie hsu
Join Date: Apr 2014
Posts: 2
Rep Power: 0
hmagielucky is on a distinguished road
Dear Vinerm,

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

thank you so much again.

----------------------------------------------------------------------
Regards,
Maggie
hmagielucky is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simulating fire in a tunnel luca1992 OpenFOAM 14 August 16, 2017 14:50
How to determine the direction of cell face vectors on processor patches sebastian_vogl OpenFOAM Programming & Development 1 October 11, 2016 14:17
interFoam running blowing up sandy13 OpenFOAM Running, Solving & CFD 2 May 5, 2015 08:16
[General] 2 datas on one plot Akuji ParaView 46 December 1, 2013 15:06
[snappyHexMesh] snappyhexmesh cell splitted ununiform..2D case sharonyue OpenFOAM Meshing & Mesh Conversion 1 April 23, 2013 00:34


All times are GMT -4. The time now is 04:07.