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

[blockMesh] Mesh refinement for a cylindrical mesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 20, 2011, 05:54
Default Mesh refinement for a cylindrical mesh
  #1
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 15
lindstroem is on a distinguished road
Hi Foamers,

although I have read a lot oft posts concerning this topic, I couldn't really find an answer. Therefore sorry if it maybe was already answered!

I have created the attached mesh using blockMesh:


What I now want to do is to refine a certain area at the corner of the mesh.
Earlier I had a cube where I could refine a specified area easily using the cellSet command, but in this case, the structure of my mesh gets lost. Is there a similar tool to refine certain areas which are not "box-shaped"?

Thanks!
lindstroem is offline   Reply With Quote

Old   February 4, 2011, 07:42
Default
  #2
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 15
lindstroem is on a distinguished road
little workaround is with cellSet and refineMesh with a local coordinate system. But I'm still interested in other suggestions about how to get around that cellSet only allows boxToCell, which is not optimal for the mentioned geometry.

Greetings
lindstroem is offline   Reply With Quote

Old   February 7, 2011, 16:55
Default
  #3
New Member
 
kalyan
Join Date: Oct 2010
Posts: 19
Rep Power: 15
hardykalyan is on a distinguished road
Quote:
Originally Posted by lindstroem View Post
little workaround is with cellSet and refineMesh with a local coordinate system. But I'm still interested in other suggestions about how to get around that cellSet only allows boxToCell, which is not optimal for the mentioned geometry.

Greetings

cellSet also has cylinderTocell option which can extract the cells in the cylinder regions specified
hardykalyan is offline   Reply With Quote

Old   February 10, 2011, 08:31
Default
  #4
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 15
lindstroem is on a distinguished road
Hi thanks for the hint! Coudl you help me with the syntax? I havent found any use of it so far...

Thanks!
lindstroem is offline   Reply With Quote

Old   February 10, 2011, 13:16
Default
  #5
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 15
lindstroem is on a distinguished road
Usage: cylinderToCell (p1X p1Y p1Z) (p2X p2Y p2Z) radius
Select all cells with cell centre within bounding cylinder
lindstroem is offline   Reply With Quote

Old   July 30, 2012, 09:00
Default
  #6
New Member
 
Teemo
Join Date: May 2012
Posts: 28
Rep Power: 13
Teemo is on a distinguished road
hi lindstroem,

I tried cylinderToCell to generate cylinder but the boundary is not smooth (https://docs.google.com/drawings/d/1...DW5AXeEmY/edit)since I used blockMesh to set the domain, do you have any idea about how to set the region instead of blockMesh?

Regards,
T
Teemo is offline   Reply With Quote

Old   July 30, 2012, 09:06
Default
  #7
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 15
lindstroem is on a distinguished road
Hi Teemo,

you want to "generate a cylinder"? some options are snappyHexMesh or O-Grids for cylinders (can be done with blockMesh). But I do not undersant your actual problem..

Greetings
L
lindstroem is offline   Reply With Quote

Old   July 30, 2012, 09:19
Default
  #8
New Member
 
Teemo
Join Date: May 2012
Posts: 28
Rep Power: 13
Teemo is on a distinguished road
Hi Lindstroem,

Sry for the bad description, I would like to test the wave load on the simplified floating cylinder-shape structure in a water tank, so I used one block to generate the whole tank and then employed toposet with cylinderToCell source to model the vertical floating object, while in paraview, you will see that the boundary of the cylinder is not smooth as as the mesh is made of only cuboidal cells(https://docs.google.com/drawings/d/1...DW5AXeEmY/edit).

Thanks,
T
Teemo is offline   Reply With Quote

Old   July 30, 2012, 09:34
Default
  #9
New Member
 
Teemo
Join Date: May 2012
Posts: 28
Rep Power: 13
Teemo is on a distinguished road
Hi again,

Could you link me any tutorial of using snappyHexMesh or O-grids for cylinders?

Many Thanks!
Teemo is offline   Reply With Quote

Old   July 30, 2012, 10:08
Default
  #10
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 15
lindstroem is on a distinguished road
I'm still not sure if I get you right, but the tutorial for snappy can be found by searching for snappyHexMeshDict in your tutorial folder (e.g. grep -r snappy .) and in the User Guide and for O-Grid see the forum:
http://www.cfd-online.com/Forums/ope...disc-like.html

But if you select your cells after creation I don't know how you could get rid of the staggered bubble.. if it is just the phase fraction, it will be "smooth" after the first iteration.

Greetings
lindstroem is offline   Reply With Quote

Old   July 30, 2012, 12:03
Default
  #11
New Member
 
Teemo
Join Date: May 2012
Posts: 28
Rep Power: 13
Teemo is on a distinguished road
Hi Lindstroem,

Sry for my bad English, it is not my first language.
The video linked below is what I would like to simulate.
http://www.youtube.com/watch?v=AuNWovYR6WA

My problem is :In my case, Firstly the wave tank are meshed by BlockMesh (just one block). Then I model the cylinder by using cylinderToCell but the cylinder boundary are not smooth since all cells created by blockMesh are cube.(https://docs.google.com/drawings/d/1...e6NzNv1hk/edit)
Teemo is offline   Reply With Quote

Old   July 31, 2012, 04:24
Default
  #12
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 15
lindstroem is on a distinguished road
Yes, I would recommend snappyHexMesh (sHM) for that: So you use your inital block you created and within your sHMDict you define the cylinder you want to cut.. Then let sHM do the work for you and simulate your waves.

Greetings
L
lindstroem is offline   Reply With Quote

Old   June 19, 2018, 05:06
Default
  #13
Member
 
Ben 017
Join Date: Nov 2017
Posts: 70
Rep Power: 8
Ben UWIHANGANYE is on a distinguished road
Quote:
Originally Posted by Teemo View Post
hi lindstroem,

I tried cylinderToCell to generate cylinder but the boundary is not smooth (https://docs.google.com/drawings/d/1...DW5AXeEmY/edit)since I used blockMesh to set the domain, do you have any idea about how to set the region instead of blockMesh?

Regards,
T
Hello Teemo,

Have you been able to solve this?
May you help?

Indeed, I want to do the same as you wanted to do. But for my case the cylinder will be not floating but immersed in wave.

May you help with your setup.

Thank you!
Ben UWIHANGANYE is offline   Reply With Quote

Old   June 19, 2018, 05:48
Default
  #14
Member
 
Yage
Join Date: May 2014
Posts: 60
Rep Power: 11
Yage is on a distinguished road
Quote:
Originally Posted by Ben UWIHANGANYE View Post
Hello Teemo,

Have you been able to solve this?
May you help?

Indeed, I want to do the same as you wanted to do. But for my case the cylinder will be not floating but immersed in wave.

May you help with your setup.

Thank you!
Hi Ben,

1. You could build up your cylinder model first (with CAD software, like SolidWorks, with STL file output), and use snappyhexMesh to input your cylinder and refine its surface.
2. You could try waves2foam package to generate waves.

Regards,
Yage
Yage is offline   Reply With Quote

Old   June 19, 2018, 06:14
Default
  #15
Member
 
Ben 017
Join Date: Nov 2017
Posts: 70
Rep Power: 8
Ben UWIHANGANYE is on a distinguished road
Quote:
Originally Posted by Yage View Post
Hi Ben,

1. You could build up your cylinder model first (with CAD software, like SolidWorks, with STL file output), and use snappyhexMesh to input your cylinder and refine its surface.
2. You could try waves2foam package to generate waves.

Regards,
Yage

Thank you,

But i am not yet there,

I want first to map a cylinder in my fluid domain that i generated using blockMesh. I guess toposetDict can help.
I want to simulate first using pisoFoam or any simple solver.
Just help to use cylinderTocell in toposetDict to get that cylinder?
(below is my blockMesh)

How do you understand my approach?

The coordinate of the cylinder I want: center(0 0 0), diameter:0.5
Then what will be p1 and p2?

Thank you!



--------------------------------------------------------------------------------------
convertToMeters 0.1;

vertices
(
(200 -50 0)
(200 50 0)
(-25 50 0)
(-25 -50 0)

(200 -50 1)
(200 50 1)
(-25 50 1)
(-25 -50 1)
);

blocks
(
hex (0 1 2 3 4 5 6 7) (100 225 1) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
inlet
{
type patch;
faces
(
(2 3 7 6)
);
}

outlet
{
type patch;
faces
(
(0 1 5 4)
);
}

topAndBottom
{
type patch;
faces
(
(1 2 6 5)
(0 3 7 4)
);
}

frontAndBack
{
type empty;
faces
(
(0 1 2 3)
(4 5 6 7)
);
}
);

mergePatchPairs
(
);

// ************************************************** *********************** //
Ben UWIHANGANYE is offline   Reply With Quote

Old   June 19, 2018, 06:56
Default
  #16
Member
 
Yage
Join Date: May 2014
Posts: 60
Rep Power: 11
Yage is on a distinguished road
Quote:
Originally Posted by Ben UWIHANGANYE View Post
Thank you,

But i am not yet there,

I want first to map a cylinder in my fluid domain that i generated using blockMesh. I guess toposetDict can help.
I want to simulate first using pisoFoam or any simple solver.
Just help to use cylinderTocell in toposetDict to get that cylinder?
(below is my blockMesh)

How do you understand my approach?

The coordinate of the cylinder I want: center(0 0 0), diameter:0.5
Then what will be p1 and p2?

Thank you!



--------------------------------------------------------------------------------------
convertToMeters 0.1;

vertices
(
(200 -50 0)
(200 50 0)
(-25 50 0)
(-25 -50 0)

(200 -50 1)
(200 50 1)
(-25 50 1)
(-25 -50 1)
);

blocks
(
hex (0 1 2 3 4 5 6 7) (100 225 1) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
inlet
{
type patch;
faces
(
(2 3 7 6)
);
}

outlet
{
type patch;
faces
(
(0 1 5 4)
);
}

topAndBottom
{
type patch;
faces
(
(1 2 6 5)
(0 3 7 4)
);
}

frontAndBack
{
type empty;
faces
(
(0 1 2 3)
(4 5 6 7)
);
}
);

mergePatchPairs
(
);

// ************************************************** *********************** //
Hi Ben,


The setup of cylindertocell should be like

(P1X P1Y P1Z) (P2X P2Y P2Z) radius

the Px, Py... are the centres of upper and lower surface. They could be higher and lower than your "front" And "Back" since your background mesh is in 2D.

While in my experience, the cylindertoCell was not quite good to build the curved boundary of the cylinder

Yage
Yage is offline   Reply With Quote

Old   June 19, 2018, 08:24
Default
  #17
Member
 
Ben 017
Join Date: Nov 2017
Posts: 70
Rep Power: 8
Ben UWIHANGANYE is on a distinguished road
Quote:
Originally Posted by Yage View Post
Hi Ben,


The setup of cylindertocell should be like

(P1X P1Y P1Z) (P2X P2Y P2Z) radius

the Px, Py... are the centres of upper and lower surface. They could be higher and lower than your "front" And "Back" since your background mesh is in 2D.

While in my experience, the cylindertoCell was not quite good to build the curved boundary of the cylinder

Yage
Hi Yage,

I am sorry to be disturbing again.
I humbly request if you have time , you may look on the attached folder and help me to why that cylinder in not appearing. you may help to know what i am missing in my topsetDict.

Thank you!
Attached Files
File Type: gz ibcylinder.tar.gz (3.9 KB, 8 views)
Ben UWIHANGANYE is offline   Reply With Quote

Old   June 19, 2018, 13:07
Default
  #18
Member
 
Yage
Join Date: May 2014
Posts: 60
Rep Power: 11
Yage is on a distinguished road
Quote:
Originally Posted by Ben UWIHANGANYE View Post
Hi Yage,

I am sorry to be disturbing again.
I humbly request if you have time , you may look on the attached folder and help me to why that cylinder in not appearing. you may help to know what i am missing in my topsetDict.

Thank you!
Hi

I cant check your file right now but it may be caused by the "convertToMeters". Try to rewrite your blockMesh with "convertToMeters 1".

Yage
Yage is offline   Reply With Quote

Old   June 20, 2018, 08:34
Default cylinderTocell
  #19
Member
 
Ben 017
Join Date: Nov 2017
Posts: 70
Rep Power: 8
Ben UWIHANGANYE is on a distinguished road
Dear Yage,


I have refined the cell size:



convertToMeters 1;

vertices
(
(200 -50 0)
(200 50 0)
(-25 50 0)
(-25 -50 0)

(200 -50 1)
(200 50 1)
(-25 50 1)
(-25 -50 1)
);

blocks
(
hex (0 1 2 3 4 5 6 7) (1100 400 1) simpleGrading (1 1 1)
);

edges
(
);




my topoSetDict: is as follow:


FoamFile
{
version 2.0;
format ascii;
class dictionary;
object topoSetDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

actions
(
{
name solid;
type cellSet;
action new;
source cylinderToCell;
sourceInfo
{
radius 0.5;
p1 (0 0 0); // start point on cylinder axis
p2 (0 0 1); // end point on cylinder axis

}


}

);


but still i am not seeing the cylinder i want in paraview.


What could be the reason?


you may check on the attached folder
Attached Files
File Type: gz mapcylinder.tar.gz (3.9 KB, 4 views)
Ben UWIHANGANYE is offline   Reply With Quote

Old   June 20, 2018, 10:35
Default
  #20
Member
 
Yage
Join Date: May 2014
Posts: 60
Rep Power: 11
Yage is on a distinguished road
Quote:
Originally Posted by Ben UWIHANGANYE View Post
Dear Yage,


I have refined the cell size:



convertToMeters 1;

vertices
(
(200 -50 0)
(200 50 0)
(-25 50 0)
(-25 -50 0)

(200 -50 1)
(200 50 1)
(-25 50 1)
(-25 -50 1)
);

blocks
(
hex (0 1 2 3 4 5 6 7) (1100 400 1) simpleGrading (1 1 1)
);

edges
(
);




my topoSetDict: is as follow:


FoamFile
{
version 2.0;
format ascii;
class dictionary;
object topoSetDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

actions
(
{
name solid;
type cellSet;
action new;
source cylinderToCell;
sourceInfo
{
radius 0.5;
p1 (0 0 0); // start point on cylinder axis
p2 (0 0 1); // end point on cylinder axis

}


}

);


but still, i am not seeing the cylinder i want in paraview.


What could be the reason?


you may check on the attached folder
Your cell is still too big, why use such a big background 225x100x1 when your cylinder is only 0.5?

1. Use small background
2. And you miss patch setup for your cylinder in blockMeshDict, adding these:
solid
{
type wall;
faces ();
}

3. In your toposetDict, add:

{
name solid;
type cellSet;
action invert;
}


4. In your allrun, add:

runApplication subsetMesh -overwrite solid -patch solid
Yage 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
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 05:38
[snappyHexMesh] problems generating clean mesh Christian_tt OpenFOAM Meshing & Mesh Conversion 2 June 20, 2019 05:39
[snappyHexMesh] Removing further cells after SHM zonda OpenFOAM Meshing & Mesh Conversion 14 September 15, 2017 07:50
[snappyHexMesh] snappyHexMesh & Mesh around a missile sasanghomi OpenFOAM Meshing & Mesh Conversion 2 October 15, 2014 19:54
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 21:11


All times are GMT -4. The time now is 17:03.