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

Creating circular inlet on a square face

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes
  • 2 Post By me12p1006
  • 1 Post By Peruni
  • 3 Post By JoshWilliams1996

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 25, 2018, 07:56
Default Creating circular inlet on a square face
  #1
New Member
 
Join Date: Feb 2013
Posts: 24
Rep Power: 13
me12p1006 is on a distinguished road
Hi,

I would like to create 1cm circular air inlet on 4cm by 4cm square face that is treated as a wall.

I would like to use patching in openFoam. Can anyone help me with this.
me12p1006 is offline   Reply With Quote

Old   January 26, 2018, 19:22
Default
  #2
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
I've selected cells within a cylinder using cylinderToCells in conjunction with topoSet before. It looks like topoSet also has a cellToFace option -- please see this link https://github.com/OpenFOAM/OpenFOAM...em/topoSetDict. Combining these should give you what you're looking for.

Caelan
clapointe is offline   Reply With Quote

Old   January 27, 2018, 01:27
Default
  #3
New Member
 
Join Date: Feb 2013
Posts: 24
Rep Power: 13
me12p1006 is on a distinguished road
Quote:
Originally Posted by clapointe View Post
I've selected cells within a cylinder using cylinderToCells in conjunction with topoSet before. It looks like topoSet also has a cellToFace option -- please see this link https://github.com/OpenFOAM/OpenFOAM...em/topoSetDict. Combining these should give you what you're looking for.

Caelan
Thanks for your reply. I tried using it. But i couldn't get flow through the inlet when I gave velocity inlet boundary condition. Here are the files of my toposet and createpatchdict.

Toposet:
actions
(
{
name z;
type cellSet;
action new;
source boxToCell;
sourceInfo
{
box (-100 -100 -0.2)(100 100 100);
}
}

{
name bubble;
type faceSet;
action new;
source cellToFace;
sourceInfo
{
set z;
option all;
}
}

{
name z;
type cellSet;
action invert;
}

{
name bubble;
type faceSet;
action subset;
source cellToFace;
sourceInfo
{
set z;
option all;
}
}

Createpatchdict:

patches
(
{
//- name of new patch
name inlet;

//- type of new patch
patchInfo
{
type patch;
}
//- How to construct: either from 'patches' or 'set'
constructFrom set;
//- if constructionFrom = set : name of faceSet
set bubble;
}
);

I the boundary conditions file I used "inlet" as the name and then i defined my boundary conditions.

I ran the following commands and i couldnt find any error. But, I couldnt get flow through the inlet.

blockMesh
topoSet
createPatch -overWrite
setFields
interFoam
frantov and Kummi like this.
me12p1006 is offline   Reply With Quote

Old   January 29, 2018, 17:43
Default
  #4
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
Starting with a square inlet might be a good first step -- this can be done using topoSet's boxToFace and then createPatch. Check out this fireFoam tutorial : https://github.com/OpenFOAM/OpenFOAM...mallPoolFire3D.

Caelan
clapointe is offline   Reply With Quote

Old   January 30, 2018, 00:06
Default
  #5
New Member
 
Yuncheng Xu (Cloud)
Join Date: May 2011
Location: State College, PA
Posts: 20
Rep Power: 14
luther1990 is on a distinguished road
Well, if you want some perfect circular mesh instead of zigzag mesh, you might want to use snappyHexMesh. You need to split the stl file into two parts.
luther1990 is offline   Reply With Quote

Old   January 30, 2018, 08:34
Default
  #6
New Member
 
Join Date: Feb 2013
Posts: 24
Rep Power: 13
me12p1006 is on a distinguished road
Quote:
Originally Posted by clapointe View Post
Starting with a square inlet might be a good first step -- this can be done using topoSet's boxToFace and then createPatch. Check out this fireFoam tutorial : https://github.com/OpenFOAM/OpenFOAM...mallPoolFire3D.

Caelan
Thanks. I could able to create square inlet using toposets boxtoface and createpatch. But how can I do for circular inlet.
me12p1006 is offline   Reply With Quote

Old   January 31, 2018, 01:24
Default
  #7
New Member
 
Yuncheng Xu (Cloud)
Join Date: May 2011
Location: State College, PA
Posts: 20
Rep Power: 14
luther1990 is on a distinguished road
Quote:
Originally Posted by me12p1006 View Post
Thanks. I could able to create square inlet using toposets boxtoface and createpatch. But how can I do for circular inlet.
Please refer to
Code:
tutorials/incompressible/simpleFoam/rotorDisk/system/snappyHexMeshDict
  1. You can create a surface mesh like stl and obj using a thirty-party tool like Blender. The shape of the surface mesh can be a plane.
  2. Split the surface mesh into two parts, with a circular part in the middle.
  3. Use similar snappyHexMeshDict in rotorDisk case to create the circular inlet boundary and the surrounding wall boundary.
  4. Besides, you must use surfaceFeatureExtractDict to keep the circular features.

Remeber, you only need to use the plane to cut the domain and generate the inlet boundary.
luther1990 is offline   Reply With Quote

Old   April 18, 2018, 13:56
Default
  #8
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
Hi All,

I've recently revisited this problem. You can create the inlet by first creating a cylindrical faceZoneSet then converting it to a faceSet. If you start with hex cells this will preserve your hex cells while getting you a mostly circular inlet. The inlet will get more and more circular as your mesh resolution increases.

Caelan
clapointe is offline   Reply With Quote

Old   May 14, 2019, 18:34
Default
  #9
New Member
 
Join Date: Apr 2019
Posts: 2
Rep Power: 0
Peruni is on a distinguished road
Hi, If someone is still struggling with this problem what you need to do in order to obtain circular patch is:
1). create cellset using cylinderToCell option
2) create faceSet based on coolingSet
3) use faceSet action - subset - source - boxtoFace to choose only external faces of cells.




Hope it helped.
Makkus likes this.
Peruni is offline   Reply With Quote

Old   May 15, 2019, 07:07
Default
  #10
New Member
 
Josh Williams
Join Date: Jun 2018
Location: Scotland
Posts: 8
Rep Power: 7
JoshWilliams1996 is on a distinguished road
If you have your blockMesh you should be able to take a slice from the wall and change it into another patch, the new inlet, using topoSet and createPatch. I realise you have done this above so I have attached some code I used if this helps. Maybe the problem is where you use setFields, everything else sounds fine.

I would use topoSet to define a cylinder that overlaps the cells you want to become your inlet, then you get all faces in this cellSet. From here you can find the faces in your newly defined faceSet which intersect with your wall patch. Finally you remove the initial cellSet to keep things tidy.

Code:
    {
        name    i1;
        type    cellSet;
        action  new;
        source cylinderToCell;
        sourceInfo
	{
       	    p1       (0.0165 -0.1375 -0.229); // start point on cylinder axis
       	    p2       (0.0130 -0.1365 -0.2330);   // end point on cylinder axis
       	    radius   5.0;
    	}
    }

    // Get all faces in cellSet
    {
        name    inlet1;
        type    faceSet;
        action  new;
        source  cellToFace;
        sourceInfo
        {
            set     i1;
            option  all;
        }
    }
    {
        name inlet1;
        type faceSet;
        action subset;
        source patchToFace;
        sourceInfo
        {
            name "walls";
        }
    }

    {
        name i1;
        type cellSet;
        action remove;
    }
Then you can use the createPatch function if you have a createPatchDict to declare your inlet from the set you just created above, like so

Code:
{
        // Name of new patch
        name inlet;

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

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

        // If constructFrom = set : name of faceSet
        set inlet1;
    }
frantov, dkaddar and Nik P. like this.
JoshWilliams1996 is offline   Reply With Quote

Old   February 5, 2021, 16:35
Default
  #11
Member
 
James
Join Date: Jan 2014
Posts: 38
Rep Power: 12
Madeinspace is on a distinguished road
Hi Josh,


I had been following this method and also followed the instruction your provided but I just can't seem to get it right. It does create a new circular patch but it doesn't contain all the cells within that radius as shown in the picture attached. Several cells are missing within the new patch. Would you have idea why is that?


my topoSetDict


Code:
actions
(
    {
        name    jetCells;
        type    cellSet;
        action  new;
      source cylinderToCell;
        sourceInfo
        {
            p1 (0.05    0.015    0);   // start point on cylinder axis//
            p2 (0.05    0.0148   0);   // end point on cylinder axis//
            radius 0.009;
        }
    }


{
        name    f0;
        type    faceSet;
        action  new;
        source  cellToFace;
        sourceInfo
        {
            set     jetCells;
            option  all;
        }
    }


{
        name    f0;
        type    faceSet;
        action  subset;
          source patchToFace;
     sourceInfo
     {
    name "topAtmosphere";
     }
}

    {
        name jetCells;
        type cellSet;
        action remove;
    }


);
my createPatchDict
Code:
pointSync true;

// Patches to create.
patches
(
    {
        name shieldGasInlet;

        // Type of new patch
        patchInfo
        {
            type patch;
        }

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

        //constructFrom patches;

        // If constructFrom = patches : names of patches. Wildcards allowed.
        //patches ("periodic.*");

        // If constructFrom = set : name of faceSet
           set f0;
    }
);
Attached Images
File Type: jpg circularPatch.jpg (187.5 KB, 82 views)
Madeinspace 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
creating square patch (for air inlet) on the bottom face using cellset in toposet Rajesh Nimmagadda OpenFOAM Running, Solving & CFD 0 October 31, 2017 12:27
[ICEM] Circular Tangential Inlet Mesh Distorted amirkh ANSYS Meshing & Geometry 4 September 9, 2016 18:32
[snappyHexMesh] How to define to right point for locationInMesh Mirage12 OpenFOAM Meshing & Mesh Conversion 7 March 13, 2016 14:07
flow around a circular cylinder with velocity inlet and outflow outlet shuoxue OpenFOAM Running, Solving & CFD 0 November 2, 2013 04:32
Gambit error creating face Haridas Attur Main CFD Forum 1 February 17, 2009 03:31


All times are GMT -4. The time now is 13:55.