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

[mesh manipulation] stitchMesh: multiple meshes

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes
  • 7 Post By GerhardHolzinger

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 30, 2014, 13:07
Default stitchMesh: multiple meshes
  #1
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
This is more of a how-to than a question but I want to share the thing I learned today.

In the attached image you see a large cylinder which is joined by four smaller cylinders, like four pipes joining a large tank.

I created the mesh with blockMesh and after the blockMesh run I have 5 unconnected mesh regions. Thus I have to use stitchMesh to join these five meshes.

I do not want to let blockMesh join the pipes with the tank (mergePatchPairs) because I want to apply some mesh modification on the mesh of the large cylinder only.

The small elliptical surfaces at the near end of the pipes are named intersectSlaveN (N is the running index. In this case 0, 1, 2 or 3). The patches on the large cylinder (two of them are not shown and two of them are displayed as wire frame) are named intersectMasterN.

When I use
Code:
stitchMesh intersectMaster0 intersectSlave0
to merge the first pair, everthing works as expected.

When I call
Code:
stitchMesh intersectMaster1 intersectSlave1
to merge the second pair, stitchMesh aborts the operation with this error message

Code:
--> FOAM FATAL ERROR: 
Master or slave face zone contain no faces.  Please check your mesh definition.

    From function void slidingInterface::checkDefinition()
    in file slidingInterface/slidingInterface.C at line 97.

FOAM aborting
An old post [http://www.cfd-online.com/Forums/ope...tml#post183551] in this forum brought me to the solution of my problem.

After the operation on the large cylinder's mesh, the mesh was written to the 0.001 directory. stitchMesh, however, read the mesh at time 0. In fact, stitchMesh reads the mesh from the time that is stated in controlDict at startTime.

So, I had to change the entry at startTime in controlDict. This made stitchMesh read the mesh from the 0.001 folder. However, the second call of stitchMesh again resulted in the above-posted error message.

The solution to this problem was to delete the file meshModifiers in the 0.001/polyMesh directory. Then it worked.

So, my workflow for stitching my mesh was as follows
  1. Set startTime to the latest time step
  2. call stitchMesh
  3. delete meshModifiers from the polyMesh folder in the latest time step
  4. Repeat 1-3 until finshed
Attached Images
File Type: jpg joiningPipes.jpg (21.2 KB, 224 views)
vatavuk, cutter, Mojtaba.a and 4 others like this.
GerhardHolzinger is offline   Reply With Quote

Old   January 30, 2014, 13:43
Default Addendum: createPatch
  #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
As nobody wants to specify boundary conditions for several wall-patches (in my case the intersectMaster patches and the walls patch that contains all wall patches not involved in any stitching) createPatch can be used to join all wall patches to a single wall patch.

With createPatch I join all intersectMasterN and walls to a new patch named WALL. So I only need one entry in the files of the 0 directory for the boundary condition on the wall.

In my case this createPatchDict does the trick. Again, the parameter startTime in controlDict has to be set to the latest time step.

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.2                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      createPatchDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

pointSync false;

// Patches to create.
patches
(
    {
        // Name of new patch
        name WALL;

        // Dictionary to construct new patch from
        patchInfo
        {
            type wall;
        }

        // How to construct: either from 'patches' or 'set'
        constructFrom patches;

        // If constructFrom = patches : names of patches. Wildcards allowed.
        patches (walls intersectMaster0 intersectMaster1 intersectMaster2 intersectMaster3);
    }
);
GerhardHolzinger is offline   Reply With Quote

Old   August 25, 2017, 10:59
Smile Thank you for your advice!
  #3
New Member
 
Xiao Han
Join Date: Aug 2017
Posts: 1
Rep Power: 0
Xiao Han is on a distinguished road
I have been stuck by this single problem for almost a whole week, and finally I found your thread and solved this problem!

Thank you very much!!
Xiao Han is offline   Reply With Quote

Old   August 25, 2017, 12:43
Default
  #4
Senior Member
 
sandy
Join Date: Feb 2016
Location: .
Posts: 117
Rep Power: 10
saddy is on a distinguished road
Quote:
Originally Posted by [URL="https://www.cfd-online.com/Forums/members/gerhardholzinger.html"
GerhardHolzinger[/URL]I

Thank you very much!!
well that's one hell of a job done by Mr Holzinger. really nice to see!!
plz upload your case files, so that we all can benefit using it as a tutorial. if u don't mind
saddy is offline   Reply With Quote

Reply

Tags
stitchmesh


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
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 06:09
[mesh manipulation] Multiple overlapping meshes koala OpenFOAM Meshing & Mesh Conversion 1 February 1, 2017 05:53
[mesh manipulation] Problem with stitchMesh: it does not work in meshes with several common patches arnau1985 OpenFOAM Meshing & Mesh Conversion 2 June 25, 2013 08:49
[Other] Importing Multiple Meshes Spookz ANSYS Meshing & Geometry 3 December 17, 2012 06:47
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 12:21


All times are GMT -4. The time now is 16:51.