|
[Sponsors] |
October 15, 2018, 17:40 |
Creating patch on stl surface
|
#1 |
Member
Obi
Join Date: Jul 2016
Location: Canada
Posts: 45
Rep Power: 10 |
Hi guys, so i have stl files for different faces in a geometry. How can i create custom (sub)patches on those faces within openFoam so that i can assign boundary conditions?
For example, defining a circular patch on a square stl surface, so that i can assign an inlet boundary condition to the circular patch. |
|
October 16, 2018, 10:29 |
|
#2 |
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 |
Hi!
You can select the faces with topoSet then use the createPatch utility. For topoSet you can use primitives or create the boundary you want as an STL file and you can use that to find the faces in the mesh. But maybe your patch won't be the same as the wanted geometry since you can only use the faces you already have in the mesh. |
|
October 16, 2018, 10:41 |
|
#3 | |
Member
Obi
Join Date: Jul 2016
Location: Canada
Posts: 45
Rep Power: 10 |
Quote:
|
||
October 16, 2018, 17:08 |
|
#4 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
An annotated topoSetDict is provided in the release : https://github.com/OpenFOAM/OpenFOAM...ed/topoSetDict. It looks like surfaceToCell (using your stl) and then cellToFace could get you what you want. In the past I've used stl's with snappy to streamline the process -- then patches are created automatically and unnecessary cells are removed.
Caelan |
|
October 17, 2018, 03:37 |
|
#5 |
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 |
Like this you can create the faceZoneSet directly from the surface, you don't have to go on the longer way:
Code:
// Select based on surface. Orientation from normals on surface { name fz0; type faceZoneSet; action new; source searchableSurfaceToFaceZone; sourceInfo { surface triSurfaceMesh; // centre (0.05 0.05 0.005); // radius 0.025; name sphere.stl; // Optional name if surface triSurfaceMesh } } Now I have no case to test this so maybe it won't be the perfect setup for the dictionary, but if it is not correct, the error will tell you exactly what's missing. |
|
October 17, 2018, 10:22 |
|
#6 | |
Member
Obi
Join Date: Jul 2016
Location: Canada
Posts: 45
Rep Power: 10 |
Quote:
|
||
October 17, 2018, 18:24 |
|
#7 | |
Member
Obi
Join Date: Jul 2016
Location: Canada
Posts: 45
Rep Power: 10 |
Quote:
Thanks |
||
October 18, 2018, 03:41 |
|
#8 | |
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 |
Quote:
topoSet must be used after snappy. It does nothing with the mesh, it is just for "mark" the points/faces/cells. Then in the createPatch utility you can use these "groups" (in your case faceZones) to specify the new patches based on the "groups" (faceZones) you "marked" with topoSet. (Some expert foamers may say it is not just a "marker", but I think it is easier to understand what's happening if you imagine the process like this.) |
||
March 19, 2019, 07:03 |
|
#9 | |
Senior Member
Join Date: Nov 2011
Posts: 109
Rep Power: 15 |
Quote:
Hi all, I am having the same problem but cannot seem to get hold of this after extensive googling. I have a stl file (not generated by me). I basically need to take a square patch on a certain boundary and mark it as an inlet (same thing for an outlet patch). I am happy to use Snappy for meshing. Can anyone outline a step-by-step process to make this work? Particularly I am not clear how this would work with topoSet if this has to be executed after Snappy. How will Snappy know where are the edges of the inlet boundary patch? This cannot be achieved by just re-assigning the boundary faces to a different patch: one needs to remesh the domain to make sure that boundary patch is resolved properly. Any help to clarify the issue would be appreciated. Rob |
||
March 19, 2019, 12:05 |
|
#10 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
If I understand correctly, you have the stl file that is some outline for your domain, and then want to create inlets/outlets on this new domain. So,
1: blockMesh to create background mesh 2: snappy to make mesh in stl shape 3: topoSet to select inlet faces 4: createPatch to create inlet patch 5: topoSet to select outlet faces 6: createPatch to create outlet patch You can condense a few steps (ie selected multiple sets using one topoSet call) but this should get it done. There are various tutorials that use topoSet/createPatch. Caelan |
|
March 19, 2019, 13:07 |
|
#11 |
Senior Member
Join Date: Nov 2011
Posts: 109
Rep Power: 15 |
Hi Caelan,
yes that's correct. Thanks a lot for the reply. There is something still unclear, however. Let's assume, in order to simplify things, that my domain is a cube. Let's suppose also that my inlet and outlet are of circular shape (diameter half or the cube length), sitting on two opposite faces of the cube. If I first mesh the cube, there is nothing that will tell snappy to make sure to have the inlet and outlet circles as edges so that no cells will be partially on the 'wall' region and partially on the 'inlet' (or 'outlet') region. In other words, how can I make sure that the 'inlet' and 'outlet' circles will be perfectly discretized? Should I do this on the cad or is OpenFOAM able to handle this somehow? Thanks a lot! Rob |
|
March 19, 2019, 13:12 |
|
#12 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
I am not sure what the problem is. Using snappy you will make the mesh conform to the stl, for lack of a better description. The cells outside of the stl will have been removed. If you are talking about making perfect circles for the inlet/outlet, that's a different question that I'm sure others have asked. If you are talking about simply selecting rectangular sets of faces, you do not need to use snappy -- topoSet/createPatch will do.
Caelan |
|
March 19, 2019, 13:21 |
|
#13 |
Senior Member
Join Date: Nov 2011
Posts: 109
Rep Power: 15 |
Hi Caelan,
yes my point is precisely how to make perfect circles for the inlet/outlet. Those geometrical entities are not part of the CAD itself. The cad is just a plain cube. I was wondering if I can define, using OpenFOAM tools, a part of the surfaces of the cad (circles in this specific case) to be the inlet and the outlet. I assume this has to be made before the first mesh is calculated but I may be wrong (quite a novice in OpenFOAM) Thanks a lot! Rob |
|
March 19, 2019, 13:33 |
|
#14 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
If your domain geometry is just a cube, you can create it with blockmesh. As for the inlet/outlet shape, I'm sure others have asked about making circular patches -- I suggest looking around. I imagine one method is some combination of snappy, mergeMesh, and extrudeMesh but have not done it myself. If you are fine with "mostly" circular then cylinderToCell then selecting a subset of that selection for the faces you want could be the way to go.
Caelan |
|
March 2, 2020, 05:33 |
|
#15 |
Member
vincent
Join Date: Apr 2011
Posts: 45
Rep Power: 15 |
Hi foamers,
I need some help. I work with OpenFOAM 1806. I have a STL CAD. On one face(I post an image with face in red), I would like apply an inlet condition to simulate an air injection. When I try topoSet + creatPatch, I have the follow message : → FAOM FATAL ERROR : Face 26398775 specified in set inletFaces is not an external face of the mesh. This application can only repatch existing boundary faces. So if I can't use topoSet and creatPatch, how can I do ? Vincent p { margin-bottom: 0.25cm; line-height: 120%; } |
|
March 2, 2020, 05:41 |
|
#16 |
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 |
You have some internal faces in the faceZone. You can use createPatch on external faces only. So in topoSet you have to exclude the internal faces from the set, and it will be fine.
|
|
March 3, 2020, 11:12 |
|
#17 |
Member
vincent
Join Date: Apr 2011
Posts: 45
Rep Power: 15 |
Hi Simrego
Thanks for your answer. What is the command to exclude the internal faces in topoSet? I search wihtout found. All the best |
|
March 3, 2020, 11:23 |
|
#18 |
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 |
Hi!
I can't find a nice way now, but you can do it like: Code:
// source patchToFace; // sourceInfo // { // name ".*"; // }// All faces of all patch https://github.com/OpenFOAM/OpenFOAM...et/topoSetDict |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
AMI speed performance | danny123 | OpenFOAM | 21 | October 24, 2020 05:13 |
[Commercial meshers] Mesh conversion problem (fluent3DMeshToFoam) | Aadhavan | OpenFOAM Meshing & Mesh Conversion | 2 | March 8, 2018 02:47 |
[GAMBIT] periodic faces not matching | Aadhavan | ANSYS Meshing & Geometry | 6 | August 31, 2013 12:25 |
[mesh manipulation] Using createPatch in place of couplePatches | sripplinger | OpenFOAM Meshing & Mesh Conversion | 8 | November 13, 2009 08:14 |
CFX4.3 -build analysis form | Chie Min | CFX | 5 | July 13, 2001 00:19 |