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

Add / Remove faces from patch , create new

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree4Likes
  • 4 Post By djh2

Reply
 
LinkBack Thread Tools Display Modes
Old   April 7, 2014, 11:18
Default Add / Remove faces from patch , create new
  #1
New Member
 
David H.
Join Date: Oct 2013
Posts: 24
Rep Power: 5
djh2 is on a distinguished road
I have been trying to create a circular patch as an inlet to my domain, however it is important that I keep the grid structured with all hexes.

A workaround was to apply velocity by face, which did a good job at resolving a circle based on the X, Y, location of each face.

However, I'm going to need more complicated inlet boundaries than a constant prescribed inlet velocity.

One option I'd like to pursue is creating a patch from an existing patch, building from a base blockMesh of a simple 6 sided domain.

I have looked into autoPatch and might be able to modify it, however some of the code is beyond what I was able to understand working on it yesterday.

I was wondering if anyone had experience reassigning faces from one patch to another?

My plan is something similar to what I used for the velocity, access all faces on a patch (inlet base patch), and for all faces within a prescribed radius, create a new patch with these faces.

I'm concerned about the face numbering assignment, because I noticed several functions relating to this in the autoPatch source.

Many thanks in advance for your help
djh2 is offline   Reply With Quote

Old   April 8, 2014, 17:46
Default
  #2
New Member
 
David H.
Join Date: Oct 2013
Posts: 24
Rep Power: 5
djh2 is on a distinguished road
The best method I've found so far for this without code change is as follows:

Use topoSet to create a geometry and use the boolean operations with the patches to obtain the desired faceSet. Use this faceSet with createPatch to create a new patch from the set of faces. If the old patch is consumed, createPatch removes it for you.

1) Create a base blockMesh
2) Define a topoSetDict to create face sets for the patch in question
3) Define a createPatchDict to create a patch from the faceSet

This took an "inlet" patch, and created a "jet" and "bluff" patch. The leftover cutout "inlet" is the resulting co-flow inlet velocity. Now I can specify a standard boundary condition for each inlet: Jet and co-flow, as well as the bluff (wall). If you are following my posts, you can see I've had several stabs at this - but I think this is the best way to move forward for this case.

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

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions
(
    {
        name    inletFaces;
        type    faceSet;
        action  new;
        source  patchToFace;
        sourceInfo
        {
            name "inlet";
        }
    }

    {
        name    jetCells;
        type    cellSet;
        action  new;
        source  cylinderToCell;
        sourceInfo
        {
            p1      (0 0 0);
	    	p2      (0 0 1);
            radius  0.0018;
        }
    }

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

 	{
        name    bluffCells;
        type    cellSet;
        action  new;
        source  cylinderAnnulusToCell;
        sourceInfo
        {
            p1      (0 0 0);
            p2      (0 0 1);
            outerRadius  0.025; 
			innerRadius  0.0018;

        }
 	}

 	{
        name    bluffFaces;
        type    faceSet;
        action  new;
        source  cellToFace;
        sourceInfo
        {
            set     bluffCells;
            option  all;
        }
    }


 	{
        name    coFlowPatchFaces;
        type    faceSet;
        action  new;
        source  faceToFace;
        sourceInfo
        {
            set inletFaces;  		// Start with entire inlet face
        }
    }

 	{
        name    coFlowPatchFaces;
        type    faceSet;
        action  delete;
        source  faceToFace;
        sourceInfo
        {
			set bluffFaces;  		// Remove Bluff faces
        }
    }

	{
        name    coFlowPatchFaces;
        type    faceSet;
        action  delete;
        source  faceToFace;
        sourceInfo
        {
			set jetFaces; 			// Remove Jet faces
        }
    }

 	{
        name    bluffPatchFaces;
        type    faceSet;
        action  new;
        source  faceToFace;
        sourceInfo
        {
            set inletFaces; 		// Start with entire inlet face
        }
    }

 	{
        name    bluffPatchFaces;
        type    faceSet;
        action  delete;
        source  faceToFace;
        sourceInfo
        {
			set coFlowPatchFaces;  // Remove Bluff faces
        }
    }

 	{
        name    bluffPatchFaces;
        type    faceSet;
        action  delete;
        source  faceToFace;
        sourceInfo
        {
			set jetFaces;  			// Remove Jet Faces
        }
    }

 	{
        name    jetPatchFaces;
        type    faceSet;
        action  new;
        source  faceToFace;
        sourceInfo
        {
            set inletFaces;  		// Start with entire inlet face
        }
    }

 	{
        name    jetPatchFaces;
        type    faceSet;
        action  delete;
        source  faceToFace;
        sourceInfo
        {
			set coFlowPatchFaces; 	// Remove coflow faces
        }
    }

 	{
        name    jetPatchFaces;
        type    faceSet;
        action  delete;
        source  faceToFace;
        sourceInfo
        {
			set bluffFaces;  		// Remove bluff faces
        }
    }

);

// ************************************************************************* //
An example of my createPatchDict
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.0                                 |
|   \\  /    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 jet;

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

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

        // If constructFrom = set : name of faceSet
        set jetPatchFaces;
    }

 {
        // Name of new patch
        name bluff;

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

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

        // If constructFrom = set : name of faceSet
        set bluffPatchFaces;
    }

);

// ************************************************************************* //
Hope this helps someone else along the way.

-Dave

Last edited by djh2; April 8, 2014 at 19:24.
djh2 is offline   Reply With Quote

Old   October 22, 2014, 12:04
Default
  #3
Senior Member
 
Join Date: Feb 2010
Posts: 213
Rep Power: 10
vaina74 is on a distinguished road
Hi Dave, thanks for sharing your experience about topoSet and createPatch tools. I'm trying to set an easier case but something is wrong and maybe I didn't understand your explanations. Could you take a look, please?
vaina74 is offline   Reply With Quote

Old   April 23, 2015, 11:23
Default
  #4
Member
 
Gareth
Join Date: Jun 2010
Posts: 36
Rep Power: 8
bullmut is on a distinguished road
Hi all

I am creating a single patch from 4 previous patches. I am doing this to enact refineWallLayer over all the patches at the same time (maybe there is a better solution) but in creating the single patch creatPatch removes my orignial patches.
Is there a way around this?
I orginally tried to recreate the original patches in my createPatchDict but that caused issues with the newly made single patch.

Any ideas on a work around?
Thanks in advance
bullmut is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to set periodic boundary conditions Ganesh FLUENT 13 January 22, 2014 05:11
Add Mesh Layers doesnt work on the whole surface Kryo OpenFOAM Native Meshers: snappyHexMesh and Others 8 September 13, 2012 09:28
snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Native Meshers: snappyHexMesh and Others 2 March 27, 2011 21:11
DecomposePar unequal number of shared faces maka OpenFOAM Pre-Processing 6 August 12, 2010 09:01
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55


All times are GMT -4. The time now is 02:09.