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

[Other] Structured quadrangular 3D mesh rounded cube

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 5, 2018, 09:24
Default Structured quadrangular 3D mesh rounded cube
  #1
Member
 
Cristina Hernandez
Join Date: May 2018
Posts: 35
Rep Power: 7
crizpi21 is on a distinguished road
Hi,

I want to use OpenFOAM to simulate the flow around a cube with rounded edges and calculate de drag coefficient. An example of the geometry is attached as a .stl file.

I am trying to create a quadrangular structured mesh for the whole domain, with a finer mesh around the cube to accurately model the pressure (ideally, the size of the cells around the cube should be 1/20 the characteristic length and get bigger as we move away from it).

Do you have any suggestions on which meshing utility could be easily used for this? Any help would be welcome.

Cristina
Attached Files
File Type: zip geometry.zip (7.3 KB, 8 views)
crizpi21 is offline   Reply With Quote

Old   July 5, 2018, 09:38
Default
  #2
Member
 
Cristina Hernandez
Join Date: May 2018
Posts: 35
Rep Power: 7
crizpi21 is on a distinguished road
Quote:
Originally Posted by crizpi21 View Post
Hi,

I want to use OpenFOAM to simulate the flow around a cube with rounded edges and calculate de drag coefficient. An example of the geometry is attached as a .stl file.

I am trying to create a quadrangular structured mesh for the whole domain, with a finer mesh around the cube to accurately model the pressure (ideally, the size of the cells around the cube should be 1/20 the characteristic length and get bigger as we move away from it).

Do you have any suggestions on which meshing utility could be easily used for this? Any help would be welcome.

Cristina
This is an example of how I would like the mesh to look like
Attached Images
File Type: jpg mesh.jpg (173.3 KB, 30 views)
crizpi21 is offline   Reply With Quote

Old   July 5, 2018, 10:38
Default
  #3
Member
 
Cristina Hernandez
Join Date: May 2018
Posts: 35
Rep Power: 7
crizpi21 is on a distinguished road
So far, I have explored the following:

First I tried gmsh, but I could only obtain a triangular unstructured mesh (Transfinite Volume didn't work).

Then, I changed to cfmesh OpenFOAM utility. I imported my geometry generated from gmesh, extracted the surface as a .stl file and generated the mesh with cfmesh command "cartesianMesh". To obtain the mesh I want, I have tried different strategies (I am posting my meshDict):

1) anisotropicSources: defining a box that contains my cube

maxCellSize 1;
x_cube 1.5; y_cube 1.5; z_cube 1.5;

anisotropicSources
{
box
{
type box;
centre (20.75 17.5 7.5); //centre of cube

lengthX 5*$x_cube; //5 times characteristic length
lengthY 5*$y_cube; //5 times characteristic length
lengthZ 5*$z_cube; //5 times characteristic length

//scaling factors in each direction
scaleX 0.05*$x_cube;
scaleY 0.05*$y_cube;
scaleZ 0.05*$z_cube;
}
}

But I do not know how to change the size of the cells within the box, so that there is a gradient and cells become bigger as I move away from the cube.

2. boundaryLayer: treat the cube wall as a boundary layer and use local refinement to set the number of cells in the first layer

maxCellSize 1;
x_cube 1.5; y_cube 1.5; z_cube 1.5;

localRefinement
{
cube
{
cellSize 0.05*$x_cube; //characteristic length/20
}
boundaryLayers
{
//global number of boundaryLayers, set to 0 so that the rest of the boundaries (walls of the domain) are not meshed
nLayers 0;
//local settings for individual patches (cube)
patchBoundaryLayers
{
boundaryCellSize 0.1;
"cube"
{
nLayers 5;
thicknessRatio 1;
maxFirstLayerThickness 1; //characteristic length of cube/20
allowDiscontinuity 0;
}
}
}


What I would like to obtain is a refined mesh around a region at a distance equal to 5 times the characteristic length from the cube.

Could anyone help me obtain this adjusting my setting in meshDict for cfmesh? I am also open to other alternatives.
I can provide you any file you need.

Thanks in advance,

Cristina
crizpi21 is offline   Reply With Quote

Old   July 17, 2018, 14:12
Default
  #4
Member
 
Luis Eduardo
Join Date: Jan 2011
Posts: 85
Rep Power: 15
lebc is on a distinguished road
Hi Cristina,

Have you tried blockMesh and/or snappyHexMesh?

The round edges will be a little difficult to treat, but it is possible to do it (I didn't open your geometry file to check it).
lebc 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] Error defining boundary layer around cube snappyHexMesh crizpi21 OpenFOAM Meshing & Mesh Conversion 5 October 16, 2021 10:56
[ANSYS Meshing] Structured Mesh inside an egg-like geometry BrunoCFD ANSYS Meshing & Geometry 1 October 31, 2018 14:48
Gambit problems Althea FLUENT 22 January 4, 2017 03:19
[Gmsh] 2D Mesh Generation Tutorial for GMSH aeroslacker OpenFOAM Meshing & Mesh Conversion 12 January 19, 2012 03:52
unstructured vs. structured grids Frank Muldoon Main CFD Forum 1 January 5, 1999 10:09


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