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

[snappyHexMesh] SnappyHexMesh and 2 Phase Modelling

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 21, 2008, 07:13
Default SnappyHexMesh and 2 Phase Modelling
  #1
New Member
 
Axel Mohr
Join Date: Mar 2009
Location: Kiel, Schleswig-Holstein, Germany
Posts: 24
Rep Power: 17
alexm is on a distinguished road
Hello All,

I would like to use OpenFOAM for shiptank-modeling, now after using icoFoam and turbFoam, with rasInterFoam. Now my actual problem, where I stuck, is to create a sharp interface in the model-mesh, which should act as boundary-surface of the two phases in the rasInterFoam case.

First with blockMesh I created a hexahedronal quadratic mesh with the dimensions of the tank. The ship-hull is available as a geometry in iges or step format. Gmesh (http://www.geuz.org/gmsh/) creates a triangular surface mesh out of this, which is saved as STL-File.

These parts are needed by snappyHexMesh to build the desired mesh of the model area. So far, this works fine (nevertheless until now not all arguments are perfectly understood by me) but the resulting mesh is satisfactory - for single phase modeling the top patch is set to the water-level, the part of the hull that lies over the surface will be truncated.

But for 2 phase modeling I think an internal face or patch is needed, which marks the water-level and separates these phases in the resulting mesh.

So far I've tried a lot of things. The last had been using snappyHexMesh first with the water-phase, then the same with the air-phase, then merging these resulting meshes with 'mergeMeshes' - but at last stitchMesh failed.

Now I hope, that someone here has an idea, suggestion or a solution for my problem.
Something like a "How-To" for creating an boundary layer between two phases for usage in snappyHexMesh would be great.
(what about the layer sub-dict in the snappyHexMeshDict? but here an internal face is needed?)

Maybe there is a simple apparently solution, but I can't see it ...

Thanks in advance for your help!

bye and greetings, Axel
alexm is offline   Reply With Quote

Old   September 23, 2008, 18:49
Default Hello All, now I've learned
  #2
New Member
 
Axel Mohr
Join Date: Mar 2009
Location: Kiel, Schleswig-Holstein, Germany
Posts: 24
Rep Power: 17
alexm is on a distinguished road
Hello All,

now I've learned, how to create internal face. Even though it does not solve my problem, I would like to give a short description:

1. creating a hexahedronal mesh with blockMesh, not to forget to ensure, that there will be faces at the desired position

2. using faceSet with a faceSetDict, including:
name f0;
action new;
boxToFace // or another ...
{
box (x1, y1, z1) (x2, y2, z2);
}

3. adding the new face to "boundary":
n+1
{
.
.
.
{ intern-A
type patch;
nFaces 0;
startFace ;
}

4. createBaffles f0 intern-A

Don't forget -case <path> at each utility.

A more detailed description of this is here:
http://www.cfd-online.com/OpenFOAM_D...es/1/5108.html

But, unfortunately the result is not that what I wanted. snappyHexMesh realize these internal face as external boundary, not just as a flat plane in the interior of the new mesh --- as I hoped.

Any other idea?

greeting, Axel


... nevertheless, snappyHesMesh is a great tool.
alexm is offline   Reply With Quote

Old   September 25, 2008, 11:45
Default oh, i think we have the same p
  #3
erik023
Guest
 
Posts: n/a
oh, i think we have the same problem, i did just post something above!
are you getting anywhere?

Erik Ekedahl
  Reply With Quote

Old   September 25, 2008, 16:24
Default the last thing I've tried had
  #4
New Member
 
Axel Mohr
Join Date: Mar 2009
Location: Kiel, Schleswig-Holstein, Germany
Posts: 24
Rep Power: 17
alexm is on a distinguished road
the last thing I've tried had been partitioning the problem in two cases, one for the water-phase and one for the air-phase and applying snappyHexMesh on both cases. But so far, after merging both meshes, unfortunately stitchMesh failed.

=> http://www.cfd-online.com/OpenFOAM_D.../126/8450.html
alexm is offline   Reply With Quote

Old   October 2, 2008, 09:32
Default I'd also like to test snappyHe
  #5
New Member
 
Nicola Parolini
Join Date: Mar 2009
Posts: 4
Rep Power: 17
nicoparo is on a distinguished road
I'd also like to test snappyHexMesh in the context of free-surface flows.

I'm encountering problems to understand how the tool works. Running the tutorial iglooWithFridges I'd like to see wath happen increasing the number of layers on the fridges from 1 to 5. The code runs through the different steps including the layers generation, and from the log it seems that a layer mesh is generated

Writing 8540 added cells to cellSet addedCells
Writing 6720 faces inside added layer to faceSet layerFaces
Layer mesh : cells:18953 faces:61079 points:23729

However, as far as I can see in paraFoam, no boundary layer mesh is showing up around the fridges.

Am I missing something ?

Thanks a lot.

nico
nicoparo is offline   Reply With Quote

Old   October 2, 2008, 15:43
Default Try displaying the cellSet onl
  #6
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Try displaying the cellSet only (convert with "foamToVTK -cellSet addedCells"). Use the clip filter in Paraview to e.g. cut through the fridge.
mattijs is offline   Reply With Quote

Old   October 3, 2008, 01:35
Default Also, make sure you load the r
  #7
Member
 
Martin Aunskjaer
Join Date: Mar 2009
Location: Denmark
Posts: 53
Rep Power: 17
aunola is on a distinguished road
Also, make sure you load the right time directory; snappyHexMesh writes outputs from different stages to different time directories (probably unless you have purgeWrite in controlDict). The final mesh is in the last one.
aunola is offline   Reply With Quote

Old   October 16, 2008, 23:40
Default I want to use interFoam to mod
  #8
New Member
 
Robert Manning
Join Date: Mar 2009
Posts: 12
Rep Power: 17
bobatpurdue is on a distinguished road
I want to use interFoam to model air/water transport. I have a STL file which contains the initial liquid region. I can use snappyHexMesh to create a mesh of the liquid. What do people recommend to add the mesh of the air? I've used mapFields to a new grid. However when viewed in paraview, it seems to not properly copy the wall patches from one grid to the target mesh.
bobatpurdue is offline   Reply With Quote

Old   October 17, 2008, 05:18
Default Since you're doing interFoam y
  #9
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Since you're doing interFoam you should generate both regions as one mesh and then set the fluid part using e.g. setFields or funkySetFields (see Wiki).

setFields can use any cell source that the cellSet application can so have a look at the sample cellSetDict in the application directory (mesh/manipulation/cellSet/cellSetDict). There is a surfaceToCell option there which might be useful.
mattijs is offline   Reply With Quote

Old   October 22, 2008, 10:28
Default Thanks Mattijs for the suggest
  #10
New Member
 
Robert Manning
Join Date: Mar 2009
Posts: 12
Rep Power: 17
bobatpurdue is on a distinguished road
Thanks Mattijs for the suggestion to use surfaceToCell. It works well but only sets gamma to 0 or 1. I've tried refineHexMesh to refine the mesh but to get a smooth interface requires a large number of cells. Essentially I want the gamma to vary as the fraction of the cell volume that is cut by the STL file. Is there anything out there? If not, where should I begin to write a code that performs this?
bobatpurdue is offline   Reply With Quote

Old   November 10, 2008, 08:09
Default Thanks Mattijs, and sorry for
  #11
New Member
 
Nicola Parolini
Join Date: Mar 2009
Posts: 4
Rep Power: 17
nicoparo is on a distinguished road
Thanks Mattijs, and sorry for the late reply. I've been far from OF for a few weeks. I've actually understood the problem which is related to parafoam. When I load the case, it first shows the level 1 grid (before snapping), if I increase the mesh level to 2 it shows the snapped grid, but when I further increase to 3 nothing changes. To visualize the boundary layer grid, I have to go back to 2 and then again to 3 and magically my layer grid is there. Don't know why it behaves like this, but it works.

Now I have another question related to feature edges. Reading other posts, it seems that feature edges are not supported at the moment. On the other hand, it exists (and it is described in the user guide) a featureEdgeMesh option in the snappy dictionary which should allow refinement based on edge definition. Is this option inactive in the current release ?

If it is already active, is there any example showing how the file someLine.eMesh should be define ?

Thanks a lot.

nicola
nicoparo is offline   Reply With Quote

Old   November 10, 2008, 14:18
Default There is only refinement based
  #12
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
There is only refinement based on feature edges. No snapping to feature edges.

Have a look at the source code for featureEdgeMesh so see how to read/write them or there is the surface/surfaceFeatureConvert utility. This is all still in state of flux though.
mattijs is offline   Reply With Quote

Old   November 11, 2008, 05:18
Default Thanks Mattijs. If anyone as a
  #13
New Member
 
Nicola Parolini
Join Date: Mar 2009
Posts: 4
Rep Power: 17
nicoparo is on a distinguished road
Thanks Mattijs. If anyone as already tried to use the featureEdgeMesh tool, I would be glad to see the format needed for the file someLine.eMesh to work.

thanks a lot.

nicola
nicoparo is offline   Reply With Quote

Old   December 9, 2008, 03:45
Default Hello All, A problem simila
  #14
Senior Member
 
Mark Couwenberg
Join Date: Mar 2009
Location: Netherlands
Posts: 130
Rep Power: 17
markc is on a distinguished road
Hello All,

A problem similar to what is described here:
SHM works fine but know I want to add some cell layers which are aligned with the local surfaces, as described in the User Manual (hood of the car). It should be doable with the fields under "layer" in the SHMdict.
I tried it in the iglo tutorial. After some playing around I found that when adding 4 or more layers, the alyers are actually created. Probably with less than 4 some constraints are not met (?).
However, the added layers are not added in the actual mesh but stored separately in a layerFaces set.
The layers are visualised below:

And the bottom of the iglo (in the final timestep):


Question: how shall these layers be incorporated in the actual mesh?
For reference here the SHM dict:
snappyHexMeshDict

Thanks for any advice,

Mark
markc is offline   Reply With Quote

Old   December 9, 2008, 05:30
Default Short answer: since you can se
  #15
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Short answer: since you can see the added faces in your faceSet they are also in the mesh. A faceSet/cellSet/pointSet is just a subset of mesh items.

You might look at where they are collapsed. Slice through your mesh and you'll see them.
mattijs is offline   Reply With Quote

Old   February 18, 2009, 06:05
Default here are some hints how to add
  #16
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 21
wolle1982 will become famous soon enough
here are some hints how to add the layers.

the
finalLayerRatio 0.1;
is in my opinion is the thickness of the complete boundarlayer in ratio to the blockMesh-created cell thickness. don't make the value too big or small. otherwise the added layer do not have enough space to fit in. just play around with it a little bit.

according to the original size of the backgroundmesh, your
minThickness 0.000001;
should not bee the big. otherwise the added layers are too small and will not be created.
wolle1982 is offline   Reply With Quote

Old   February 18, 2009, 06:07
Default here are some hints how to add
  #17
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 21
wolle1982 will become famous soon enough
here are some hints how to add the layers.

the
finalLayerRatio 0.1;
is in my opinion is the thickness of the complete boundarlayer in ratio to the blockMesh-created cell thickness. don't make the value too big or small. otherwise the added layer do not have enough space to fit in. just play around with it a little bit.

according to the original size of the backgroundmesh, your
minThickness 0.000001;
should not bee the big. otherwise the added layers are too small and will not be created.
wolle1982 is offline   Reply With Quote

Old   February 18, 2009, 06:14
Default Here I try to add image of the
  #18
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 21
wolle1982 will become famous soon enough
Here I try to add image of the Igloo Tutorial with its snappyHexMeshDict.

As you can see, several boundary layers are being added.



snappyHexMeshDict
wolle1982 is offline   Reply With Quote

Old   February 18, 2009, 06:26
Default some more information: it i
  #19
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 21
wolle1982 will become famous soon enough
some more information:

it is a very unsure thing with the boun darylayer addition of snappyHexMesh, but furthermore I think, that the expansionRation mustn't be too small. if it is e.g. 1.0, meaning the layers won't grow at all, sHM has no chance to add those layers while the over all thickness (finalLayerRatio) is too small (e.g. also 1.0). in this case sHM doesn't add the layers.

So always pay attention, that the expansion factor as well as the overallthickness, as well as the minimumthickness is in a healthy balance with the thickness of the cells which are created with blockMesh. here I'm not sure which cells are meant, the original blockMesh cells or the already refined cells by sHM.
wolle1982 is offline   Reply With Quote

Old   June 18, 2009, 19:07
Default
  #20
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 338
Rep Power: 18
louisgag is on a distinguished road
Send a message via ICQ to louisgag
Hi Wolfgang,

First, thanks for posting all this information.

Second, are these prisms I see in the boundary layer? Or are they hexahedrons rendered as prisms by paraview? I am trying to mesh my boundary layer with mostly hexahedrons using snappyHexMesh but it seems all the boundary layer cells are 5-face prisms.

Any thoughts on this? Am I wasting my time trying to get hexahedrons because prisms are better? My colleagues here are all using hexahedrons in their boundary layers, not prisms...

thanks and have a good day!

-Louis


EDIT:

for clarification, here is the output of my checkMesh:

Number of cells of each type:
hexahedra: 143741
prisms: 1454
wedges: 0
pyramids: 0
tet wedges: 92
tetrahedra: 0
polyhedra: 43413


and I attach a screenshot of a slice through my vehicle.. Seems like paraview is only showing me prisms but there are only 1454 according to checkMesh... so I am confused! Thanks again.

-Louis
Attached Images
File Type: jpg prisms.jpg (48.9 KB, 184 views)

Last edited by louisgag; June 18, 2009 at 23:46. Reason: clarification
louisgag 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
[snappyHexMesh] snappyhexmesh error in refinement phase ianjikar OpenFOAM Meshing & Mesh Conversion 2 May 11, 2018 14:27
[snappyHexMesh] Running snappyHexMesh in parallel - optimizing peterhess OpenFOAM Meshing & Mesh Conversion 2 January 3, 2018 03:54
[snappyHexMesh] Tutorial crashes: snappyHexMesh floating point exception. jasv OpenFOAM Meshing & Mesh Conversion 4 May 10, 2016 03:55
[snappyHexMesh] Problem with snappyhexMesh: modelling a pore chamber and pore throat model Saideep OpenFOAM Meshing & Mesh Conversion 5 May 10, 2015 15:46
[snappyHexMesh] problemes modelling surfaces with snappyhexmesh gija79 OpenFOAM Meshing & Mesh Conversion 5 June 30, 2010 14:50


All times are GMT -4. The time now is 20:14.