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

[snappyHexMesh] Mesh around ship with appropriate free surface refinement

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree27Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 4, 2012, 15:43
Default Mesh around ship with appropriate free surface refinement
  #1
Member
 
Hannes
Join Date: Apr 2009
Location: Schleswig, Germany
Posts: 38
Rep Power: 17
Hannes_Kiel is on a distinguished road
Hi,
I'm looking for a way to generate a mesh around a ship with the "typical" refinement of the free surface region to capture the waves.
Basically, what I intend to do is following:
- start with a base grid (from BlockMesh) with identical cells of aspect ratio approx. 1
- in SHM:
- refine near hull and appendages as usual by isotropic splitting of cells (1 -> 8)
- refine the free surface further away from ship mostly normal to the initial waterplane (anisotropically) as the waves are expected to be significantly longer than high (I don't want to waste cells, isotropic refinement of larger regions significantly pushes cell count)
- snap to hull and appendages
- create inflation layers for boundary layer

The difficulty is the anisotropic refinement of the free surface region. In Hexpress or Star-CCM+ mesher I can define either isotropic or anisotropic refinement for a region. In SHM, as far as I understand it, only isotropic refinement is possible in the Dict and the hex8 class referenced by SHM (although the refineMesh utility has anisotropic refinement).

Does anyone have a solution to this problem, either by a modification to SHM or a specific workflow?

Thanks
Hannes
dupeng likes this.
Hannes_Kiel is offline   Reply With Quote

Old   June 7, 2012, 15:27
Default
  #2
Senior Member
 
sail's Avatar
 
Vieri Abolaffio
Join Date: Jul 2010
Location: Always on the move.
Posts: 308
Rep Power: 17
sail is on a distinguished road
Hi Hannes.

what i do is to mesh everything isotropically in sHM, snap, add the layers and than refine the freesurface using the setSet to select the freesurface area and refineMesh to refine anisotropiacally (just in the z direction).

good results so far...
__________________
http://www.leadingedge.it/
Naval architecture and CFD consultancy
sail is offline   Reply With Quote

Old   June 8, 2012, 02:41
Default
  #3
Member
 
Hannes
Join Date: Apr 2009
Location: Schleswig, Germany
Posts: 38
Rep Power: 17
Hannes_Kiel is on a distinguished road
Hi Vieri,

thank You for the explanation. I'll try that way as well as one described in a paper I just found: http://www.tfd.chalmers.se/~hani/kurser/OS_CFD/ChristofferJarpner/ReportInOpenFOAMbyChristofferJarpner.pdf

Nice website, by the way.

Cheers,
Hannes
Hannes_Kiel is offline   Reply With Quote

Old   June 25, 2012, 17:14
Default
  #4
New Member
 
Rafael Coelho
Join Date: Jun 2012
Location: Portsmouth
Posts: 23
Rep Power: 14
Rafael_Coelho is on a distinguished road
Hi Hannes,

It seems that the link is not working anymore. Could you please forward me the file?


Thank you!
Rafael_Coelho is offline   Reply With Quote

Old   June 26, 2012, 02:47
Default
  #5
Member
 
Hannes
Join Date: Apr 2009
Location: Schleswig, Germany
Posts: 38
Rep Power: 17
Hannes_Kiel is on a distinguished road
PM me your Email.
Hannes
Hannes_Kiel is offline   Reply With Quote

Old   June 26, 2012, 02:51
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,980
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

For the sake of future reference, the link was sent back to the historic side (2011) of the course : http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2011/ChristofferJarpner/ReportInOpenFOAMbyChristofferJarpner.pdf

Best regards,
Bruno
Hannes_Kiel likes this.
__________________
wyldckat is offline   Reply With Quote

Old   June 27, 2012, 02:28
Default pdf
  #7
New Member
 
Rafael Coelho
Join Date: Jun 2012
Location: Portsmouth
Posts: 23
Rep Power: 14
Rafael_Coelho is on a distinguished road
Thank you very much Bruno.

Obrigado!
Rafael_Coelho is offline   Reply With Quote

Old   November 19, 2012, 19:47
Default
  #8
Member
 
laurentL
Join Date: Oct 2011
Location: new caledonia
Posts: 73
Rep Power: 14
laurent98 is on a distinguished road
hi all,
i am dealing with same problem, if i refineMesh (in dirZ) before SHM, shm doesn t do layers to good, and split a lot of cells at the junction of free surface and hull. but if i do shm them refineMesh it create files in the case directory a lot of cells, loops, anchors .obj ... and the solver fail because of negative alpha1...
any subjection ?
laurent98 is offline   Reply With Quote

Old   April 25, 2013, 01:38
Default
  #9
Member
 
laurentL
Join Date: Oct 2011
Location: new caledonia
Posts: 73
Rep Power: 14
laurent98 is on a distinguished road
dear Foamers,
i have made some little progress, i refine the free surface with toposet and refineMesh but when i run snappyhexmesh it's refine to much the cells around the hull selected with toposet...
do i need to make my own mysnappyHexmeh to obtain a good mesh.?
should i make two mesh and stich them?
going trought the paper of Christoffer Jarpner look very interesting but a bit hard isn't it???
thanks for helping LL
Attached Images
File Type: jpg level(6_6)_refinemesh.jpg (64.1 KB, 523 views)
laurent98 is offline   Reply With Quote

Old   April 25, 2013, 02:31
Default
  #10
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 19
colinB is on a distinguished road
Hi laurent98,

I'm not sure how much you are familiar with sHM,
but from what you wrote two options come to my mind that could help you

* you switch the order of your process: first run sHM and then run topoSet
and refineMesh

* limit the number of cells with the keyword maxGlobalCells in the sHMD

I hope I got your question right if not let me know.

regards
colinB is offline   Reply With Quote

Old   April 25, 2013, 06:34
Default
  #11
Member
 
laurentL
Join Date: Oct 2011
Location: new caledonia
Posts: 73
Rep Power: 14
laurent98 is on a distinguished road
Hi Colin,
thank you for reply. To answer your question, I play with openfoam during my free time, and use finemarine of numeca at work since a year... so I still have a lot to learn...
I did as you suggest shm then refinemesh, the domain set in toposetDict is like a U around a refining box.
as you can see I ve got a gap between hull and the limit of the box. Of course I will have to adjust the shmD to have the same size in Z between box and freesurface, but because of diffusion, refineMesh will always refine more cells around the box...
also refinemesh in z direction only make some strange cells around, like cube inside cube.. see the slice image cut.jpg
so, I am thinking of making two different mesh one for the freesurface, and one for a small box around the hull, is there something better ?
I will be happy with a mesh like the one
http://www.youtube.com/watch?v=_j-zT...eature=related
best regards LL
Attached Images
File Type: jpg cut.jpg (106.1 KB, 375 views)
File Type: jpg bow.jpg (80.9 KB, 362 views)
laurent98 is offline   Reply With Quote

Old   April 25, 2013, 08:28
Default
  #12
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 19
colinB is on a distinguished road
Hi LL

from the video I think I could see what kind of mesh you want
but let me summarize in my own words to see whether I grasp what
you want:

You want to have the mesh refined around the ship hull, rather dense
in order to resolve e.g the boundary layer, which you basically want to
achieve with sHM

However in the area of the free surface you want to refine the mesh
as well especially in z direction to better capture the wave elevation.

If this is so my suggestion would be:

- create a coarse background mesh with blockMesh

- use snappyHexMesh only to mesh the surface and use refinementMode
distance and add layers

- then use topoSet with a box refinement in order to refine the free
surface

I hope I got your idea right. However the above mentioned way provides
good results for me.
If I didn't get your idea you might want to provide some sketches which
illustrate your problem and a sHMD as well.

regards
Colin
chliu likes this.
colinB is offline   Reply With Quote

Old   April 26, 2013, 02:06
Default
  #13
Member
 
laurentL
Join Date: Oct 2011
Location: new caledonia
Posts: 73
Rep Power: 14
laurent98 is on a distinguished road
hi Colin,
you've got exactly right my ideas
i did as you said, and trying my best to match the box limit bettewen the hull refinement and the FreeSurface Z refinement.
good idea to use distance, i never used that option before...
but because i have a cell (nCellsBetweenLevels 1) in the FS refinement place, it make undesired splits cells as you see on the picture.
is there a equivalent of nCellsBetweenLevels 0 .??
thanks you again for helping LL
Attached Images
File Type: jpg cells_notwanted.jpg (105.2 KB, 344 views)
laurent98 is offline   Reply With Quote

Old   April 26, 2013, 02:22
Default
  #14
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 19
colinB is on a distinguished road
So you are trying to adjust the blocks directly to the refinement
which you are getting from snappyHexMesh?

Well the solution to this is simply defining a box which also includes
the ship even if there is no more mesh (inside of the ship)

If you want to have more refinement in certain areas you have to define
several boxes which are overlapping.

Did you get my idea?
So don't worry about boundaries but simply use overlapping refinement areas.
colinB is offline   Reply With Quote

Old   April 26, 2013, 02:59
Default
  #15
Member
 
laurentL
Join Date: Oct 2011
Location: new caledonia
Posts: 73
Rep Power: 14
laurent98 is on a distinguished road
i think it is what i am doing with the 'box1' i attach some of my files if you have time to look at it, i think you will better understand , of course all advice will be very welcome!
regards LL
Attached Files
File Type: txt topoSetDict.txt (1.2 KB, 196 views)
File Type: txt snappyHexMeshDict.txt (11.9 KB, 156 views)
File Type: txt Mesh_run.txt (1.8 KB, 118 views)
laurent98 is offline   Reply With Quote

Old   April 28, 2013, 08:54
Default
  #16
Member
 
laurentL
Join Date: Oct 2011
Location: new caledonia
Posts: 73
Rep Power: 14
laurent98 is on a distinguished road
hello
after a week-end playing with blockmesh, createpatch, mergemesh stitchmeshes, i am nearly there... still some inside patch to get rid off . mergeOrSplitBaffles ..???

Attached Images
File Type: jpg nearly_there.jpg (66.5 KB, 405 views)
Rafael_Coelho and dupeng like this.
laurent98 is offline   Reply With Quote

Old   April 28, 2013, 10:03
Default
  #17
Member
 
Hannes
Join Date: Apr 2009
Location: Schleswig, Germany
Posts: 38
Rep Power: 17
Hannes_Kiel is on a distinguished road
Hi,
I'm getting quite good meshes using blockMesh, sHM, topoSet and refineMesh by now (in OF2.2.x). I start with an isotropic grid for the entire domain with a split exactly on the designated waterline (approx. 10e4 cells). Then I refine isotropically around the ship and at the waterline, especially in the Kelvin angle region (sHM), followed by snapping and layer insertion. Last I split normal to the waterplane only in the region of the expected wave height.
pepe.aero and dupeng like this.
__________________
FluidEngineeringSolutions
Hannes_Kiel is offline   Reply With Quote

Old   May 29, 2013, 03:11
Default
  #18
New Member
 
Join Date: Apr 2011
Posts: 28
Rep Power: 15
pepe.aero is on a distinguished road
Dear all,

I'm keenly interested in the described use of SHM and refineMesh and I've read your previous posts.
I still have trouble in refining the free surface region.

My procedure is:

1. run blockMesh
2. run SHM (setting castellated, snap, layers as true)
3. run topoSet to select a box to be refined
4. run refineMesh over the selected box and refining just in normal direction

It's not clear to me if I have to run repeatedly topoSet and refineMesh, adapting every step the box to be refined in topoSet, because the refineMesh can split just one initial cell into two (in normal direction).
Is this the only way or a smarter procedure exist?
Any suggestions (also about my workflow) is really appreciated! Thanks for youe support,

Best regards.

Andrea
pepe.aero is offline   Reply With Quote

Old   May 29, 2013, 06:36
Default
  #19
Senior Member
 
sail's Avatar
 
Vieri Abolaffio
Join Date: Jul 2010
Location: Always on the move.
Posts: 308
Rep Power: 17
sail is on a distinguished road
Quote:
Originally Posted by pepe.aero View Post
Dear all,

I'm keenly interested in the described use of SHM and refineMesh and I've read your previous posts.
I still have trouble in refining the free surface region.

My procedure is:

1. run blockMesh
2. run SHM (setting castellated, snap, layers as true)
3. run topoSet to select a box to be refined
4. run refineMesh over the selected box and refining just in normal direction

It's not clear to me if I have to run repeatedly topoSet and refineMesh, adapting every step the box to be refined in topoSet, because the refineMesh can split just one initial cell into two (in normal direction).
Is this the only way or a smarter procedure exist?
Any suggestions (also about my workflow) is really appreciated! Thanks for youe support,

Best regards.

Andrea
try this:

1. run blockMesh
2. run SHM (setting castellated as true and snap, layers false)
3. run topoSet to select a box to be refined
4. run refineMesh over the selected box and refining just in normal direction
2. run SHM (setting castellated as false and snap, layers true)

if you need more than one anisotropic refinement you will need to rerun toposet and refinemesh more than one time.

best Regards,

V.
__________________
http://www.leadingedge.it/
Naval architecture and CFD consultancy
sail is offline   Reply With Quote

Old   May 29, 2013, 12:14
Default
  #20
New Member
 
Join Date: Apr 2011
Posts: 28
Rep Power: 15
pepe.aero is on a distinguished road
Hi Vieri,

thanks for your reply.
I've tried the procedure you suggested, but still troubles remain. Using the following procedure:

1. blockMesh
2. SHM (setting castellated as true, snap false, layers false)
3. topoSet
4. refineMesh
( till now checkMesh is very good !! )
5. SHM (setting castellated as false, snap true, layers true)

I was hoping this would work fine, but the following error was reported:

--> FOAM FATAL ERROR:
Number of cells in mesh:1948200 does not equal size of cellLevel:918205
This might be because of a restart with inconsistent cellLevel.

It seems that the 0/cellLevel file has not be updated after the refineMesh phase.
How did you manage this problem, if it happened to you in the past?

Thanks in advance, best regards.

Andrea
pepe.aero is offline   Reply With Quote

Reply

Tags
refinement, ship wave, shm, snappyhexmesh

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 05:38
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops avinashjagdale OpenFOAM Meshing & Mesh Conversion 53 March 8, 2019 09:42
[snappyHexMesh] Snappy Hex Mesh - issue with smoothness of the model edges olek.warc OpenFOAM Meshing & Mesh Conversion 1 August 31, 2018 11:31
[snappyHexMesh] crash sHM H25E OpenFOAM Meshing & Mesh Conversion 11 November 10, 2014 11:27
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 11:55


All times are GMT -4. The time now is 13:38.