|
[Sponsors] |
[mesh manipulation] when can stitchMesh be used? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 28, 2013, 05:15 |
when can stitchMesh be used?
|
#1 |
Senior Member
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 14 |
Hello,
I'm trying to stitch different meshes together. Here is what I found: - internal mesh is a cylinder: no problem. - internal mesh is a block: not possible (see here). - internal mesh is a sphere: not possible (I did not succeeded). Am I right? Or did one of you managed to stitch a block or a sphere inside another mesh? Thanks for your feedback! Eloïse |
|
March 2, 2013, 11:00 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Eloïse,
I can only guess that it really depends on the meshes you've got to be stitched! Can you share simple case examples of what you're trying to do? Best regards, Bruno
__________________
|
|
March 2, 2013, 13:42 |
|
#3 |
Senior Member
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 14 |
Hello Bruno,
Here are some test cases: 1) for a Cylinder: run .\Allrun_Cylinder. You can see that is works by looking at the log.checkMesh where the two internal patches have no faces. 2) for a Sphere: run .\Allrun_Sphere. The stitchMesh ends with an error. 3) for a Block: no test case, but I'd suggest to simply replace the sphere by a box in the Sphere test case. Thanks for your interest in this case Eloïse |
|
March 2, 2013, 20:47 |
|
#4 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Eloïse,
These are awesome test cases ! But you forgot to mention that for the box and the sphere you were using snappyHexMesh! And it's easily solved! The missing magic step if this after mergeMeshes: Code:
rm 0/cc* 0/*Level In addition, you can use the "-overwrite" option in mergeMeshes as well (I'm using OpenFOAM 2.1.x and I haven't checked with 2.1.1): Code:
#!/bin/sh # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions cd IntDom_Sphere/ cleanCase runApplication blockMesh runApplication snappyHexMesh -overwrite cd ../ExtDom_Sphere/ cleanCase runApplication blockMesh runApplication snappyHexMesh -overwrite runApplication mergeMeshes -overwrite . ../IntDom_Sphere/ rm 0/cc* 0/*Level runApplication stitchMesh -partial -toleranceDict toleranceDict -overwrite sphere_ext_region0 sphere_int_region0 Bruno
__________________
|
|
March 3, 2013, 08:35 |
|
#5 |
Senior Member
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 14 |
Hi Bruno,
Thanks for your fast answer! The sphere is indeed created with snappyHexMesh and this additional line solves it all . I haven't had time yet to work on the sphere creation in blockMesh, it will probably come soon. It is already very good news that the stitching can work with spherical and cubic internal meshes when using snappyHexMesh! I'm actually working with 2.0.x, so the -overwrite option is not available for mergeMeshes. Regards, Eloïse |
|
May 13, 2013, 06:21 |
|
#6 |
Senior Member
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16 |
Hi,
thanks for your test cases. I've tried them with OF 2.2.x, they're working without any problems. Did you make any progress with the block case?! Occasionally I have similar problems that could only be resolved by preparing the whole mesh in an external tool. I therefore modified your Cylinder test case to create a Cube case by removing the arcs within the blockMesh files (see below). This causes stitchMesh to fail with the following error: Code:
--> FOAM FATAL ERROR: Zero length edge detected. Probable projection error: slave patch probably does not project onto master. Please switch on enriched patch debug for more info From function void enrichedPatch::calcCutFaces() const in file slidingInterface/enrichedPatch/enrichedPatchCutFaces.C at line 263. The same error has also been observed in http://www.cfd-online.com/Forums/ope...o-patches.html and http://www.cfd-online.com/Forums/ope...-openfoam.html. Cutter |
|
May 19, 2013, 07:27 |
|
#7 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Cutter,
It's simple! Instead of "-partial", use "-perfect". Best regards, Bruno
__________________
|
|
May 30, 2013, 05:21 |
|
#8 |
Senior Member
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16 |
Hi,
ok, that's true for the trivial case when the discretization of master and slave patches match. What's the right way to do it when I change the discretization of the internal block to say 25x25x30? Code:
blocks ( hex (0 1 3 2 4 5 7 6) (25 25 30) simpleGrading ( 1 1 1) ); Thanks Cutter |
|
June 9, 2013, 14:08 |
|
#9 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Cutter,
Well, from what I've managed to figure out, what you're trying to do is to weld the mesh, not stitch the mesh In this scenario, it's necessary to add points to the faces of cells on each side of the connecting patches, so that they can be stitched together afterwards. And after adding the points, it might be necessary to split the cells as well, so that they aren't of the polyhedral variety. The only OpenFOAM utility that I'm aware of doing this is modifyMesh: http://openfoamwiki.net/index.php/ModifyMesh - but this utility is very far from being automated. ... Well, I wrote the above and then went on to investigate this further. I found out something interesting, based on this post: http://www.cfd-online.com/Forums/ope...tml#post183551 - post #15 So basically I had to split up the patches on both sides, so that the stitching would happen on a one-to-one basis. Problem is that after stitching once, it breaks something and we have to rely on mesh conversion to/from Fluent format, because apparently something gets fixed in between the two. Then we can stitch another pair. This can get pretty boring to do manually, so I'm going to keep investigating this, since it's an interesting topic . ______ edit: Nope, two of the patch pairs it can handle just fine, but the other two give this kind of error: Code:
Face 196625 reduced to less than 3 points. Topological/cutting error B. Old face: 2(3066 2625) new face: 2(3066 2625) Best regards, Bruno
__________________
|
|
June 10, 2013, 11:55 |
|
#10 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Cutter,
First note: I created a variant of stitchMesh that allows stitching up several patches in a single run, by relying on a dictionary file to specify which patches should be stitched together and how they should be stitched: https://github.com/wyldckat/stitchMeshMultiPatch Problem is... that this did not solve the problem So here's what I've found out so far:
The next step would be either to:
Another test can could be performed would be to stitch not just 2 meshes, but 5 meshes:
This is an interesting problem, but this is as far as I can figure out for the next few weeks/months. Feel free to report this on the bug tracker, since you're more interested in this than me! Best regards, Bruno
__________________
|
|
June 25, 2013, 10:04 |
|
#11 |
New Member
Arnau
Join Date: Jan 2012
Posts: 17
Rep Power: 14 |
Hi wyldckat,
I had this very same problem: Code:
Face * reduced to less than 3 points. Topological/cutting error B. http://www.cfd-online.com/Forums/ope...tml#post435852 Good luck! Arnau. |
|
June 25, 2013, 18:13 |
|
#12 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Arnau,
Nope, "-perfect" only works in some cases... if you take a look at post #7, that was my initial conclusion, which only worked for the intially presented case from post #6. But it doesn't work for the indication given in post #8. Best regards, Bruno
__________________
|
|
June 30, 2013, 21:09 |
|
#13 |
Member
Jason Eason
Join Date: Jan 2010
Location: Portage, Michigan
Posts: 45
Rep Power: 16 |
Does stitchMesh only work with flat surfaces? Or can you stitch 2 symmetrically curved surfaces together?
__________________
Debian Squeeze - OpenFOAM-2.1.x, Paraview-3.12.0 |
|
July 1, 2013, 08:51 |
|
#14 |
Senior Member
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16 |
Hi, please have a look at the cylinder case in post #1.
|
|
July 24, 2013, 12:01 |
error in stitchMeshing
|
#15 |
New Member
Marcus
Join Date: May 2013
Posts: 15
Rep Power: 13 |
Hi together,
i want to stitch my mesh, but the problem is, that there are 2 different regions defined after mergeMeshing. Now i've the Problem that i can't solve the case with rhoSimpleFoam. And there are also the Problem with my boundary conditions for my mesh in the boundary file...I need urgent help, because i've only 2 Months till i must deliver my master thesis. Please help! Here are my logfile for using stitchMesh in partial and perfect mode. And a screenshot of my 2 Mesh Regions, which are already merged. Thx all for your supply. kind regards Marcus Code:
Build : 2.0.x-0751ac349341 Exec : stitchMesh -case ./MergeMeshes/ -partial inlet_inlet_prt outlet_outlet_prt Date : Jul 24 2013 Time : 16:34:52 Host : cpi02968.c166.c.iav.de PID : 28859 Case : ./MergeMeshes nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Disallowing user-supplied system call operations Create time Create mesh for time = 4 Coupling partially overlapping patches inlet_inlet_prt and outlet_outlet_prt Resulting internal faces will be in faceZone inlet_inlet_prtoutlet_outlet_prtCutFaceZone Any uncovered faces will remain in their patch Adding pointZone inlet_inlet_prtoutlet_outlet_prtCutPointZone at index 0 Adding faceZone inlet_inlet_prtoutlet_outlet_prtMasterZone at index 0 Adding faceZone inlet_inlet_prtoutlet_outlet_prtSlaveZone at index 1 Adding faceZone inlet_inlet_prtoutlet_outlet_prtCutFaceZone at index 2 Sliding interface parameters: pointMergeTol : 0.05 edgeMergeTol : 0.01 nFacesPerSlaveEdge : 5 edgeFaceEscapeLimit : 10 integralAdjTol : 0.05 edgeMasterCatchFraction : 0.4 edgeCoPlanarTol : 0.8 edgeEndCutoffTol : 0.0001 Reading all current volfields --> FOAM FATAL ERROR: Problem : Patch inlet_inlet_prt starts at 8008784 Current face counter at 17426001 Are patches in incremental order? From function polyTopoChange::polyTopoChange(const polyMesh& mesh, const bool strict) in file polyTopoChange/polyTopoChange/polyTopoChange.C at line 2442. FOAM aborting #0 Foam::error:rintStack(Foam::Ostream&) in "/usr2/shared1/OpenFOAM/milano/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/lib/libOpenFOAM.so" #1 Foam::error::abort() in "/usr2/shared1/OpenFOAM/milano/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/lib/libOpenFOAM.so" #2 Foam::polyTopoChange::addMesh(Foam::polyMesh const&, Foam::List<int> const&, Foam::List<int> const&, Foam::List<int> const&, Foam::List<int> const&) in "/usr2/shared1/OpenFOAM/milano/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/lib/libdynamicMesh.so" #3 Foam::polyTopoChange::polyTopoChange(Foam::polyMesh const&, bool) in "/usr2/shared1/OpenFOAM/milano/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/lib/libdynamicMesh.so" #4 Foam::polyTopoChanger::topoChangeRequest() const in "/usr2/shared1/OpenFOAM/milano/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/lib/libdynamicMesh.so" #5 Foam::polyTopoChanger::changeMesh(bool, bool, bool, bool) in "/usr2/shared1/OpenFOAM/milano/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/lib/libdynamicMesh.so" #6 main in "/usr2/shared1/OpenFOAM/milano/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/bin/stitchMesh" #7 __libc_start_main in "/lib64/libc.so.6" #8 Foam::UOPstream::write(char) in "/usr2/shared1/OpenFOAM/milano/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/bin/stitchMesh" /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.0.x | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 2.0.x-0751ac349341 Exec : stitchMesh -case ./MergeMeshes/ -perfect inlet_inlet_prt outlet_outlet_prt Date : Jul 24 2013 Time : 16:39:18 Host : cpi02968.c166.c.iav.de PID : 28885 Case : ./MergeMeshes nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Disallowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 4 Coupling perfectly aligned patches inlet_inlet_prt and outlet_outlet_prt Resulting (internal) faces will be in faceZone inlet_inlet_prtoutlet_outlet_prtCutFaceZone Note: both patches need to align perfectly. Both the vertex positions and the face centres need to align to within a tolerance given by the minimum edge length on the patch Adding faceZone inlet_inlet_prtoutlet_outlet_prtCutFaceZone at index 0 Reading all current volfields --> FOAM FATAL ERROR: Problem : Patch inlet_inlet_prt starts at 8008784 Current face counter at 17426001 Are patches in incremental order? From function polyTopoChange::polyTopoChange(const polyMesh& mesh, const bool strict) in file polyTopoChange/polyTopoChange/polyTopoChange.C at line 2442. FOAM aborting #0 Foam::error::printStack(Foam::Ostream&) in "/usr2/shared1/OpenFOAM/milano/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/lib/libOpenFOAM.so" #1 Foam::error::abort() in "/usr2/shared1/OpenFOAM/milano/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/lib/libOpenFOAM.so" #2 Foam::polyTopoChange::addMesh(Foam::polyMesh const&, Foam::List<int> const&, Foam::List<int> const&, Foam::List<int> const&, Foam::List<int> const&) in "/usr2/shared1/OpenFOAM/milano/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/lib/libdynamicMesh.so" #3 Foam::polyTopoChange::polyTopoChange(Foam::polyMesh const&, bool) in "/usr2/shared1/OpenFOAM/milano/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/lib/libdynamicMesh.so" #4 Foam::polyTopoChanger::topoChangeRequest() const in "/usr2/shared1/OpenFOAM/milano/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/lib/libdynamicMesh.so" #5 Foam::polyTopoChanger::changeMesh(bool, bool, bool, bool) in "/usr2/shared1/OpenFOAM/milano/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/lib/libdynamicMesh.so" #6 main in "/usr2/shared1/OpenFOAM/milano/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/bin/stitchMesh" #7 __libc_start_main in "/lib64/libc.so.6" #8 Foam::UOPstream::write(char) in "/usr2/shared1/OpenFOAM/milano/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/bin/stitchMesh" Last edited by wyldckat; August 17, 2013 at 15:29. Reason: Added [CODE][/CODE] |
|
July 25, 2013, 04:25 |
|
#16 |
New Member
Marcus
Join Date: May 2013
Posts: 15
Rep Power: 13 |
Or can i use another tool or function of Openfoam, that can solve this problem?
|
|
July 26, 2013, 10:55 |
|
#17 |
Senior Member
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 14 |
Hi,
I keep working on the sphere case. During the stitchMesh process, non orthogonal faces are created at the interface between the two meshes and they have a negative impact on the simulation. Does anyone knows how to avoid them? Regards, Eloïse |
|
August 18, 2013, 14:06 |
|
#18 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
@Marcus: Quote:
Either way, the problem with your case is that the mesh seems to be badly damaged on the lower part, which leads the 2 patches to not being in full contact, which is likely why you are getting those error messages. If you had a very simple and small example of your case that gives the same error, it would be the best. Otherwise, only by seeing the case for myself. @Eloïse: Quote:
Bruno
__________________
|
|||
August 20, 2013, 05:20 |
|
#19 |
Senior Member
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 14 |
Hi Bruno,
My case is actually the following: I measure the lift and drag on an object placed in a steady uniform flow for several hundreds orientations. Before, I was re-meshing the object for each flow orientation. What I'd like to do is to have the object meshed in a sphere, so that I just need to rotate the sphere and merge it to the outer mesh to get the appropriate flow orientation. It saves a lot of time! 2. I actually don't need an interface. Once the meshes are merged, there shouldn't be any influence from the interface on the flow. 1. I use simpleFoam. I compared results obtained with the previous meshing approach (which I use as reference) and the merging approach and I get some differences in lift and drag. I'm actually not sure what the differences are due to:
If you have any recommendations for this kind of case, they are welcome Regards, Eloïse |
|
August 21, 2013, 11:34 |
|
#20 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Eloïse,
Nice! Although keep in mind that the quality of the mesh on the interface might interfere with the results, no matter how good it is. Nonetheless, your description seems to be what I was hoping for, namely that you can use "cyclicAMI" patches, without the need for stitching! Have a look at this post: http://www.cfd-online.com/Forums/ope...tml#post446517 post #184 The idea is that for using "cyclicAMI" patches, you don't need a solver that has dynamic mesh capabilities. You only need dynamic mesh capabilities if you wanted to change the angle orientation during the simulation. But since you don't want to, you can even use moveDynamicMesh for only moving the mesh between each run! My advice is to move only one iteration, based on the time 0; but you might even want to try and use the fields from the previous run to start them for the next simulation, as long as the angle change is small. Although, I think using transformPoints with the option "-region" might be easier than using moveDynamicMesh. Best regards, Bruno
__________________
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[mesh manipulation] stitchMesh perfect vs partial | Eloise | OpenFOAM Meshing & Mesh Conversion | 2 | October 25, 2017 11:47 |
[mesh manipulation] stitchMesh: multiple meshes | GerhardHolzinger | OpenFOAM Meshing & Mesh Conversion | 3 | August 25, 2017 13:43 |
[mesh manipulation] StitchMesh sigFpe / bad point | liquidspoon | OpenFOAM Meshing & Mesh Conversion | 2 | November 29, 2015 15:19 |
[snappyHexMesh] SnappyHexMesh and StitchMesh | New_OpenFOAM_user | OpenFOAM Meshing & Mesh Conversion | 1 | September 7, 2014 17:53 |
[mesh manipulation] stitchMesh | dhruv | OpenFOAM Meshing & Mesh Conversion | 13 | February 23, 2012 18:14 |