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

[blockMesh] Unable to change mesh density in blocks

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 17, 2019, 23:07
Default Unable to change mesh density in blocks
  #1
New Member
 
Joseph Tipton
Join Date: Jun 2010
Posts: 27
Rep Power: 15
jtipton2 is on a distinguished road
I'm attaching a simplified mesh code that utilizes 5 block regions. Each block starts with a very simple mesh density of (1 1 1).

My goal is to change the x-direction mesh density. Let's take the middle block "BLOCK III". I can change the mesh density to (10 1 1) and the the blockMesh command works without a problem.

Now let's say I want to change the mesh density in both "BLOCK 0" and "BLOCK IV" to (20 1 1). Now I get an error message that says:

Code:
--> FOAM FATAL ERROR:
Inconsistent number of faces between block pair 0 and 4

    From function void Foam::blockMesh::calcMergeInfo()
    in file blockMesh/blockMeshMerge.C at line 221.
I don't understand why this is a problem since the blocks have the exact same x-dimensions. Can anyone help explain the problem? My code is below.

Many thanks,

~ Joseph



Code:
FoamFile 
{
    version    2.0;
    format     ascii;
    class      dictionary;
    object     blockMeshDict;
}

scale   0.001;

vertices
(
    (0 0 0)
    (100 0 0)
    (100 5 0)
    (105 5 0)
    (105 0 0)
    (205 0 0)
    (205 5 0)
    (205 50 0)
    (105 50 0)
    (100 50 0)
    (0 50 0)
    (0 5 0)

    (0 0 7)
    (100 0 7)
    (100 5 7)
    (105 5 7)
    (105 0 7)
    (205 0 7)
    (205 5 7)
    (205 50 7)
    (105 50 7)
    (100 50 7)
    (0 50 7)
    (0 5 7)
);

blocks
(
    // BLOCK 0
    hex (0 1 2 11 12 13 14 23)
    (1 1 1)
    simpleGrading (1 1 1)

    // BLOCK 1
    hex (3 4 5 6 15 16 17 18)
    (1 1 1)
    simpleGrading (1 1 1)

    // BLOCK 2
    hex (3 6 7 8 15 18 19 20)
    (1 1 1)
    simpleGrading (1 1 1)

    // BLOCK 3
    hex (2 3 8 9 14 15 20 21)
    (1 1 1)
    simpleGrading (1 1 1)

    // BLOCK 4
    hex (2 9 10 11 14 21 22 23)
    (1 1 1)
    simpleGrading (1 1 1)

);

edges
(
);

boundary
(
    inlet
    {
        type patch;
        faces
        (
            (10 11 23 22)
            (11 0 12 23)
        );
    }

    outlet
    {
        type patch;
        faces
        (
            (6 7 19 18)
            (5 6 18 17)
        );
    }

    upperWall
    {
        type wall;
        faces
        (
            (7 8 20 19)
            (8 9 21 20)
            (9 10 22 21)
        );
    }

    lowerWall
    {
        type wall;
        faces
        (
            (0 1 13 12)
            (1 2 14 13)
            (2 3 15 14)
            (3 4 16 15)
            (4 5 17 16)
        );
    }

    front
    {
        type empty;
        faces
        (
            (13 14 23 12)
            (14 21 22 23)
            (14 15 20 21)
            (15 18 19 20)
            (15 16 17 18)
        );
    }

    back
    {
        type empty;
        faces
        (
            (11 2 1 0)
            (3 6 5 4)
            (8 7 6 3)
            (9 8 3 2)
            (10 9 2 11)
        );
    }

);

mergePatchPairs
(

);

asfdasdf
jtipton2 is offline   Reply With Quote

Old   July 18, 2019, 04:25
Default
  #2
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 339
Rep Power: 28
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
You can not mesh two connected blocks with different mesh density.

In the image attached, you see two blocks, with a green and a red mesh. The face the two blocks are connected, the grid lines don't match. This is why OpenFOAM aborts with an error.

You have two options
  • Use matching mesh densities
  • Don't connect the blocks; create the mesh; connect the meshes using AMI
Attached Images
File Type: png inconsistentNumberOfFaces.png (1.3 KB, 2 views)
GerhardHolzinger is offline   Reply With Quote

Old   July 18, 2019, 09:58
Default
  #3
New Member
 
Joseph Tipton
Join Date: Jun 2010
Posts: 27
Rep Power: 15
jtipton2 is on a distinguished road
Gerhard,

Thanks so much for the reply. The thumbnail you showed does not match what I am trying to do. I am not changing the y-direction mesh density. BLOCK 0 and BLOCK IV are on the left of my domain and on top of each other.

Code:
|--------------|---|----------------|
|   Block IV   |III|     Block II   |
|              |   |                |
|--------------|---|----------------|
|   Block 0    |   |     Block I    |
|--------------|   |----------------|

I am just trying to change the x-direction mesh density, e.g.

Code:
    // BLOCK 0
    hex (0 1 2 11 12 13 14 23)
    (10 1 1)
    simpleGrading (1 1 1)  

    // BLOCK 4
    hex (2 9 10 11 14 21 22 23)
    (10 1 1)
    simpleGrading (1 1 1)

I feel like this is too simple of a problem to be a bug in the software but I cannot understand why this is not possible.

Thanks so much for your help! ~ Joseph
jtipton2 is offline   Reply With Quote

Old   July 19, 2019, 05:17
Default
  #4
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 339
Rep Power: 28
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
Your local coordinates are messed up.

Code:
blocks
(
    // BLOCK 0
    hex (0 1 2 11 12 13 14 23)
    (1 1 1)
    simpleGrading (1 1 1)

    // BLOCK 4
    hex (2 9 10 11 14 21 22 23)
    (1 1 1)
    simpleGrading (1 1 1)
);
While the local x-direction of block 0 coincides with the global x-direction, the local x-direction of block 4 doesn't.
Attached Images
File Type: png blocks.png (28.8 KB, 6 views)
GerhardHolzinger is offline   Reply With Quote

Old   July 19, 2019, 09:28
Default
  #5
New Member
 
Joseph Tipton
Join Date: Jun 2010
Posts: 27
Rep Power: 15
jtipton2 is on a distinguished road
Gerhard,

Thanks so much for helping me isolate my error. I knew that blocks had to be defined in a CCW manner but did not realize the first vertex sets the origin.

Best,

~ Joseph
jtipton2 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
[Commercial meshers] converting Fluent mesh to openfoam standard mesh deepesh OpenFOAM Meshing & Mesh Conversion 31 March 29, 2017 05:59
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
[ICEM] Using mesh Density Daniel_Khazaei ANSYS Meshing & Geometry 0 May 2, 2014 18:00
[ICEM] Generating Mesh for STL Car in Windtunnel Simulation tommymoose ANSYS Meshing & Geometry 48 April 15, 2013 04:24
Mesh sensitivity when using phase change models BKaus STAR-CCM+ 0 February 28, 2012 20:51


All times are GMT -4. The time now is 19:21.