# How to know the number of cells at the interface in a 2 phase flow using VOF?

India Member Posts: 14

I am trying to model the Laser melting of a solid block using solidification/melting and VOF. The 2 phases are the inert gas and the solid metal block. I am using a UDF to apply the laser heat source and want to apply this heat source at the top surface of the metal block which will be the interface of the gas and the metal block. I have patched the volume fraction of metal block to be 1 for the given block dimension.

Now, as I understand FLUENT does not create a sharp interface between 2 phases and the volume fraction change takes place over a number of cells. So, I cannot exactly use 0.5 as volume fraction to apply the source terms. I am taking a range of volume fraction for the applying the source terms(0.05<C_VOF<1). Next I understand that I should also use the cell centre z coordinates to identify these cells which have a volume fraction in that range? So, how to know the number of cells at the interface?

Tagged:

• UKPosts: 11,714Forum Coordinator

I'd use 0.55 to 1.0 otherwise you risk losing heat in the wrong cells. The interface is usually found in 2-3 cells if you've got enough resolution and a converged solution. There is a way to flag cells to find their volume, but either that's in the manual or I can't answer it on the Forum.

• @Rob Thanks for your reply. The solution is converging but the results were not good due to this issue. I am thinking of going with 4 cells, 2 above and 2 below the boundary between the 2 phases. I didn't realise that I will be losing heat to the gas phase if I am considering low volume fraction for the metal in a cell.

• @Rob Earlier I did not give any criteria for z-coordinate of cell centre and applied the laser using just the volume fraction criteria. In that case, the laser was continuously applied throughout the depth of block as the recoil pressure created a depression and therefore, cells with volume fraction of metal less than 1 were available at z<0. And this process continues. But, I want the laser to be applied only at the interface, so I used z coordinates of 2 cells above and 2 cells below z = 0 as the limiting criteria for the application of laser. Can you please tell if this is the correct way?

As you can see in the previous image, the laser is continuously applied wherever it finds a metal volume volume fraction less than 1 and that should not happen.

• UKPosts: 11,714Forum Coordinator

If you find the interface region (either the VOF gradient or greater/less than approach) then you can also limit the source by position. Just be careful with the nested IF statements.

• @Rob Thanks for your suggestion.

• @Rob When I am applying the laser at the interface, I want it to be in the cells with volume fraction in certain range. Now, I give that range in the "IF" condition inside the DEFINE_SOURCE. Now, as I understand, DEFINE_SOURCE is automatically called at every iteration and loops over the cells. When the laser starts melting the surface, the volume fraction in the cells changes. So, do I need to update the volume fraction of the secondary phase at every iteration and then use it in the "IF" condition or FLUENT automatically does that? If not so, will I have to use DEFINE_ADJUST to store volume fraction of cells in UDMs?

• UKPosts: 11,714Forum Coordinator

If the system needs updating more than once in a time step you'll be changing things too quickly. Check the manual, I think most update at the start of the time step.

• @Rob Thanks for replying. It's fine whenever the update takes place. I just wanted to know that since I am using C_VOF inside the DEFINE_SOURCE and the source depends on C_VOF so when the volume fraction changes, will C_VOF be updated automatically? Or will I have to use a separate UDF to store the values of cell volume fraction and then use it inside DEFINE_SOURCE?

I try to go for manual first. But sometimes it doesn't help.

• As I read and understand, DEFINE_SOURCE is called after every iteration(or even if it is called after every time-step), my source is dependent on time and cell centroids. Now, my doubt is let us say DEFINE_SOURCE is called at first iteration and the source term is applied based on the C_VOF condition. In the next iteration, position of laser source has been updated. So, will the cell volume fraction also get updated automatically? As the laser heated the surface in the previous step/iteration, so the volume fraction of cells has changed.

• UKPosts: 11,714Forum Coordinator

You are correct that things change with time, but if the change is enough to throw your maths (ie free surface moves etc) then you're using too great a time step.

• @Rob Thanks for your inputs.