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

Create patch inside cylinder

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 3, 2015, 09:09
Default Create patch inside cylinder
  #1
Senior Member
 
Join Date: Jan 2015
Posts: 143
Rep Power: 4
Svensen is on a distinguished road
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 ?
Attached Images
File Type: png shellMesh.png (6.8 KB, 19 views)
Svensen is offline   Reply With Quote

Old   April 3, 2015, 10:45
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,734
Rep Power: 29
alexeym will become famous soon enoughalexeym will become famous soon enough
Send a message via Skype™ to alexeym
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.
Attached Files
File Type: gz create-patch.tar.gz (25.6 KB, 53 views)
alexeym is offline   Reply With Quote

Old   April 22, 2016, 01:11
Default
  #3
Senior Member
 
Join Date: Jan 2015
Posts: 143
Rep Power: 4
Svensen is on a distinguished road
Thanks, but what steps should I do, if I need to define an interface surface for a more complex shell, like on attached images ?
Attached Images
File Type: png forum1.png (72.8 KB, 54 views)
File Type: jpg forum2.jpg (201.4 KB, 52 views)
Svensen is offline   Reply With Quote

Old   April 22, 2016, 12:56
Default
  #4
Member
 
Peter
Join Date: Feb 2015
Location: California
Posts: 60
Rep Power: 4
opedrofunk is on a distinguished road
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
opedrofunk is offline   Reply With Quote

Old   April 29, 2016, 13:29
Default
  #5
Senior Member
 
Join Date: Jan 2015
Posts: 143
Rep Power: 4
Svensen is on a distinguished road
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
Svensen is offline   Reply With Quote

Old   April 29, 2016, 19:20
Default
  #6
Member
 
Peter
Join Date: Feb 2015
Location: California
Posts: 60
Rep Power: 4
opedrofunk is on a distinguished road
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
opedrofunk is offline   Reply With Quote

Old   April 30, 2016, 01:25
Default
  #7
Senior Member
 
Join Date: Jan 2015
Posts: 143
Rep Power: 4
Svensen is on a distinguished road
Yes, I've tried to use faceSet and faceZoneSet, but with no success. surfaceToCell still selects EVERY outside cell...
Svensen is offline   Reply With Quote

Old   April 30, 2016, 03:31
Default
  #8
Member
 
Peter
Join Date: Feb 2015
Location: California
Posts: 60
Rep Power: 4
opedrofunk is on a distinguished road
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!
opedrofunk is offline   Reply With Quote

Old   May 3, 2016, 08:48
Default
  #9
Senior Member
 
Join Date: Jan 2015
Posts: 143
Rep Power: 4
Svensen is on a distinguished road
Quote:
Originally Posted by opedrofunk View Post
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?
This is a key moment, in topoSet provided by alexeym there is a code:
Code:
name c0;
        type cellSet;
        action new;
        source cylinderToCell;
        sourceInfo
        {
            p1       (0 -1 0);
            p2       (0  1 0);
            radius   0.01;
        }
This selects NOT ALL outer cells. It selects only first layers of the wall, because radius of cylinder is 0.015, but for selection the radius of 0.01 is used. Then he easily got a desired faceSet using patchToFace, because intersection with patch gives him only one faceSet.

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
Svensen is offline   Reply With Quote

Old   May 4, 2016, 16:31
Default
  #10
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,734
Rep Power: 29
alexeym will become famous soon enoughalexeym will become famous soon enough
Send a message via Skype™ to alexeym
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).
alexeym is offline   Reply With Quote

Old   May 6, 2016, 11:35
Default
  #11
Senior Member
 
Join Date: Jan 2015
Posts: 143
Rep Power: 4
Svensen is on a distinguished road
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 !
Attached Images
File Type: png forum_inner-wall_OK.png (117.7 KB, 35 views)
Svensen is offline   Reply With Quote

Old   January 25, 2017, 06:06
Default
  #12
Member
 
Join Date: Oct 2015
Location: montreal- canada
Posts: 45
Rep Power: 4
Mohammad Jam is on a distinguished road
Quote:
Originally Posted by Svensen View Post
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 !
Hi Sevensen,
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
Mohammad Jam 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
Problem with cyclic boundaries in Openfoam 1.5 fs82 OpenFOAM 36 January 7, 2015 01:31
Cyclic Boundary Condition Luiz Eduardo Bittencourt Sampaio (Sampaio) OpenFOAM Running, Solving & CFD 36 July 2, 2012 12:23
Using createPatch in place of couplePatches sripplinger OpenFOAM Mesh Utilities 8 November 13, 2009 08:14
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55
meshing F1 front wing Steve FLUENT 0 April 17, 2003 12:37


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