Create patch inside cylinder
1 Attachment(s)
I've got a cylinder shell for FSI simulation using extrudeMesh tool. The problem is: I can't define the patch for internal wall of cylinder. Using topoSet and boundaryToFace, I've got both (internal and external) wall as a single patch. I need somehow to find the way how to separate them.
Any ideas ? |
1 Attachment(s)
Hi,
You need two utilities: 1. topoSet to create faceSets of the future patches 2. createPatch to create patch from faceSets With topoSet... 1. You create layer of internal cells with cylinderToCell 2. You create faceSet with cellToFace, this set contains all faces of the cellSet you created during 1. 3. You subset faceSet with patchToFace. This face set contains intersections of the faceSet created during 2 and faces of the patch that includes inner and outer surfaces. I.e. this is inner wall. 4. You create cellSet, which includes all cells of the mesh, then you delete cells that are not connected to outer wall. 5. You repeat operations 2 and 3 with cellSet created during step 4. Finally with createPatch you create patches from the sets you have created with topoSet. I have attached example case. Allrun script creates inner and outer wall patches. Allclean script cleans the case. tube.geo is Gmsh script to create tube-like mesh (I have commented out two physical groups, so outer and inner wall go to defaultFaces patch). tube.msh is in the archive just in case you do not have Gmsh installed. |
2 Attachment(s)
Thanks, but what steps should I do, if I need to define an interface surface for a more complex shell, like on attached images ?
|
Hi,
The process is basically the same. For more complex surfaces just use an STL file that conforms to each surface of interest, and use that to define your faceSets in the relevant dict file. Regards, Peter |
Thank you very much for reply. I understand the general idea of how to create an inner-wall patch, but when I've tried to get a cellSet using surfaceToCell source, I've got a problem that I can't select only one outer layer of cells near the triSurface. surfaceToCell selects ALL outer cells, but I need only first layer...
My settings are: name inner-wall; type cellSet; action new; source surfaceToCell; sourceInfo{ file "aneurysm_clipped.stl"; outsidePoints ((0.00509171735560405 0.0732949029971605 -0.105403150690403)); includeCut false; includeInside false; includeOutside true; nearDistance 1e-4; curvature 0; } I've tried to play with nearDistance, but with no effect... The project is here: https://yadi.sk/d/uGH_3Da7rPuSP |
Hi,
I think you want to select only the faces (rather than the cells?); have you tried changing the "type" to faceSet or faceZoneSet? Kind regards, Peter |
Yes, I've tried to use faceSet and faceZoneSet, but with no success. surfaceToCell still selects EVERY outside cell...
|
Hi,
surfaceToCell will definitely select cells inside/outside/etc. which is exactly what you want in step 1 - did you then try following the rest of the steps alexeym outlined in his post to extract faceSets from these? The intention is to get the orientation of the faces correct in the two faceSets that are ultimately created. And then the last step is to define the patches (which will then have the correct orientation). If you want to try it a different way, you could check out searchableSurfaceToFaceZone with correctly oriented normals on corresponding stl's and make some faceZoneSets that way. https://github.com/OpenFOAM/OpenFOAM...et/topoSetDict Kind regards, Peter PS. I assume you are defining the solid part (region) your problem here? Where are you defining your fluid region? I don't know the specifics of how you're intending to setup your problem, but it's possible that it may be more straightforward just to create a mesh with two regions (in Gmsh for example) and just run splitMeshRegions on it. The "internal" patches are automatically created this way. Anyway, just a thought. Good luck! |
Quote:
Code:
name c0; In my case, it is a problem to select all outer cells except the last layer. When I select ALL outer cells (Both internal and external faceSets), intersection with patch gives me faceSet consisting of both outer and inner faces... So the problem remains the same, how to select only some layers of the wall (not all !) using surfaceToCell. P.S. You've asked about how I defined fluid/solid domains. The workflow is following: I've started with fluid domain using snappyHexMesh and STL file. For solid I've used an extrudeMesh with 1mm thickness and 5 layers. Now I have a fluid domain and solid shell, but there is a problem of defining fsi_interface patch for solid domain |
Hi,
Unfortunately I do not track post with my old answers after the problem was resolved. So I have noticed this thread only today. My questions is: is it possible to post mesh and surface in equal scale? If I open mesh in paraview I get these coordinate ranges: x: [-0.000811:0.0224], y: [0.0707:0.0949], z: [-0.129:-0.0931] If I open surface (aneurysm_clipped.stl) in paraview I get these coordinate ranges: x: [0.17:21.5], y: [71.7:94], z: [-130:-94.1] I am not quite sure they intersect (so it is impossible to use surfaceToCell source, or you get whole mesh with certain settings). |
1 Attachment(s)
Thank you guys very much! Indeed, I've rescaled my mesh and now it's matched with an stl surface.
So I correctly created a inner-wall patch ! |
Quote:
According to your project i have these questions: 1. which solver and openfoam version did u use? 2. does snappy hex mesh solved your problem? 3. how did u define two region in your case? i mean solid and fluid zones thanks in advance any answer is welcome regards Jam |
1 Attachment(s)
hi guys,
i kind of got stuck in a similar point. I have both the solid and the fluid domains and I used snappyHexMesh to mesh both together. I meshed it together, not separately to avoid any discontinuity along the interface. Now I'm kind of struggling a bit with the patches. I used this topoSetDict with my STL file, Code:
{ Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // i've tried using setSet to form different sets of faces out of the the object, however, it is not able to create anything as well. It is giving me size of 0 for all the patches. Code:
faceZones: https://yadi.sk/d/iy6aq0933RWrcB and this for the setSet https://yadi.sk/d/QsZQmMKQ3RWrnq Thanks Samuel |
Hi Samuel,
Since the error message complains that it can't find the STL file, you should perhaps give the path to it. I imagine that currently it is looking for the STL file in <CASE_NAME>/<STL_File>. I am guessing that your STL file is actually at <CASE_NAME>/constant/triSurface/<STL_File>. Change your "file" in sourceInfo to a more complete path and see if that helps. BTW, when referencing your home folder be careful. I don't think OpenFOAM will be able to expand "~" in the path name. Hope this helps. Cheers, Antimony |
3 Attachment(s)
Another problem I discovered was that after running snappyHexMesh and tried to use
Code:
SplitMeshRegions -cellZones -overwrite Code:
5 More information can be found here https://yadi.sk/d/yXwpAv8_3Ry3W7 Please any ideas of how to go about this? or any other method? Thanks Sam |
Please can anybody help.
I'm trying to create patches from a porous media object using surfaceToCell feature in TopoSet. My problem is that patches are not formed on the mesh. There a lot of missing faces after createPatches have been called. Svensen can you please let me know how you created yours? My files can be found here. https://yadi.sk/d/G9htTUdp3SRk4K |
All times are GMT -4. The time now is 08:10. |