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/)
-   -   [blockMesh] Very Basic Meshing Query (https://www.cfd-online.com/Forums/openfoam-meshing/244311-very-basic-meshing-query.html)

CHUMMAR August 2, 2022 02:10

Very Basic Meshing Query
 
Hi ,
I have made a blockMeshDict file consisitng of a cube with 10 meter length, breadth and height. I have written a line like this : hex (0 1 2 3 4 5 6 7) (20 20 20) simpleGrading (1 1 1);
Is there any way of increasing the cell count. My total cell count now is 20*20*20 = 8000.
Is there any way of increasing it to a much larger number like, for example : hex (0 1 2 3 4 5 6 7) (1000 1000 1000) simpleGrading (1 1 1);
I tried editing like this but it wont run.

blockMeshDict file :
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 10
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
(0 0 0)
(10 0 0)
(10 10 0)
(0 10 0)
(0 0 10)
(10 0 10)
(10 10 10)
(0 10 10)
);

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

boundary
(
hotwall
{
type wall;
faces
(
(0 4 7 3)
);
}

coldwall
{
type wall;
faces
(
(2 6 5 1)
);
}

bottom
{
type wall;
faces
(
(1 5 4 0)
);
}

top
{
type wall;
faces
(
(3 7 6 2)
);
}

front
{
type wall;
faces
(
(6 7 4 5)
);
}

back
{
type wall;
faces
(
(0 3 2 1)
);
}

);


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

After running blockMesh and then checkMesh

*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 10
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
Build : 10-2c6a80318abb
Exec : checkMesh
Date : Aug 02 2022
Time : 11:38:08
Host : "amalchummar-GL553VE"
PID : 12623
I/O : uncollated
Case : /home/amalchummar/OpenFOAM/amalchummar-10/run/Turbcube
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create polyMesh for time = 0

Time = 0s

Mesh stats
points: 9261
faces: 25200
internal faces: 22800
cells: 8000
faces per cell: 6
boundary patches: 6
point zones: 0
face zones: 0
cell zones: 0

Overall number of cells of each type:
hexahedra: 8000
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 0
polyhedra: 0

Checking topology...
Boundary definition OK.
Cell to face addressing OK.
Point usage OK.
Upper triangular ordering OK.
Face vertices OK.
Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces...
Patch Faces Points Surface topology
hotwall 400 441 ok (non-closed singly connected)
coldwall 400 441 ok (non-closed singly connected)
bottom 400 441 ok (non-closed singly connected)
top 400 441 ok (non-closed singly connected)
front 400 441 ok (non-closed singly connected)
back 400 441 ok (non-closed singly connected)

Checking geometry...
Overall domain bounding box (0 0 0) (10 10 10)
Mesh has 3 geometric (non-empty/wedge) directions (1 1 1)
Mesh has 3 solution (non-empty) directions (1 1 1)
Boundary openness (0 0 0) OK.
Max cell openness = 0 OK.
Max aspect ratio = 1 OK.
Minimum face area = 0.25. Maximum face area = 0.25. Face area magnitudes OK.
Min volume = 0.125. Max volume = 0.125. Total volume = 1000. Cell volumes OK.
Mesh non-orthogonality Max: 0 average: 0
Non-orthogonality check OK.
Face pyramids OK.
Max skewness = 0 OK.
Coupled point location match (average 0) OK.

Mesh OK.

End

Thank you so very much :)

Yann August 2, 2022 08:54

Hi Amal,

Yes you can increase the cell number in blockMeshDict but blockMesh generates mesh on a single core. Running this setup: hex (0 1 2 3 4 5 6 7) (1000 1000 1000) simpleGrading (1 1 1); means you are creating a 1 billion cells mesh on a single core:
  1. You need the appropriate amount of RAM to store such a big mesh. If you don't, blockMesh will just crash while trying to create the mesh
  2. Considering you have the appropriate amount of RAM, it's going to take ages to generate since blockMesh only run on a single core

As a workaround, you could create a coarse mesh with blockMesh and then use utilities such as refineMesh or refineHexMesh to refine your mesh in parallel.

Another way around would be to use volume refinement in snappyHexMesh.

Regards,
Yann

CHUMMAR August 2, 2022 19:15

Salome as Mesher
 
Thank you Yann,
I came across a tool called Salome to deal with the meshing. Is this easier than snappyHexMesh. Will using Salome be equally efficient as snappyHexMesh for meshing and then implement it somehow into the solving part :confused:

Yann August 4, 2022 03:37

Hi Amal,

Both have pros and cons. You can create your volume mesh in Salome and convert it to use in OpenFOAM but since I never used Salome myself I'm probably not the best person to advise you about it.

I would say it also depends on the geometry you need to mesh and the expectations you have regarding the mesh, for instance for boundary layer meshing (which is a bit annoying to deal with in snappyHexMesh)

Yann


All times are GMT -4. The time now is 06:27.