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

[mesh manipulation] Multiplying a mesh n times

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 24, 2015, 09:24
Default Multiplying a mesh n times
  #1
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
Hello all,

I have the mesh of a segment of a geometry that I want to calculate. I want to multiply this mesh several times to create my final geometry. Additionally, the nodes at the patches where the parts are joining needs to be merged and switched from patches to internal faces.
MirrorMesh does what I want as long as the geometry is symmetric, but is there something similar for geometries where I need to duplicate the mesh without mirroring? I did not find anything for this.
bastil is offline   Reply With Quote

Old   January 12, 2016, 04:42
Default
  #2
Senior Member
 
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16
cutter is on a distinguished road
Hi,

I hope I got got your problem right: I suppose you're trying to simulate something like a pipe or channel consisting of multiple identical segments.

You could create a copy of the original mesh for each segment and use moveMesh or transformPoints in order to put them at the correct place. Afterwards you need to use mergeMeshes and stitchMesh to connect them to one large mesh consisting of all the parts.

Hope that helps.

Cutter
cutter is offline   Reply With Quote

Old   January 16, 2016, 09:04
Default
  #3
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
Hello,

yes you got my problem right. The way you are describing may work but it is not so straightforward.
I would be happy to have a utility similar to mirrorMesh, maybe multiplyMesh to perform such tasks.
bastil is offline   Reply With Quote

Old   January 17, 2016, 16:21
Default
  #4
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
Ok I tried the proposed way. It works smooth up to stitchMesh. Thsi fails. I guess the problem is that the boundary faces to be stitched are in one patch (because of running mirrorMesh and copying the mesh before). therefore I can't address the patches to be stitched.
bastil is offline   Reply With Quote

Old   January 17, 2016, 16:52
Default
  #5
Senior Member
 
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16
cutter is on a distinguished road
Well, you're almost at the finish line.

Rename the patches of the segments and use indices (for example inlet_part1, outlet_part1 and so on). Afterwards you'll be able to address them during the stitchMesh step. Renaming the patches can be done by simply editing the patch names within the dictionary constant/polyMesh/boundary.

This can also be automated using simple shell scripts.
cutter is offline   Reply With Quote

Old   January 17, 2016, 17:12
Default
  #6
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
Its not that easy... I used mirrorMesh before since the geometry I need several times is symmetric itself. Mirrormesh mirrored the patch and therefore the "in" and "out" patch of the starting geometry are one. I need to split them of before copy. How can this be done?
bastil is offline   Reply With Quote

Old   January 17, 2016, 17:43
Default
  #7
Senior Member
 
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16
cutter is on a distinguished road
Use topoSet to select the faces that need to added to a separate patch (slightly larger box around them) and put them into a new face set. This face set can then be used to create a new patch using createPatch.
cutter is offline   Reply With Quote

Old   January 19, 2016, 05:09
Default
  #8
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 555
Rep Power: 27
linnemann will become famous soon enough
Hi

I would really use Salome for this as it is much faster and does what you want in the same program.

Just made a simple geo with mesh and copy the mesh. You can also rotate or use symmetry with a normal vector to make the mirror effect.

At the end make a compound mesh and tick "merge coincident nodes".

Export the mesh to UNV and use ideasUnvToFoam to convert the mesh.
You need to fiddle with the BC's at the end, but that is easy compared to what you are trying to accomplish.
Attached Images
File Type: png 2016-01-19 10_05_24-SALOME 7.7.1 - [Repeat].png (148.8 KB, 88 views)
File Type: jpg 2016-01-19 10_11_55-SALOME 7.7.1 - [Repeat].jpg (156.7 KB, 62 views)
Attached Files
File Type: txt Repeat.py.txt (2.8 KB, 23 views)
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   March 8, 2016, 11:50
Default
  #9
Member
 
Timm Severin
Join Date: Mar 2014
Location: Munich
Posts: 63
Rep Power: 12
Astrodan is on a distinguished road
I'm not entirely sure how it works, but OpenFOAM includes the extrudeMesh utility, which probably dies just what you want.

An example can be found in tutorials/multiphase/interFoam/ras/waterChannel

It might take some code reading to figure out all possible options, or a couple of bananas.. but this way you can avoid the mergeMesh and stichMesh action.
__________________
PhD Student at the Institute of Biochemical Engineering at TU München
Modelling of fluid dynamics in open photobioreactors.

System:
OpenFOAM 2.3.x, 64bit, 8 Core Xeon Workstation
Astrodan is offline   Reply With Quote

Old   October 23, 2020, 06:33
Default
  #10
Senior Member
 
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 6
otaolafr is on a distinguished road
hello,
i am facing the same type of geometry and would like how you got to achive it at the end?

thanks a lot
otaolafr is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] Add Mesh Layers doesnt work on the whole surface Kryo OpenFOAM Meshing & Mesh Conversion 13 February 17, 2022 08:34
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
[snappyHexMesh] snappyHexMesh does not create any mesh except one for the reference cell Arman_N OpenFOAM Meshing & Mesh Conversion 1 May 20, 2019 18:16
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 19:57
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55


All times are GMT -4. The time now is 12:30.