|
[Sponsors] |
[mesh manipulation] Create patch inside cylinder |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 3, 2015, 10:09 |
Create patch inside cylinder
|
#1 |
Senior Member
Join Date: Jan 2015
Posts: 150
Rep Power: 11 |
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 ? |
|
April 3, 2015, 11:45 |
|
#2 |
Senior Member
|
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. |
|
April 22, 2016, 02:11 |
|
#3 |
Senior Member
Join Date: Jan 2015
Posts: 150
Rep Power: 11 |
Thanks, but what steps should I do, if I need to define an interface surface for a more complex shell, like on attached images ?
|
|
April 22, 2016, 13:56 |
|
#4 |
Member
Peter
Join Date: Feb 2015
Location: New York
Posts: 73
Rep Power: 11 |
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 |
|
April 29, 2016, 14:29 |
|
#5 |
Senior Member
Join Date: Jan 2015
Posts: 150
Rep Power: 11 |
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 |
|
April 29, 2016, 20:20 |
|
#6 |
Member
Peter
Join Date: Feb 2015
Location: New York
Posts: 73
Rep Power: 11 |
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 |
|
April 30, 2016, 02:25 |
|
#7 |
Senior Member
Join Date: Jan 2015
Posts: 150
Rep Power: 11 |
Yes, I've tried to use faceSet and faceZoneSet, but with no success. surfaceToCell still selects EVERY outside cell...
|
|
April 30, 2016, 04:31 |
|
#8 |
Member
Peter
Join Date: Feb 2015
Location: New York
Posts: 73
Rep Power: 11 |
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! |
|
May 3, 2016, 09:48 |
|
#9 | |
Senior Member
Join Date: Jan 2015
Posts: 150
Rep Power: 11 |
Quote:
Code:
name c0; type cellSet; action new; source cylinderToCell; sourceInfo { p1 (0 -1 0); p2 (0 1 0); radius 0.01; } 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 |
||
May 4, 2016, 17:31 |
|
#10 |
Senior Member
|
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). |
|
May 6, 2016, 12:35 |
|
#11 |
Senior Member
Join Date: Jan 2015
Posts: 150
Rep Power: 11 |
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 ! |
|
January 25, 2017, 06:06 |
|
#12 | |
Member
Join Date: Oct 2015
Location: montreal- canada
Posts: 46
Rep Power: 11 |
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 |
||
January 16, 2018, 15:53 |
|
#13 |
New Member
Sam
Join Date: Nov 2017
Posts: 24
Rep Power: 9 |
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:
{ name inlet; type cellSet; action new; source surfaceToCell; // Step1: for creating a layer of internal cells sourceInfo { file "inlet1.stl"; outsidePoints ((0.00155 0.00201 0.001600)); includeCut false; includeInside false; includeOutside true; nearDistance 1e-3; curvature 0; } } Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create polyMesh for time = 0 Reading topoSetDict Time = 0 mesh not changed. Created cellSet inlet Applying source surfaceToCell --> FOAM FATAL ERROR: Cannnot read "inlet1.stl" From function bool Foam::triSurface::read(const Foam::fileName&, const Foam::word&, bool) in file triSurface/triSurface.C at line 360. FOAM exiting 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: inlet size:0 outlet size:0 wall size:0 interface size:0 left size:0 right size:0 front size:0 back size:0 top size:0 bottom size:0 interface_s size:0 https://yadi.sk/d/iy6aq0933RWrcB and this for the setSet https://yadi.sk/d/QsZQmMKQ3RWrnq Thanks Samuel |
|
January 16, 2018, 21:35 |
|
#14 |
Senior Member
Join Date: Aug 2013
Posts: 407
Rep Power: 16 |
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 |
|
January 31, 2018, 18:20 |
|
#15 |
New Member
Sam
Join Date: Nov 2017
Posts: 24
Rep Power: 9 |
Another problem I discovered was that after running snappyHexMesh and tried to use
Code:
SplitMeshRegions -cellZones -overwrite Code:
5 ( Out { type patch; nFaces 322; startFace 1101291; } inlet { type patch; nFaces 8889; startFace 1101613; } outlet { type wall; inGroups 1(wall); nFaces 6859; startFace 1110502; } wall { type wall; inGroups 1(wall); nFaces 23046; startFace 1117361; } FLUID_to_SOLID { type mappedWall; inGroups 1(wall); nFaces 148834; startFace 1140407; sampleMode nearestPatchFace; sampleRegion SOLID; samplePatch SOLID_to_domain0; } ) 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 |
|
February 15, 2018, 08:50 |
|
#16 |
New Member
Sam
Join Date: Nov 2017
Posts: 24
Rep Power: 9 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Commercial meshers] Fluent msh and cyclic boundary | cfdengineering | OpenFOAM Meshing & Mesh Conversion | 49 | November 29, 2024 22:16 |
Problem with cyclic boundaries in Openfoam 1.5 | fs82 | OpenFOAM | 37 | November 29, 2024 11:15 |
Cyclic Boundary Condition | Luiz Eduardo Bittencourt Sampaio (Sampaio) | OpenFOAM Running, Solving & CFD | 36 | July 2, 2012 13:23 |
[mesh manipulation] Using createPatch in place of couplePatches | sripplinger | OpenFOAM Meshing & Mesh Conversion | 8 | November 13, 2009 08:14 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 12:55 |