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

[Other] Merging two different mesh

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

Like Tree1Likes
  • 1 Post By student666

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 1, 2017, 06:26
Default Merging two different mesh
  #1
New Member
 
Fabio
Join Date: Jun 2016
Posts: 11
Rep Power: 10
Fabiio87 is on a distinguished road
Dear all,

I was wondering if it is possible to create two different structured mesh with two different blockMeshDict file and then merge them together.

Does anybody know if it is possible to do this?

Best Regards,

Fabio
Fabiio87 is offline   Reply With Quote

Old   September 1, 2017, 08:19
Default
  #2
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 17
student666 is on a distinguished road
Code:
mergeMesh mastermesh slavemesh -overwrite
Sent from my ASUS_X008D using CFD Online Forum mobile app

Last edited by student666; September 1, 2017 at 15:16.
student666 is offline   Reply With Quote

Old   September 1, 2017, 08:29
Default
  #3
New Member
 
Fabio
Join Date: Jun 2016
Posts: 11
Rep Power: 10
Fabiio87 is on a distinguished road
Quote:
Originally Posted by student666 View Post
mergeMesh mastermesh slavemesh -overwrite

Sent from my ASUS_X008D using CFD Online Forum mobile app

Thanks for your reply.

For "mastermesh", "slavemesh" do you mean the name of the BlockMeshDict files?

Please let me know,

Regards,

Fabio
Fabiio87 is offline   Reply With Quote

Old   September 1, 2017, 10:08
Default
  #4
Senior Member
 
Join Date: Aug 2013
Posts: 407
Rep Power: 15
Antimony is on a distinguished road
Hi,

No. Not the names of the blockMeshDict files.

You need to create the two meshes and then call mergeMesh.

mastermesh should indicate the name/location of the case where the first mesh is located

slavemesh should indicate the name/location of the case where the second mesh is located

Hope this helps.

Cheers,
Antimony
Antimony is offline   Reply With Quote

Old   September 1, 2017, 15:23
Default
  #5
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 17
student666 is on a distinguished road
Read this.

http://www.sourceflux.de/blog/genera...snappyhexmesh/

It gives you a visual explanation

Eg: folder named run contains masterMesh and slaveMesh, so type into your terminal

Code:
oldpc@oldpc-DIXONSXP:~/OpenFOAM/oldpc-2.2.0/run$ mergeMeshes masterMesh slaveMesh -overwrite
Ciao
Fabiio87 likes this.
student666 is offline   Reply With Quote

Old   September 13, 2017, 11:03
Default
  #6
New Member
 
Fabio
Join Date: Jun 2016
Posts: 11
Rep Power: 10
Fabiio87 is on a distinguished road
Thanks for the very clear explanation.

Best Regards

Fabio

Quote:
Originally Posted by student666 View Post
Read this.

http://www.sourceflux.de/blog/genera...snappyhexmesh/

It gives you a visual explanation

Eg: folder named run contains masterMesh and slaveMesh, so type into your terminal

Code:
oldpc@oldpc-DIXONSXP:~/OpenFOAM/oldpc-2.2.0/run$ mergeMeshes masterMesh slaveMesh -overwrite
Ciao
Fabiio87 is offline   Reply With Quote

Old   March 10, 2020, 08:39
Default
  #7
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi everybody,

actually I am facing the same question. However, getting through mergeMesh, it should not connect the two meshes. So I guess stitchMeshes can maybe do the work but actually I found, that it does not work properly. Imagine you have a block structured mesh (piston + liner) which needs to be merged with the mesh including the valve. How would you proceed? Using ACMI boundary conditions would make the deal here but I donīt want to waste computational costs regarding mapping / interpolation etc.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   September 22, 2020, 08:05
Default multiple blocks in Block mesh and then issues with snapyHexMesh
  #8
Member
 
Join Date: Apr 2015
Posts: 42
Rep Power: 11
HosseinB is on a distinguished road
Hi all,


I have spent a long time to figure this out and I couldn't.


I have a seven-block mesh and merged common surfaces using mergepatchpairs in the blockMeshDict. checkMesh of this mesh seems fine.


After this step, I position an STL object somewhere in the mesh and run the snappyHexMesh to prepare my mesh.



I get so many warning of this type and usually the meshing fails:


"
FOAM Warning :

From function static Foam::vectorField Foam::snappySnapDriver::calcNearestSurface(bool, const Foam::meshRefinement&, const labelList&, const labelList&, const scalarField&, const indirectPrimitivePatch&, Foam:ointField&, Foam::vectorField&)
in file snappyHexMeshDriver/snappySnapDriver.C at line 2021
For point:3631049 coordinate-5.4045 0 -0.445) did not find any surface within:0.0200667 metre.

"


These warning start right after the onset of mesh morphing and the coordinates given in the warning are the location of merged patches.

Last edited by HosseinB; September 23, 2020 at 13:28.
HosseinB is offline   Reply With Quote

Old   September 23, 2020, 13:30
Default
  #9
Member
 
Join Date: Apr 2015
Posts: 42
Rep Power: 11
HosseinB is on a distinguished road
The problem was not the mesh, it was a snapControls parameter named:



nFeatureSnapIter


which was causing the issue. I commented this it out and the problem was resolved.




version OpenFOAM 1912.
HosseinB is offline   Reply With Quote

Old   October 24, 2023, 09:53
Default Merge one mesh into another in OpenFOAM
  #10
New Member
 
Tianyuan Wang
Join Date: Oct 2023
Posts: 4
Rep Power: 2
hachikoi is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Hi everybody,

actually I am facing the same question. However, getting through mergeMesh, it should not connect the two meshes. So I guess stitchMeshes can maybe do the work but actually I found, that it does not work properly. Imagine you have a block structured mesh (piston + liner) which needs to be merged with the mesh including the valve. How would you proceed? Using ACMI boundary conditions would make the deal here but I donīt want to waste computational costs regarding mapping / interpolation etc.
Hi Tobias


Did you address the issue? I'm facing the same problem.

My calculation domain is quite large and importing stl files directly into the large domain can lead to poor model accuracy. And also, building the model in a small domain and then importing it to the large domain (using mergeMesh) will cause a huge computational cost in interpolation, similar to the overset method. I'm wondering if it's possible to somehow build the model in the small domain and then import it into the large domain, but the two domains are fully merged with no overlap. MergeMeshes, StitchMesh, SubsetMesh and snappyHexMesh on't seem to work.


Do you have any suggestions for this?


Best regards,


Tianyuan
hachikoi is offline   Reply With Quote

Old   October 24, 2023, 16:57
Default
  #11
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,


well yes partially:

ESI-OpenCFD Version


- Potentially merging the different meshes with cyclicAMI on cost of interpolation. I guess the interpolation does not necessarly increase the computational cost drastically as I was thinking at the beginning. It depends on the number of faces one needs to interpolate. Furthermore, based on the face-to-face area ratio, the interpolation might lead to high or lower accuracy (not investigated).

- Here, the mayor slowdown might come from the `explicit` coupled regions (cyclicAMI) which should increase the pressure iterations (potentially the V-cyclces)
- However, ideally one could use the conservative AMI which lead to almost no interpolation inaccuary but its only possible with transient solvers that call mesh.update(). Furthermore, the ESI-OpenCFD version has a big problem with dynamic meshes in general (I made some profiling here). Since a lot of things are cleared out in each time-step (such as agglomeration table and others), things get really slow compared to staticFvMesh scenarios

cfd.direct Version
- Potentially, using the conservative AMI as well. The major difference should be the fact that here, we really change the mesh in terms of topology. This however, should enable stitchMesh to get ready to connect both regions (not tested). Side note: ESI-OpenCFD version uses some halo faces for the conservative AMI hence, no change in the topology of the mesh


Other than that, no idea at the moment.
Tobi
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Reply

Tags
blockmeshdict block mesh, meshing, openfoam

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 07:34
[snappyHexMesh] Creating multiple multiple cell zones with snappyHexMesh - a newbie in deep water! divergence OpenFOAM Meshing & Mesh Conversion 0 January 23, 2019 04:17
[snappyHexMesh] SnappyHexMesh no layers and no decent mesh for complex geometry pizzaspinate OpenFOAM Meshing & Mesh Conversion 1 February 25, 2015 07:05
[ICEM] Generating Mesh for STL Car in Windtunnel Simulation tommymoose ANSYS Meshing & Geometry 48 April 15, 2013 04:24
[snappyHexMesh] Layers:problem with curvature giulio.topazio OpenFOAM Meshing & Mesh Conversion 10 August 22, 2012 09:03


All times are GMT -4. The time now is 01:45.