CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

blockMesh - two blocks with different vertices

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By Antimony

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 7, 2017, 11:03
Default blockMesh - two blocks with different vertices
  #1
Member
 
Ruggiero Guida
Join Date: Apr 2013
Location: World
Posts: 46
Rep Power: 13
Rojj is on a distinguished road
Hello

Is it possible to create a Mesh made by two blocks with different vertices and then use snappyHexMesh?

I have created the following mesh
Code:
// -*- C++ -*-
// File generated by PyFoam - sorry for the ugliness

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

convertToMeters 1;

vertices
  (
    (-595.82 -620.459 -5)
    (670.098 -620.459 -5)
    (670.098 645.459 -5)
    (-595.82 645.459 -5)

    (-595.82 -620.459 100)
    (670.098 -620.459 100)
    (670.098 645.459 100)
    (-595.82 645.459 100)

    (-595.82 -620.459 100)
    (670.098 -620.459 100)
    (670.098 645.459 100)
    (-595.82 645.459 100)

    (-595.82 -620.459 520)
    (670.098 -620.459 520)
    (670.098 645.459 520)
    (-595.82 645.459 520)
  );

  blocks
    (
      hex (0 1 2 3 4 5 6 7) (158 158 10) simpleGrading (1 1 1)
      hex (8 9 10 11 12 13 14 15) (79 69 28) simpleGrading (1 1 1)
    );

  edges
    (
    );

  boundary
    (
      sides
      {
        type patch;
        faces (
                (0 4 7 3)
                (8 12 15 11)
                (6 5 1 2)
                (14 13 9 10)
              );
      }

      inlet
      {
        type patch;
        faces (
                (3 7 6 2)
                (11 15 14 10)
              );
      }

      outlet
      {
        type patch;
        faces (
                (5 4 0 1)
                (13 12 8 9)
              );
      }

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

      internalBottom
      {
        type patch;
        faces (
                (4 5 6 7)
              );
      }

      internalTop
      {
        type patch;
        faces (
                (8 11 10 9)
              );
      }

      sky
      {
        type patch;
        faces (
                (12 13 14 15)
              );
      }


    );

    mergePatchPairs (
      ( internalTop internalBottom ) );

but when I mesh with snappyHexMesh I receive the following error

Code:
Selected for refinement : 44456 cells (out of 404984)
hexRef8 : Dumping cell as obj to "/home/ubuntu/OpenFOAM/ubuntu-4.1/run/test02_base_Baseline/mesh/cell_251301.obj"


--> FOAM FATAL ERROR:
cell 251301 of level 0 uses more than 8 points of equal or lower level
Points so far:8(254492 254493 254572 254573 260092 260093 260172 260173)

    From function Foam::labelListList Foam::hexRef8::setRefinement(const labelList&, Foam::polyTopoChange&)
    in file polyTopoChange/polyTopoChange/hexRef8/hexRef8.C at line 3701.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::hexRef8::setRefinement(Foam::List<int> const&, Foam::polyTopoChange&) at ??:?
#3  Foam::meshRefinement::refine(Foam::List<int> const&) at ??:?
#4  Foam::meshRefinement::refineAndBalance(Foam::string const&, Foam::decompositionMethod&, Foam::fvMeshDistribute&, Foam::List<int> const&, double) at ??:?
#5  Foam::snappyRefineDriver::surfaceOnlyRefine(Foam::refinementParameters const&, int) at ??:?
#6  Foam::snappyRefineDriver::doRefine(Foam::dictionary const&, Foam::refinementParameters const&, Foam::snapParameters const&, bool, Foam::dictionary const&) at ??:?
#7  ? at ??:?
#8  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#9  ? at ??:?
Aborted (core dumped)
Cell 251301 is located at the interface internalTop/internalBottom.

I have tried to change slave and master, but the problem just happens in a different cell.

this picture shows the mesh and this one shows the cell
Rojj is offline   Reply With Quote

Old   October 8, 2017, 23:42
Default
  #2
Senior Member
 
Join Date: Aug 2013
Posts: 407
Rep Power: 16
Antimony is on a distinguished road
Hi,

Nope. To the best of my knowledge, with snappyHexMesh you cannot do that. While blockMesh might merge the two meshes that you created, the resultant mesh is no longer purely hexahedral, which is a requirement to be able to run snappyHexMesh.

Instead you can do the following (assuming your geometry that you want to run your snappy on is less than the height of your first block):

1. Have a case and in that run blockMesh with only the first block
2. For the case from step 1, run snappyHexMesh
3. Have a separate case and in that run blockMesh with only the second block
4. Merge the two cases together using mergeMesh
5. Use either stitchMesh or cyclicAMI to take care of the overlapping patches.

Hope this helps.

Cheers,
Antimony
Rojj and farzadmech like this.
Antimony is offline   Reply With Quote

Old   October 13, 2017, 05:54
Default
  #3
Member
 
Ruggiero Guida
Join Date: Apr 2013
Location: World
Posts: 46
Rep Power: 13
Rojj is on a distinguished road
Thanks Antimony. That certainly clarifies the issue.

Your proposed solution is interesting. As I am running everything programmatically, it might be relatively simple to implement.

I am now testing the cyclicAMI. I would like to better understand how it works (I will probably need it in the near future) and see if I can avoid the two step meshing.

Will report back.
Rojj is offline   Reply With Quote

Old   March 21, 2023, 21:39
Default
  #4
Senior Member
 
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8
farzadmech is on a distinguished road
Dear Antimony,
Thanks a lot for your suggestion. I am going to use it for my case to avoid huge cell numbers. I already posted my problem, I will be happy if you look at it.

Thanks,
Farzad

Quote:
Originally Posted by Antimony View Post
Hi,

Nope. To the best of my knowledge, with snappyHexMesh you cannot do that. While blockMesh might merge the two meshes that you created, the resultant mesh is no longer purely hexahedral, which is a requirement to be able to run snappyHexMesh.

Instead you can do the following (assuming your geometry that you want to run your snappy on is less than the height of your first block):

1. Have a case and in that run blockMesh with only the first block
2. For the case from step 1, run snappyHexMesh
3. Have a separate case and in that run blockMesh with only the second block
4. Merge the two cases together using mergeMesh
5. Use either stitchMesh or cyclicAMI to take care of the overlapping patches.

Hope this helps.

Cheers,
Antimony
farzadmech is offline   Reply With Quote

Reply

Tags
blockmesh, snappyhexmesh


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] COnvert FLuent MEsh to openfoam with interface manuc OpenFOAM Meshing & Mesh Conversion 1 July 25, 2017 04:13
[Commercial meshers] converting Fluent mesh to openfoam standard mesh deepesh OpenFOAM Meshing & Mesh Conversion 31 March 29, 2017 06:59
dsmcInitialise - dsmcFoam archymedes OpenFOAM Pre-Processing 94 July 15, 2016 17:14
[blockMesh] blockMesh - numbering of vertices with multiple blocks AmRo OpenFOAM Meshing & Mesh Conversion 6 May 16, 2016 06:05
[blockMesh] blockMesh problem with blocks with vertices adrieno OpenFOAM Meshing & Mesh Conversion 3 March 23, 2016 04:35


All times are GMT -4. The time now is 20:37.