CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Paraview & paraFoam (https://www.cfd-online.com/Forums/openfoam-paraview/)
-   -   Multiphase 3D free wave surface post-processing visualization in paraview (https://www.cfd-online.com/Forums/openfoam-paraview/106846-multiphase-3d-free-wave-surface-post-processing-visualization-paraview.html)

keepfit September 10, 2012 18:14

Multiphase 3D free wave surface post-processing visualization in paraview
 
Hi OpenFoamers,

I made a simple 3D multiphase case to test different ways of generating mesh (snappyHexMesh, blockMesh, Gmsh, etc). So far I am satisfied with the paraView, but I am still confused about how to visualize the free wave surface in 3D.

1. Free wave surface
3D damBreak case
http://24.media.tumblr.com/tumblr_ma...saho2_1280.png
Cull surface view

http://25.media.tumblr.com/tumblr_ma...saho1_1280.png
Transparent view

We can see from the above figures, the water wave surface (aplha1 in this case) is basically in 2D, so I was wondering how do I make it in 3D like this:

http://25.media.tumblr.com/tumblr_ma...saho3_1280.png

2. Velocity field

Since there are 2 phases (air & water), and the air velocity is much faster than the water velocity, so we can only see the result on top.

http://25.media.tumblr.com/tumblr_ma...o6_r1_1280.png

Is it possible to realize that only the water velocity field (vector or contour) visible? Because the velocity filed of water is of interest.

Regards,

David.

SirWombat September 11, 2012 05:59

easily done!

1. Make sure your have the "internalMesh" loaded from the "Mesh Parts"
2. Also select "alpha1" to load from the "Volume Fields"

Now use the "Threshold"-Filter with "alpha1".

Use 0.5 for the "Lower Threshold" and 1.5 for the "Upper Threshold"

(Although alpha should be in the range of 0 - 1 sometimes there are larger numbers than 1.)

You should get a resulting surface that you can even make semi transparent with the "opacity"-setting under the display-tab. And of course you can set it to show the velocity.

Greetings,
Jan

keepfit September 11, 2012 06:30

Quote:

Originally Posted by SirWombat (Post 381194)
easily done!

1. Make sure your have the "internalMesh" loaded from the "Mesh Parts"
2. Also select "alpha1" to load from the "Volume Fields"

Now use the "Threshold"-Filter with "alpha1".

Use 0.5 for the "Lower Threshold" and 1.5 for the "Upper Threshold"

(Although alpha should be in the range of 0 - 1 sometimes there are larger numbers than 1.)

You should get a resulting surface that you can even make semi transparent with the "opacity"-setting under the display-tab. And of course you can set it to show the velocity.

Greetings,
Jan

thanks for your tips, Jan.

It seems that the "surface" is only an assemble of "blocks/cells", there is no interpolation between these blocks, how do you figure this out?

http://25.media.tumblr.com/tumblr_ma...o7_r1_1280.png

SirWombat September 11, 2012 06:50

if you are only interested in the actual interpolated surface, then use the "contour" filter and set the value to 0.5

G Jan

keepfit September 11, 2012 07:49

Quote:

Originally Posted by SirWombat (Post 381204)
if you are only interested in the actual interpolated surface, then use the "contour" filter and set the value to 0.5

G Jan

i tried it, and it looks better. However....

http://24.media.tumblr.com/tumblr_ma...o8_r1_1280.png

there is still no smooth face :(.

Thank you so much anyway.

MartinB September 11, 2012 09:03

Hi David,

you can apply the "Filters->Alphabetical->smooth" filter with 200 iterations on the contour filter to improve the visualization.

Martin

keepfit September 11, 2012 11:55

Quote:

Originally Posted by MartinB (Post 381224)
Hi David,

you can apply the "Filters->Alphabetical->smooth" filter with 200 iterations on the contour filter to improve the visualization.

Martin

thanks Martin, it works like charm. The surface looks much better than before.

There is still an annoying problem, with regard to the " Smooth - number of iterations". As it increasing the surface becomes smoother, but when the number reaches up to around 500-1000, the surface does not get smoother, e.g. n=500, n = 1000 and n = 5000, you can not see big difference between them.

At n = 1000, we can still notice the obvious edges on the surface.

http://25.media.tumblr.com/tumblr_ma...o9_r1_1280.png

I looked up the para view manual, but unfortunately there is no such example about visualization such 3D surface. I wonder how you guys make this job done perfectly.

Regards,

David

MartinB September 11, 2012 12:07

You can try to "subdivide" (Filters->Alphabetical->Subdivide) the smoothed interface and smooth the result again.

Or you can switch to an hexahedral mesh (with blockMesh) and with more elements.

Martin

kwardle September 11, 2012 12:59

You have used the contour filter, which shows only the iso-surface for alpha=0.5, but you could also use the 'clip' filter instead and clip by the scalar alpha. This would show the full 'liquid' region. Again, you will still have the problem of interpolation on the surface and smoothing as you have done if you require it. If the surface is choppy, that just means your mesh should probably be refined for the simulation, no? Post-processing the surface to make it appear smoother is OK if you are just making a pretty picture, but...

Anyway, just wanted to suggest this as another option which may be useful since you would then from the clip have the liquid volume and could then use transparency (set opacity to less than 1) and make it look more like your example. Here is an example of my own with multiple clips (no post-smoothing) and opacity:
http://www.mcs.anl.gov/~wardle/mixzone-3p-preview.jpg
-Kent

keepfit September 12, 2012 08:48

thanks, kent.

It really helped. When the mesh is refined, the results look fantastic.


-Daivd

niallosully November 23, 2012 14:21

Hi David,

I am working on trying to implement an airflow over ocean waves which i have completed, i was wondering how you applied the airflow over the 3d dam break water surface.

Thanks Niall

sharonyue December 21, 2012 07:10

Quote:

Originally Posted by kwardle (Post 381260)
You have used the contour filter, which shows only the iso-surface for alpha=0.5, but you could also use the 'clip' filter instead and clip by the scalar alpha. This would show the full 'liquid' region. Again, you will still have the problem of interpolation on the surface and smoothing as you have done if you require it. If the surface is choppy, that just means your mesh should probably be refined for the simulation, no? Post-processing the surface to make it appear smoother is OK if you are just making a pretty picture, but...

Anyway, just wanted to suggest this as another option which may be useful since you would then from the clip have the liquid volume and could then use transparency (set opacity to less than 1) and make it look more like your example. Here is an example of my own with multiple clips (no post-smoothing) and opacity:
http://www.mcs.anl.gov/~wardle/mixzone-3p-preview.jpg
-Kent

Kent

Did you use MRFInterFoam simulating this? How many cells in your mesh?

kwardle December 21, 2012 10:46

This was done using multiphaseInterFoam, version 1.5.x. The mesh had ~2.5M poly cells (made in ccm+). More on this and related simulations in:

K. E. Wardle. "Open-Source CFD Simulations of Liquid–Liquid Flow in the Annular Centrifugal Contactor," Sep. Sci. Technol. 46, 2409-2417 (2011). (doi:10.1080/01496395.2011.600748)

sharonyue December 22, 2012 00:58

Quote:

Originally Posted by kwardle (Post 398573)
This was done using multiphaseInterFoam, version 1.5.x. The mesh had ~2.5M poly cells (made in ccm+). More on this and related simulations in:

K. E. Wardle. "Open-Source CFD Simulations of Liquid–Liquid Flow in the Annular Centrifugal Contactor," Sep. Sci. Technol. 46, 2409-2417 (2011). (doi:10.1080/01496395.2011.600748)

thank you Kent, Thats a splendid post-processing job u have done. I am do the simulation using MRFInterFoam or twophaseeulerfoam, but I have big problems in MRFzones.

I generated mesh via ICEM, but I can only make the solver working without exploding by the same mesh in ratate zone and stationary zone. for example: I generate block in the entire zone and name it seperately rotatezone the stationaryzone. then set the innerface as interior or interface. then run it by MRFInterfoanm it works. or just generate tow bodies called rotate and stationary. then compute mesh in unstructured mesh. It works too but a smaller time step.

but problems arise when I am using hybird meshs. such as unstructured mesh in rotatezone and structured mesh in stationaryzone. There is always an innerface which can not be deleted. but this innerface should not emerge in the boundary dictionary.you can see it here http://www.cfd-online.com/Forums/ope...tml#post396032.

but CFX or Fluent can handle this easily in their pre-process.while its tough in OpenFOAM.

do you know how to handle this? by the way, you have so many cells, how small is your time step? and which program are you use to generate mesh?

liguifan March 23, 2013 12:57

1 Attachment(s)
Hi Kent,

Your work is quite good! Clip of scalar is a good guide for me.

Just wondering if I am working on a case with two different phase, say , oil and water (oil droplet into water), do you think is there any way to visualize the simulation results? My case is like below, where I use contour to see the results.

Quote:

Originally Posted by kwardle (Post 381260)
You have used the contour filter, which shows only the iso-surface for alpha=0.5, but you could also use the 'clip' filter instead and clip by the scalar alpha. This would show the full 'liquid' region. Again, you will still have the problem of interpolation on the surface and smoothing as you have done if you require it. If the surface is choppy, that just means your mesh should probably be refined for the simulation, no? Post-processing the surface to make it appear smoother is OK if you are just making a pretty picture, but...

Anyway, just wanted to suggest this as another option which may be useful since you would then from the clip have the liquid volume and could then use transparency (set opacity to less than 1) and make it look more like your example. Here is an example of my own with multiple clips (no post-smoothing) and opacity:
http://www.mcs.anl.gov/~wardle/mixzone-3p-preview.jpg
-Kent


kwardle March 25, 2013 10:40

THANKS!
Have you tried using a scalar clip as I mentioned? This should work fine for your case assuming you are using an interFoam based solver and expect the phase interface to remain sharp. The image you have posted uses a contour so it only shows the single iso-surface for the given value. If you instead use a clip on the scalar you will get everything up to that value. I am not quite sure what you have shown in your image. You say oil droplet in water, but unless it is upside down or gravity is up, it looks like maybe you have instead a descending water drop in oil and a bulk water phase at the bottom that is not shown by the contour.

liguifan March 25, 2013 22:22

4 Attachment(s)
Hello Kent,

Thanks very much for the help and you really gave me a good way to start with.

you are correct, the base is oil and the droplet is made of water.

For the clip scalar, I am not sure what should I choose( alphas, alpha oil or alpha water?) to render and what value should I put ( I tried alphoil with value of 0.5 as in photes). Can you please explain how this value matters?

if I use contour the result would be like the first photo I use three value 1.0 1.1 1.2 to make sure you can see the surface of the oil.

The rest is to use the clip to scalar option

BUT, only I can see the water-in red color when it falls into the oil, how can I see the effect like the one plotted by the contour but with different color?

for Water-Base case

I use the same method, but this time I can only see the water base but without and different colored oil on surface of the water.

Wondering I chosen the wrong value for clip scalars, however, before knowing the mechanism, I am not sure what is right to choose.....


Btw, the solver what I used is multiphaseEulerFoam

Best regards,




Quote:

Originally Posted by kwardle (Post 416254)
THANKS!
Have you tried using a scalar clip as I mentioned? This should work fine for your case assuming you are using an interFoam based solver and expect the phase interface to remain sharp. The image you have posted uses a contour so it only shows the single iso-surface for the given value. If you instead use a clip on the scalar you will get everything up to that value. I am not quite sure what you have shown in your image. You say oil droplet in water, but unless it is upside down or gravity is up, it looks like maybe you have instead a descending water drop in oil and a bulk water phase at the bottom that is not shown by the contour.


kwardle March 28, 2013 16:26

Well, it sort of depends on what you are actually trying to simulate which is still not super clear to me. If you have just the two phases (oil, water) AND you are using interfaceCompression between them (this can be switched off in multiphaseEulerFoam) then you could use a clip on the scalar alphawater (0.5 is fine) and then color as a solid color. For example, in your second image you have clipped by alphaoil but then colored by alphawater which isn't so useful if the interface is staying sharp. On the other hand, if you are mixing the two fluids Euler-Euler style (i.e. you have set the interfaceCompression coefficient for the (water oil) pair in constant/transportProperties to be 0) then you would want to color by the dispersed phase fraction. For example, here is an image from a recent paper (see this thread for links) in which I am simulating three phases (air, water, oil) but maintaining a sharp interface for air-water and air-oil only.
http://www.mcs.anl.gov/~wardle/three...lerFoam_sm.jpg
In this case, I have clipped by alphaair (I think I used a small value of 0.1 to capture more of the liquid near the spinning inner cylinder) and then colored the result by alphaoil. This is a full 360-degree model and so I also clipped in the vertical direction to show the cross-section.
If what you are doing is simulating a droplet of water, initially suspended in oil, falling down into a water layer and impacting the oil-water interface then you should be able to get what you want by clipping by alphaoil=0.5 which will clip off everything that is on the oil side of the interface(s) and then color the remaining parts, which are now just water only as a solid color.
-Kent

liguifan March 30, 2013 19:16

5 Attachment(s)
Hi Kent,

I appreciated your very detailed explanation.

To be more clear, what I am simulating is a droplet of oil about 0.6cm height with radius of 0.2cm, which is on top of pure water of 0.3cm height with 12 cm in radius.
I am trying to view the results like the image you showed by clipping the alphaair with value of 0.1 and colored by alphaoil, however, it seems to be not working.


As you can see. at t=0
Attachment 20283
water+air+oil rendered
Attachment 20284
Only water base rendered
Attachment 20285
By using clip by alphaair=0.1, setting opacity =0.1

I use the Euler-Euler between water and oil setup as follow.
Quote:

interfaceCompression
(
(air water) 1
(air oil) 1
(water oil) 0
);
Then I tried to just render alphaoil with value 0.5, after a few steps, the droplet became smaller and it finally disappeared.

Attachment 20286

Attachment 20287


Quote:

Originally Posted by kwardle (Post 417073)
Well, it sort of depends on what you are actually trying to simulate which is still not super clear to me. If you have just the two phases (oil, water) AND you are using interfaceCompression between them (this can be switched off in multiphaseEulerFoam) then you could use a clip on the scalar alphawater (0.5 is fine) and then color as a solid color. For example, in your second image you have clipped by alphaoil but then colored by alphawater which isn't so useful if the interface is staying sharp. On the other hand, if you are mixing the two fluids Euler-Euler style (i.e. you have set the interfaceCompression coefficient for the (water oil) pair in constant/transportProperties to be 0) then you would want to color by the dispersed phase fraction. For example, here is an image from a recent paper (see this thread for links) in which I am simulating three phases (air, water, oil) but maintaining a sharp interface for air-water and air-oil only.
http://www.mcs.anl.gov/~wardle/three...lerFoam_sm.jpg
In this case, I have clipped by alphaair (I think I used a small value of 0.1 to capture more of the liquid near the spinning inner cylinder) and then colored the result by alphaoil. This is a full 360-degree model and so I also clipped in the vertical direction to show the cross-section.
If what you are doing is simulating a droplet of water, initially suspended in oil, falling down into a water layer and impacting the oil-water interface then you should be able to get what you want by clipping by alphaoil=0.5 which will clip off everything that is on the oil side of the interface(s) and then color the remaining parts, which are now just water only as a solid color.
-Kent


liguifan March 30, 2013 19:34

3 Attachment(s)
continued..
Attachment 20288

Attachment 20289

Attachment 20290

Apologize for the long post. but there are two things I am not clear are:

In your paper, I saw your did use contactAngle setup. To be more realistic, I also would like to include them as well. Like in alphas file.
Quote:

sideWall
{
type alphaContactAngle;
thetaProperties
(
( water air ) 90 0 0 0
( oil air ) 90 0 0 0
( water oil ) 90 0 0 0
);
value uniform 1;
}
Where did you find the suitable angle for, say, (water air) x x x x?


and in sigmas section,
if I want to put surface tension of water is 0.07N/m, oil is 0.045N/m.
Is this the correct way to define it?
Quote:

sigmas
(
(air water) 0.075
(air oil) 0.04
(water oil) 0.075/0.04=1.875
);
Best regards,


All times are GMT -4. The time now is 15:39.