CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [snappyHexMesh] Mesh around ship with appropriate free surface refinement (https://www.cfd-online.com/Forums/openfoam-meshing/102860-mesh-around-ship-appropriate-free-surface-refinement.html)

Hannes_Kiel June 4, 2012 16:43

Mesh around ship with appropriate free surface refinement
 
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

sail June 7, 2012 16:27

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...

Hannes_Kiel June 8, 2012 03:41

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

Rafael_Coelho June 25, 2012 18:14

Hi Hannes,

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


Thank you!

Hannes_Kiel June 26, 2012 03:47

PM me your Email.
Hannes

wyldckat June 26, 2012 03:51

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

Rafael_Coelho June 27, 2012 03:28

pdf
 
Thank you very much Bruno.

Obrigado!

laurent98 November 19, 2012 20:47

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 April 25, 2013 02:38

1 Attachment(s)
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

colinB April 25, 2013 03:31

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

laurent98 April 25, 2013 07:34

2 Attachment(s)
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

colinB April 25, 2013 09:28

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

laurent98 April 26, 2013 03:06

1 Attachment(s)
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

colinB April 26, 2013 03:22

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.

laurent98 April 26, 2013 03:59

3 Attachment(s)
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

laurent98 April 28, 2013 09:54

1 Attachment(s)
hello
after a week-end playing with blockmesh, createpatch, mergemesh stitchmeshes, i am nearly there... still some inside patch to get rid off . mergeOrSplitBaffles ..???


Hannes_Kiel April 28, 2013 11:03

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 May 29, 2013 04:11

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

sail May 29, 2013 07:36

Quote:

Originally Posted by pepe.aero (Post 430662)
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.

pepe.aero May 29, 2013 13:14

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


All times are GMT -4. The time now is 05:33.