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

[blockMesh] Creating baffles in blockMesh

Register Blogs Community New Posts Updated Threads Search

Like Tree19Likes
  • 1 Post By Bishop_45
  • 18 Post By DenysW

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 10, 2017, 11:53
Default Creating baffles in blockMesh
  #1
New Member
 
Dario
Join Date: Dec 2016
Location: Croatia Rijeka
Posts: 1
Rep Power: 0
Bishop_45 is on a distinguished road
Hello, I'm new to OpenFoam and I'm trying to learn it for a project in my college curriculum.

I' having a problem defining an internal face of a block mesh as a baffle. Mesh is defined in a blockMeshDict. I'm trying to define an internal face in blockMeshDict, so I can run createBaffles utility which requires a name of a face in createBafflesDict.

I've tried defining an internal face as:
Code:
plate
    {
        type patch;
        faces
        (
            (5 6 14 13)
            (6 5 13 14)
        );
    }
in boundaries which produces a following error:
Code:
Trying to specify a boundary face 4(5 6 14 13) on the face on cell 2 which is either an internal face or already belongs to some other patch.  This is face 0 of patch 4 named plate.
Also I've tried defining it after defining the boundaries by the way of:
Code:
patches
(
    baffleLeft
    {
        type            baffle;
        neighbourPatch  right;
        faces           ((5 6 14 13));
    }
    right
    {
        type            baffle;
        neighbourPatch  left;
        faces           ((6 5 13 14));
    }
);
which produces the error:
Code:
--> FOAM FATAL IO ERROR: 
wrong token type - expected word, found on line 166 the punctuation token '{'
So I don't understand how to define that internal face because createBafflesDict requires a name under zoneName:
Code:
baffles
{
    baffleFaces
    {
        type        faceZone;
        zoneName    plate;
        flip        false;
    
        patches
        {
            master
            {
                name            plate;
                type            wall;
            }
            slave { ${..master} }
        }
    }
}
What am I doing wrong in blockMeshDict, or is there a better way to achieve this while using still blockMesh?
Thanks in advance.
vsb likes this.
Bishop_45 is offline   Reply With Quote

Old   January 23, 2017, 13:46
Default Not an easy one ...
  #2
New Member
 
Denys Wickens
Join Date: Jan 2017
Posts: 7
Rep Power: 9
DenysW is on a distinguished road
To get this to work you need to have the correct block-naming in blockMesh. This then creates the cellSets for the named blocks that topoSet can convert into faceZoneSets that createBaffles can use to make your baffles out of internal faces. Then edit all of the new patches in the new directory (with me it was 0.25) away from calculated to something sensible for your case and it'll run.

I actually learned all of this from CFD threads (so thanks to lots of people): my contribution is mostly in changing the formats so that they run in openFoam 4.1 where the original no longer would.

So in blockMesh, add a name to each block you want to have an internal face become a baffle (I couldn't see this in the manual). Two blocks will need naming per baffle.

hex (42 43 73 72 48 49 79 78) block27 ( 4 4 10) simpleGrading (1 1 1)

Run blockMesh to make sure you are error-free before you start. You will also need the blocks to have an internal face that is the size and shape in the correct location for a baffle. For me this meant re-doing the blocks to get in the extra internal boundaries.

In the required topSetDict file (in the system directory) have code such as the following. I've done this step-by-step because I'm also a beginner. A skilled practitioner could probably do this in half the statements.

{
name csBaffle0;
type cellSet;
action new;
source zoneToCell;
sourceInfo
{
name block27;
}
}
{
name csBaffle0_1;
type cellSet;
action new;
source zoneToCell;
sourceInfo
{
name block42;// Matching faces with block27 are to become a baffle.
}
}
// convert to faces
{
name fsBaffle0;
type faceSet;
action new;
source cellToFace;
sourceInfo
{
set csBaffle0;
option all;
}
}
// get the common subset
{
name fsBaffle0;
type faceSet;
action subset;
source cellToFace;
sourceInfo
{
set csBaffle0_1;
option all;
}
}
// convert to a Zone
{
name fzsBaffle0;
type faceZoneSet;
action new;
source setToFaceZone;
sourceInfo
{
faceSet fsBaffle0;
}
}
// end of baffle 0

In the createBafflesDict (in the system directory) have code such as:

internalFacesOnly true;

// Baffles to create.
baffles
{

aBaffle11
{
//- Use predefined faceZone to select faces and orientation.
type faceZone;
zoneName fzsBaffle0;

patches
{
master
{
//- Master side patch

name baf0_half0;
type wall;
neighbourPatch baf0_half1;
}
slave
{
//- Slave side patch

name baf0_half1;
type wall;
neighbourPatch baf0_half0;
}
}

}
}

Sequentially run blockMesh, checkMesh, topoSet, createBaffles and checkMesh from the terminal. If nothing crashes and you don't get error messages, edit the patch conditions for you new patches in the files in the new 0.25 directory created by createBaffles, rename your old 0 directory to 0.org, the new directory to 0, and run. It (eventually) did for me!
DenysW 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
[blockMesh] Wierd behaviour of blockMesh creating axis in wedge rcastilla OpenFOAM Meshing & Mesh Conversion 1 December 4, 2018 06:24
[Gmsh] Creating 2 baffles in geometry caja94 OpenFOAM Meshing & Mesh Conversion 1 October 7, 2018 04:05
[blockMesh] Segmentation Fault when creating block mesh topography (blockMesh) jbrydg01 OpenFOAM Meshing & Mesh Conversion 2 May 11, 2017 05:37
[blockMesh] Error while running blockMesh Harak OpenFOAM Meshing & Mesh Conversion 0 December 11, 2014 09:36
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) cfdonline2mohsen OpenFOAM 3 October 21, 2013 09:28


All times are GMT -4. The time now is 11:47.