|
[Sponsors] |
[mesh manipulation] patch splitting for different boundary conditions |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 22, 2014, 10:58 |
patch splitting for different boundary conditions
|
#1 |
Senior Member
Join Date: Feb 2010
Posts: 213
Rep Power: 17 |
Hi all, I'm setting a preliminary simple case for further analysis and I'm trying to get confident with OpenFOAM meshing tools. I already tried a different approach here, but I guess that topoSet (fvOptions too?) could be useful.
The domain is a single block and I want to define inlet and outlet 'openings' on two different block faces - where a wall boundary condition is defined through blockMeshDict and field definition in the 0 directory.If I am correct, I can create a topoSetDict, such as Code:
actions ( { name inlet; type faceSet; action new; source boxToFace; sourceInfo { box (-.1 4.4 1.9) (.1 5.6 3.1); } } { name outlet; type faceSet; action new; source boxToFace; sourceInfo { box (4.4 4.4 4.9) (5.6 5.6 5.1); } } ); - How can I apply inlet and outlet boundary conditions on the new 'sub-patches'? - Should I set U and p values on the new inlet and outlet patches (not included in blockMeshDict)? - Is the correct procedure blockMesh > topoSet > [solver]? Last edited by vaina74; October 22, 2014 at 12:00. |
|
October 22, 2014, 12:53 |
|
#2 |
Senior Member
Join Date: Feb 2010
Posts: 213
Rep Power: 17 |
I hope someone can correct me, if I am on the wrong way.
1. create a simple block, all faces are set as wall. 2. create a topoSetDict in order to generate two sets of cell faces for inlet and outlet openings. Code:
actions ( { name inlet; type faceSet; action new; source boxToFace; sourceInfo { box (-.01 4.45 1.95) (.01 5.55 3.05); } } { name outlet; type faceSet; action new; source boxToFace; sourceInfo { box (4.45 4.45 4.99) (5.55 5.55 5.01); } } ); Code:
pointSync false; patches ( { name inlet; patchInfo { type patch; } constructFrom set; set inlet; } { name outlet; patchInfo { type patch; } constructFrom set; set outlet; } ); Anyway something is wrong because I obtain the message Code:
Create time Create polyMesh for time = 0 Reading createPatchDict Adding new patch inlet as patch 1 from { type patch; } Adding new patch outlet as patch 2 from { type patch; } Read 381 faces from faceSet inlet --> FOAM FATAL ERROR: Face 579358 specified in set inlet is not an external face of the mesh. This application can only repatch existing boundary faces. From function createPatch in file createPatch.C at line 727. FOAM exiting |
|
October 22, 2014, 13:15 |
|
#3 |
New Member
David H.
Join Date: Oct 2013
Posts: 25
Rep Power: 13 |
It looks like you need to intersect your face sets created by topoSet with the boundary faces. I think you're creating a set of faces of your box but they do not coincide with your boundary, or it includes internal domain faces in additional to boundary faces, and OF is not handling that.
It might be helpful to sketch a schematic of your mesh and post it here, so we can figure out what's going on. |
|
October 22, 2014, 13:32 |
|
#4 |
Senior Member
Join Date: Feb 2010
Posts: 213
Rep Power: 17 |
I think so, but I don't see the reason. Maybe I need a double passage from patch to cells and from cells to face like in your case. This is my elementary blockMeshDict
Code:
convertToMeters 1; vertices ( (0 0 0) (10 0 0) (10 10 0) (0 10 0) (0 0 5) (10 0 5) (10 10 5) (0 10 5) ); blocks ( hex (0 1 2 3 4 5 6 7) (100 100 50) simpleGrading (1 1 1) ); edges ( ); boundary ( defaultFaces { type wall; faces (); } ); mergePatchPairs ( ); |
|
October 22, 2014, 15:02 |
|
#5 |
New Member
David H.
Join Date: Oct 2013
Posts: 25
Rep Power: 13 |
I'm not sure I follow what you're saying. It looks like you're trying to add all the faces from your "inlet" or "outlet" set to the patch, and this is not possible because many of them are fictitious with respect to your mesh geometry, or lie within your domain and are therefore not boundary faces.
I've attached a simplified annotated method based on my previous work in http://www.cfd-online.com/Forums/ope...tml#post484777 In this case, I believe you're essentially taking my purple representation of the box faces and trying to call them all an inlet boundary. I have not found a more elegant way to have OpenFOAM take only the intersecting faces as a patch |
|
October 27, 2014, 04:45 |
|
#6 |
Senior Member
Join Date: Feb 2010
Posts: 213
Rep Power: 17 |
Hi David, here I am again. Thanks a lot for your 'flowchart', it helped.
The sets of cells and faces was not clear to me, I thought that the boxToFace topoSet source was able to 'intersect' the original patch in order to create a sub-set of faces. As you said, your procedure is tricky and not so elegant, but it appears as the only possible. I looked for an alternative, but I didn't find anything. I have a couple of questions for you or other experienced users. - the source patchToFace (applied to the patch to be manipulated) is really requested? - are possible more elegant procedures? - I can't find documentation about fvOptions, I wonder if it could be useful in boundary conditions setting. I share my simple test case for topoSet and createPatch usage. blockMeshDict: Code:
convertToMeters 1; vertices ( (0 0 0) (10 0 0) (10 10 0) (0 10 0) (0 0 5) (10 0 5) (10 10 5) (0 10 5) ); blocks ( hex (0 1 2 3 4 5 6 7) (100 100 50) simpleGrading (1 1 1) ); edges ( ); boundary ( inletWall { type wall; faces ( (0 4 7 3) ); } outletWall { type wall; faces ( (4 7 6 5) ); } defaultFaces { type wall; faces (); } ); mergePatchPairs ( ); Code:
actions ( // inlet patch generation // inletWall patch from blockMeshDict { name inlet; type faceSet; action new; source patchToFace; sourceInfo { name "inletWall"; } } // cutting volume for inlet { name inletCells; type cellSet; action new; source boxToCell; sourceInfo { box (-1 4.5 2) (1 5.5 3); } } // cutting surfaces for inlet { name inletFaces; type faceSet; action new; source cellToFace; sourceInfo { set inletCells; option all; } } // temporary inletWall patch clone { name inletPatch; type faceSet; action new; source faceToFace; sourceInfo { set "inlet"; } } // cutting temporary inletWall patch clone { name inletPatch; type faceSet; action delete; source faceToFace; sourceInfo { set "inletFaces"; } } // cutting final inlet patch { name inlet; type faceSet; action delete; source faceToFace; sourceInfo { set "inletPatch"; } } // outlet patch generation { name outlet; type faceSet; action new; source patchToFace; sourceInfo { name "outletWall"; } } { name outletCells; type cellSet; action new; source boxToCell; sourceInfo { box (4.5 4.5 4) (5.5 5.5 6); } } { name outletFaces; type faceSet; action new; source cellToFace; sourceInfo { set outletCells; option all; } } { name outletPatch; type faceSet; action new; source faceToFace; sourceInfo { set "outlet"; } } { name outletPatch; type faceSet; action delete; source faceToFace; sourceInfo { set "outletFaces"; } } { name outlet; type faceSet; action delete; source faceToFace; sourceInfo { set "outletPatch"; } } ); Code:
pointSync false; patches ( { name inlet; patchInfo { type patch; } constructFrom set; set inlet; } { name outlet; patchInfo { type patch; } constructFrom set; set outlet; } ); Code:
blockMesh topoSet createPatch -overwrite |
|
October 28, 2014, 06:59 |
|
#7 |
Senior Member
Join Date: Feb 2010
Posts: 213
Rep Power: 17 |
I keep exploring OpenFOAM meshing tools. Now I am able to subtract a smaller volume from the main blockMesh domain. I just edited the previous topoSetDict, adding
Code:
{ name domain; type cellSet; action new; source boxToCell; sourceInfo { box (4 4 -1) (6 6 2); } } { name domain; type cellSet; action invert; } Code:
subsetMesh -overwrite domain |
|
November 8, 2014, 18:37 |
|
#8 |
New Member
mamue
Join Date: Mar 2011
Location: Germany
Posts: 2
Rep Power: 0 |
Thanks for this useful hint djh2. But I run in a FOAM FATAL ERROR
I think, I'm able to cut patch faces with this method, because I can see the success in paraFoam by switching in the directory 0.001. But if I use the createPatch -overwrite option I run in a FOAM FATAL ERROR out-of-order 0.1 at index 2 if I try to open the mesh with paraFoam. Someone any idea? |
|
November 10, 2014, 10:26 |
|
#9 | |
New Member
David H.
Join Date: Oct 2013
Posts: 25
Rep Power: 13 |
Quote:
This could be a bug to file |
||
November 12, 2014, 06:24 |
|
#10 |
New Member
mamue
Join Date: Mar 2011
Location: Germany
Posts: 2
Rep Power: 0 |
Thank you djh2, but I found the "bug" in front of the screen.
The reason is, that I overwrite a existing patch name in constant/boundary with my definition in createPatch. This produce the error. Using always a new name from the old constant/boundary over the definitions in topoSet and createPatch. |
|
April 14, 2016, 23:36 |
|
#11 |
New Member
Aidan
Join Date: Jul 2014
Location: Belfast
Posts: 17
Rep Power: 12 |
Hi vaina74, did you ever solve this problem? If so, I'd be very grateful if you could share.
Thanks Aidan |
|
June 24, 2016, 06:11 |
|
#12 |
New Member
Join Date: Jun 2009
Location: Belgium
Posts: 11
Rep Power: 17 |
Dear Vaina74 and David,
thanks for the posts; they were helpful for me. I played around with topoSet trying to find a more elegant way to cut out a patch from an existing patch, but I can't find a better way then your 6-actions-procedure as well. It would be nice to have actions that intersect face-sets or that select boundary-faces from a larger face-set. I try to make code as reusable as possible. In your 6-actions-procedure there are some sets created that only have a temporary use. I don't give them descriptive names, but just call them tempset1, tempset2, ... For a subsequent patch to cut out, I simply use the same names "tempset1". topoSet will simply overwrite the old tempsets, but that's ok as you don't need them anymore. The result is imo more readable, and requires less editing, and produces less useless files in the sets-directory. Here is what I mean (topoSetDict snippet): Code:
// 6-actions patch generation: cut out 'filter1' from 'ceiling' { name filter1; type faceSet; action new; source patchToFace; sourceInfo { name "ceiling"; } } // cutting volume for inlet { name tempset1; type cellSet; action new; source boxToCell; sourceInfo { box (3 1 2)(5 3 4); } } // taking faces belonging to the cutting volume { name tempset2; type faceSet; action new; source cellToFace; sourceInfo { set tempset1; option all; //Is there not better option, like only selecting boundary faces? } } // temporary clone of ceiling-face-zone { name tempset3; type faceSet; action new; source faceToFace; sourceInfo { set "filter1"; } } // removing the filter1 faces from the ceiling-faces-clone { name tempset3; type faceSet; action delete; source faceToFace; sourceInfo { set "tempset2"; } } // final filter1 patch = ceiling-faces - tempset3 { name filter1; //this is the final result to use in createPatchDict ! type faceSet; action delete; source faceToFace; sourceInfo { set "tempset3"; } } //here ends the 6-actions sequence to cut a patch from an existing patch. happy Foaming, Laika, still orbiting |
|
April 3, 2019, 15:45 |
|
#13 |
New Member
Join Date: Mar 2016
Posts: 23
Rep Power: 10 |
Does anyone know if a better method to only selecting boundary faces has been introduced since 2016?
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Centrifugal fan | j0hnny | CFX | 13 | October 1, 2019 14:55 |
[mesh manipulation] Importing Multiple Meshes | thomasnwalshiii | OpenFOAM Meshing & Mesh Conversion | 18 | December 19, 2015 19:57 |
Wrong flow in ratating domain problem | Sanyo | CFX | 17 | August 15, 2015 07:20 |
An error has occurred in cfx5solve: | volo87 | CFX | 5 | June 14, 2013 18:44 |
Water subcooled boiling | Attesz | CFX | 7 | January 5, 2013 04:32 |