CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Other] Generating Mesh for a drop in another fluid

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By olivierG

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 23, 2015, 18:04
Arrow Generating Mesh for a drop in another fluid
  #1
Member
 
Join Date: Feb 2014
Posts: 34
Rep Power: 12
Prosper is on a distinguished road
Hi All,

I am trying to solve a problem of a drop interface deformation due to body force. The drop is immersed in another fluid so it's a 2 phase flow problem. I need to resolve the interface accurately so I want to use interDyMFoam to have a adaptive fine mesh around the drop interface.

But the problem now is that to generate the initial shape of the drop, I used 'sphereToCell' on an initially coarse and uniform mesh. The result is that the initial interface of the drop is not smooth enough. I don't want any 'corners' on the interface but it seems that I can't get away with it on a initially structured mesh.

I'm thinking about a way to get around it. I would like to have a smoother mesh on the interface so that no sharp corners would be there at time=0.

One way to do this is possibly generate the mesh by two blocks. One sphere(drop) block and the other is the domain outside. My question now is that for the domain outside the sphere, should I divide the domain manually? (I don't really want to do that!!) Are there easier ways to do that?

I search the web and it seems that 'interDyMFoam' cannot be used on tetrahedral meshes? Is that still true with the latest version of OpenFOAM? I believe tetrahedral meshes can capture the interface much better (without 90 degree corners at least).

I would appreciate any suggestion of how to solve my problem. Thank you all!

Best,
P

Last edited by Prosper; April 24, 2015 at 11:09.
Prosper is offline   Reply With Quote

Old   April 23, 2015, 18:11
Default
  #2
Member
 
Join Date: Feb 2014
Posts: 34
Rep Power: 12
Prosper is on a distinguished road
BTW, my problem is in 3D, so the drop is a 3D sphere.
Prosper is offline   Reply With Quote

Old   April 24, 2015, 11:09
Default
  #3
Member
 
Join Date: Feb 2014
Posts: 34
Rep Power: 12
Prosper is on a distinguished road
Any ideas?
Prosper is offline   Reply With Quote

Old   April 27, 2015, 07:24
Default
  #4
Senior Member
 
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 272
Rep Power: 18
olivierG is on a distinguished road
hello,

Adaotative meshing work fdon't work with tetrahedral cell, and tetrahedral cell will capture a bad interface anyway.
What you can try is:
1) from you initial mesh, use setFields to create your liquid sphere
2) run 1 iterate with interDyMFoam => this with refine mesh at interface, but you will see a not smooth interface.
3) call setField again (re initialise) => you interface should now be more smooth
4) run ...

regards,
olivier
frantov likes this.
olivierG is offline   Reply With Quote

Old   April 27, 2015, 18:31
Default How to initialize values for complex shapes in tetrahedral meshes in OpenFOAM
  #5
Member
 
Peter
Join Date: Feb 2015
Location: New York
Posts: 73
Rep Power: 11
opedrofunk is on a distinguished road
Hi Everyone,

In fact, it's quite easy to set values for arbitrarily shaped volumes in a tetrahedral mesh (or any type, for that matter) in OpenFOAM.

This is the procedure I use:

1) Generate a tet mesh which respects the internal (and external, of course) boundaries that you which to capture. For this example, I set one up that consist of a cube domain with an internal volume that I wish to use to set initial values. BTW, I use tetgen to create the mesh, and I use sketchup with my preprocessor plugin (https://extensions.sketchup.com/en/c...y-tetgen-tools) to set up the geometry.

The geometry looks like this (SketchUp:


The mesh looks like this (GMSH):


2) Run tetgenToFoam to convert to OpenFOAM.

3) Export an stl of the internal region that you want to set values inside of, and save to the triSurface directory in your case.

4) In the topotSetDictionary, use "surfaceToCell" to create a set of all point inside.

5) Run setFields for the set you've just created.

The mesh is perfectly aligned, and the cells are correctly assigned initial values (from paraview):



That's how to set exact initial values. After that (time > 0) you'll have to rely on AMR to resolve the VOF interface.

Hope that helps - enjoy!
Peter
opedrofunk is offline   Reply With Quote

Old   April 28, 2015, 12:16
Default
  #6
Member
 
Join Date: Feb 2014
Posts: 34
Rep Power: 12
Prosper is on a distinguished road
Quote:
Originally Posted by olivierG View Post
hello,

Adaotative meshing work fdon't work with tetrahedral cell, and tetrahedral cell will capture a bad interface anyway.
What you can try is:
1) from you initial mesh, use setFields to create your liquid sphere
2) run 1 iterate with interDyMFoam => this with refine mesh at interface, but you will see a not smooth interface.
3) call setField again (re initialise) => you interface should now be more smooth
4) run ...

regards,
olivier
Hi Olivier,

Thank you for your reply!

I tried you method and it is working for me! I ran setFields again after 1 time step and the interface shape is much better refined.

I found that I may need to do this several times and set the mesh refinement level higher to get the resolution I need.

Thanks again!

-P
Prosper is offline   Reply With Quote

Old   April 28, 2015, 12:24
Default
  #7
Member
 
Join Date: Feb 2014
Posts: 34
Rep Power: 12
Prosper is on a distinguished road
Quote:
Originally Posted by opedrofunk View Post
Hi Everyone,

In fact, it's quite easy to set values for arbitrarily shaped volumes in a tetrahedral mesh (or any type, for that matter) in OpenFOAM.

This is the procedure I use:

1) Generate a tet mesh which respects the internal (and external, of course) boundaries that you which to capture. For this example, I set one up that consist of a cube domain with an internal volume that I wish to use to set initial values. BTW, I use tetgen to create the mesh, and I use sketchup with my preprocessor plugin (https://extensions.sketchup.com/en/c...y-tetgen-tools) to set up the geometry.

The geometry looks like this (SketchUp:


The mesh looks like this (GMSH):


2) Run tetgenToFoam to convert to OpenFOAM.

3) Export an stl of the internal region that you want to set values inside of, and save to the triSurface directory in your case.

4) In the topotSetDictionary, use "surfaceToCell" to create a set of all point inside.

5) Run setFields for the set you've just created.

The mesh is perfectly aligned, and the cells are correctly assigned initial values (from paraview):



That's how to set exact initial values. After that (time > 0) you'll have to rely on AMR to resolve the VOF interface.

Hope that helps - enjoy!
Peter
Hi Peter,

Thank you for your reply!

I'll definitely try what you did and the mesh looks really good to resolve the interface shape. When I tried block meshes I always get non-smoothness and corners on the interface. I believe if I use tetrahedral meshes there shouldn't be corners on the interface.

Thanks again and I'll let you know how it goes.

Best,
-P
Prosper is offline   Reply With Quote

Old   June 22, 2015, 07:24
Default
  #8
New Member
 
WeiYang
Join Date: Jan 2014
Location: China
Posts: 3
Rep Power: 12
yangzie2014 is on a distinguished road
hello Olivier:
You have provided a good method to achieve refinement for a deformed droplet. However, it works only if run with a single core. when parallel is used, the interface is not smooth. whether you encountered this problem or not.
YOUNG
yangzie2014 is offline   Reply With Quote

Old   October 19, 2017, 03:03
Default AMR_DynamicMeshdict
  #9
Member
 
Ali Noaman Ibrahim
Join Date: Sep 2015
Location: US_Chicago
Posts: 97
Rep Power: 11
alinuman15 is on a distinguished road
Dear All:-
If I want to set up the dynamicMeshDict to refine based on alpha field (for capturing the droplet interface), do I need to modify the interDyMFoam solver ? Could you state with steps what I should do ?
Thanks for any indea
alinuman15 is offline   Reply With Quote

Old   October 19, 2017, 03:19
Default
  #10
Member
 
Brian Willis
Join Date: Mar 2011
Location: Cape Town, South Africa
Posts: 58
Rep Power: 15
Dipsomaniac is on a distinguished road
Dear Ali

You shouldn't have to modify interDyMFoam. The dynamic refinement class modifies the mesh based on the alpha field, i.e. where the interface is. Check the damBreakWithObstacle tutorial in the interDyMFoam examples for an example of how it works.

Regards,
Brian
Dipsomaniac is offline   Reply With Quote

Old   October 19, 2017, 03:27
Default
  #11
Member
 
Ali Noaman Ibrahim
Join Date: Sep 2015
Location: US_Chicago
Posts: 97
Rep Power: 11
alinuman15 is on a distinguished road
Quote:
Originally Posted by Dipsomaniac View Post
Dear Ali

You shouldn't have to modify interDyMFoam. The dynamic refinement class modifies the mesh based on the alpha field, i.e. where the interface is. Check the damBreakWithObstacle tutorial in the interDyMFoam examples for an example of how it works.

Regards,
Brian
Thanks, Brian!
I will look into that. But, I would like to make AMR works with moving mesh to simulate droplet on a surface with dynamic angle BCs. Therefore, I posted here to check if I am on the right track. I think I have to combine at least two classes to achieve my goal. Any comment?
alinuman15 is offline   Reply With Quote

Reply

Tags
interdymfoam, interface


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
Question about adaptive timestepping Guille1811 CFX 25 November 12, 2017 18:38
[Gmsh] 2D Mesh Generation Tutorial for GMSH aeroslacker OpenFOAM Meshing & Mesh Conversion 12 January 19, 2012 04:52
Doxygen documentation Tanay OpenFOAM Installation 9 September 23, 2011 12:40
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 22:11
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 10:11


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