|
[Sponsors] |
[mesh manipulation] refineMesh Problems: strange cells/cuts were added |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 18, 2015, 07:01 |
refineMesh Problems: strange cells/cuts were added
|
#1 |
New Member
Björn N.
Join Date: Jun 2013
Posts: 11
Rep Power: 13 |
Hello together!
I tried to refine my mesh via the refineMesh in OpenFoam 2.3.0. My mesh has a cylinder, surrounded by cuboid. As you can see in the pictures there is a problem with the inner cells. I used patchLocalCoeffs as follows: Code:
patchLocalCoeffs { // Normal direction is face normal of zero'th face of patch patch front; tan1 ( 1 0 0 ); tan2 ( 0 1 0 ); } Code:
***Concave cells (using face planes) found, number of cells: 142 <<Writing 142 concave cells to set concaveCells Thanks a lot for your help! |
|
December 19, 2015, 14:38 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quick questions:
__________________
|
|
December 21, 2015, 06:54 |
|
#3 |
New Member
Björn N.
Join Date: Jun 2013
Posts: 11
Rep Power: 13 |
Hello Bruno,
I created 2 reduced test-cases (One for both sides, because of the different amount of cells). The error can be reproduced with the following commands: Code:
blockMesh topoSet -dict system/topoSetDict_refine refineMesh -dict system/refineMeshDict Thanks a lot for your help! |
|
January 2, 2016, 09:01 |
|
#4 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Björn and a Happy New Year!
I finally bring good news on this! The solution is to change the referential you're using from this: Code:
patchLocalCoeffs { // Normal direction is face normal of zero'th face of patch patch front; tan1 ( 1 0 0 ); tan2 ( 0 1 0 ); } Code:
patchLocalCoeffs { // Normal direction is face normal of zero'th face of patch patch front; tan1 ( 1 1 0 ); tan2 ( -1 1 0 ); }
This is why using a different direction referential solved the problem, since the new referential is more closely aligned with the desired cuts. As a fun fact, if we use the original referential and the 3 directions: Code:
directions ( tan1 tan2 normal ); As for diagnosing this, it took me quite a while to debug it I assumed that this was a bug, so it took something like 4 to 6 hours to diagnose, spread across a few days (hence taking a bit longer to restart where I left off the day before). I spotted a few issues and I will propose a bug fix of it... even if it's just warning messages with a suggestion for a fix for the user. edit: Bug/feature report submitted: http://www.openfoam.org/mantisbt/view.php?id=1960 Best regards, Bruno
__________________
Last edited by wyldckat; January 2, 2016 at 12:15. Reason: see "edit:" |
|
January 4, 2016, 06:33 |
|
#5 |
New Member
Björn N.
Join Date: Jun 2013
Posts: 11
Rep Power: 13 |
Hi Bruno! Happy New Year!
thanks a lot for your time and help, I really appreciate it. So when I use refineMesh on the quadrant it works really well, but unfortunately I need to refine at least a semi-circle. This is because my geometry, in a bigger picture, doesnt have enough symmetry for a quadrant. As you can see in the attached pictures, the new patchLocalCoeffs only shift the problem to the global coordinates.(I have used parafoam -builtin for rendering now) Do you think there is also an opportunity to mesh semi or full circles? Many greetings! Björn |
|
January 4, 2016, 18:35 |
|
#6 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quick answers:
That alone isn't enough. The detail is that you must use the Polyhedron representation. The wiki page explains how this is used for each reader (.OpenFOAM vs .foam). Quote:
Code:
tan1 (1 0.5 0); tan2 (-0.5 1 0); Code:
tan1 (1 0.5 0); tan2 (1 -0.5 0); If this doesn't work, then we'll need to implement some way to make the orientations uniform with the original mesh... something like refining all 2 or 3 directions at the same time, instead of doing each direction, one at a time
__________________
|
||
January 5, 2016, 06:17 |
|
#7 |
New Member
Björn N.
Join Date: Jun 2013
Posts: 11
Rep Power: 13 |
Hi Bruno!
I tried the following configurations for the patchLocalCoeffs (I attached the pictures): Code:
A: tan1 ( 1 0 0 ); tan2 ( 0 1 0 ); Code:
B: tan1 ( 1 1 0 ); tan2 ( -1 1 0 ); Code:
C: tan1 (1 0.5 0); tan2 (-0.5 1 0); Code:
D: tan1 (1 0.5 0); tan2 (1 -0.5 0); Code:
E: tan1 (1 0.1 0); tan2 (1 -0.1 0); Code:
F: tan1 (1 0.5 0); tan2 (-1 0.5 0); |
|
January 5, 2016, 06:19 |
|
#8 |
New Member
Björn N.
Join Date: Jun 2013
Posts: 11
Rep Power: 13 |
and the picture of the latest formation...
|
|
January 6, 2016, 19:00 |
|
#9 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Björn,
Then the only solution I can think of, will require programming into OpenFOAM. I'll try to have a solution for this on the upcoming weekend. Best regards, Bruno
__________________
|
|
January 8, 2016, 09:31 |
|
#10 |
New Member
Björn N.
Join Date: Jun 2013
Posts: 11
Rep Power: 13 |
Hi Bruno!
thank you so much for your help! By now I use a workaround, without refining the mesh. Of course it is still interesting how non-trivial meshes can be refined. Best regards, Björn |
|
February 21, 2016, 13:07 |
|
#11 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Björn,
Sorry for the late reply, but only today did I finally manage to complete the contribution for refineMesh: http://www.openfoam.org/mantisbt/view.php?id=2004 A ton of details are provided there-in, but if you want, I can provide a custom utility that does the same features as the contribution. Although I need you to remind me which OpenFOAM version you are using, if you still need this. Best regards, Bruno
__________________
|
|
February 29, 2016, 07:44 |
|
#12 |
New Member
Thorben Schröder
Join Date: Feb 2016
Posts: 2
Rep Power: 0 |
Hello Bruno,
I am working with Björn and answering in his behalf since he is not availlabe at the moment. Thank you so much for your great work! It is great seing you put so much effort into this. In fact, we are still interested eventhough we worked arround the problem in one case. There will be others following where we can't. We use OF 2.3.0 at the moment but installing a newer version for the refineMesh would be possible as well. Best regards ans thanks again, Thorben |
|
October 2, 2017, 22:23 |
|
#13 |
Member
Sugajen
Join Date: Jan 2012
Location: Tempe, USA
Posts: 52
Rep Power: 14 |
Hi all,
This looks like an old post but I thought you guys will be able to give some guidance on my similar issue. I am trying to refine my entire geometry using refineMesh. But it throws a lot of warnings. It also creates a bunch of .obj files like anchors_169445.obj, cell_830619.obj,cellLoop_655655.obj while refining. I tried changing the directions as done in posts above but no luck. Is there anything in particular that should be changed in the refineMeshDict ? or is it geometry specific ? Any help will be very helpful refineMeshDict Code:
FoamFile { version 2.0; format ascii; class dictionary; location "system"; object topoSetDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // actions ( { name forRefinement; type cellSet; action new; source boxToCell; sourceInfo { box (0.02411732 0.01826876 -0.09695647) (0.05348801 0.04984307 -0.05463678); } } ); Code:
--> FOAM Warning : From function void Foam::cellCuts::setFromCellCutter(const Foam::cellLooper&, const Foam::List<Foam::refineCell>&) in file meshCut/cellCuts/cellCuts.C at line 2241 Found loop on cell 208 that resulted in an unexpected bad cut. Suggestions: - Turn on the debug switch for 'cellCuts' to get geometry files that identify this cell. - Also keep in mind to check the defined reference directions, as these are most likely the origin of the problem. Sugajen |
|
October 31, 2018, 10:52 |
|
#14 | |
Senior Member
Lukas Fischer
Join Date: May 2018
Location: Germany, Munich
Posts: 117
Rep Power: 8 |
Hi,
I want to address two issues with the refineMesh utility. I am using OpenFOAM 4.1. 1.) First of all I, do not really understand the use of the patchLocalCoeffs after switching to coordinateSystem patchLocal. At https://openfoamwiki.net/index.php/RefineMesh there is a description of a refineMeshDict. On the one hand it states that the coordinate system is DIFFERENT for every cell when the patchLocalCoeffs is used and on the other and it states that the normal direction is the face normal of zero'th face of patch (hence all the cells have the SAME coordinate system). In my opinion, this would only be true if the normal direction of the face normal of the zero’th face of the patch is the same for all cells. Therefore, I do not understand the comment of wyldckat with respect to bjoern1’s issue. He uses the front patch to define the normal vector which should lead to a normal vector with the components of ( 0 0 1 ) in the example. Hence, this resulting normal vector would be the same if a global coordinate system is be used with the definition of tan1 ( 1 1 0 ) and tan2 ( -1 1 0 ). Moreover, why is it necessary to define a second direction tan2? I thought to only define the patch to get the patches normal (either of the zero’th face of the path or of all cells) and to define tan1. In an orthogonal coordinate system the direction tan2 would be defined due to tan1 and the defined normal vector. 2.) I am trying to refine a mesh. My aim is to refine a mesh at custom locations as often as I want. I refine the locations of the mesh by selecting cells using a topoSetDict and then I use a refineMeshDict to cut those cells. By repeating this process I can get the refinement level I need. When refining a region the cells in the topoSet region are hexahedron cells but at the border of the topoSet the cells turn into polyhedron cells. I think that this is going to be the problem I have. The problem occurs when the cells are not perfectly rectangular to each other. Hence, I have uploaded two test cases to show you my issue. The cases are called 0_understandRefineMesh and 1_understandRefineMesh. Use the Allrun script to create the final mesh. Basically I use these commands: Quote:
Code:
topoSet -dict system/topoSetDict.globalRefinement2 refineMesh -dict system/refineMeshDict.globalRefinement2 topoSet -dict system/topoSetDict.globalRefinement1 refineMesh -dict system/refineMeshDict.globalRefinement1 Hence, there is no problem in the case 0_understandRefineMesh because there are only rectangular cells in the mesh. The case 0_understandRefineMesh represents a square cube (perf_cube_3). In 1_understandRefineMesh one side of the cube is slightly skewed, which results in skewed cells on two sides of the cube. Here the order of the commands is important. (Allrun_wrong_command_order will not work perfectly and ugly cells are created!) Last edited by lukasf; November 6, 2018 at 03:40. |
||
November 1, 2018, 13:17 |
|
#15 | |||||||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
@Sugajen: I hope you've solved you issue since then. Without more specific details, it's nearly impossible to deduce what went wrong exactly. @Lukas: Wow, OK, it's going to take me a while to answer to all of these... here we go: Quote:
Quote:
Quote:
Er... OK, the idea is that every cell will abide to the normal reference of the first face of the specified patch, instead of using the world reference (XYZ). Quote:
Imagine that the reference patch is at a 60 degree angle of the majority of the cells. This means that having an orthogonal angle would not properly catch the desired slicing directions; the detail here is that in that context, it was for an hex-cut, i.e. slice the cell in a perfect half in function of the slice plane. Not much of an explanation, was it... sorry, let me know if you want me to draw an explanation in more detail on what I'm referring to. Quote:
Quote:
I vaguely remember that the only way to avoid problems on these interface regions, is to refine them Matrioska-dolls-style (one inside the other). Having a proportion higher than 1 cell to 4 faces can lead to serious simulation problems, so I believe that this is why it is not properly supported by refineMesh nor refineHexMesh. Quote:
OK, just by looking at the images, it's already possible to see the problems I've also pointed out... I've inspected the cases and the respective refinement dictionary files and it is due to the algorithm not knowing what to do exactly with a non-hex cell, in order to try and divided it as if it were an hex, so it follows the default geometric-cut protocol that abides to the defined directions. In pure-hex mode, it follows the directions as a rough guidance on which planes to cut across, i.e. if the mesh is orthogonal along (1 0 0) and you give the direction (0.95 0.05 0.05), it will still catch the direction (1 0 0) since it's the closest one. This was also why I had to implement and contribute the custom direction field capabilities that were contributed on report https://bugs.openfoam.org/view.php?id=2004 - and which should already be present in OpenFOAM 4. This way you have more control over the direction of how each individual cell is divided. I think I've answered to all your questions? Best regards, Bruno
__________________
|
||||||||
November 2, 2018, 06:18 |
|
#16 | |||||
Senior Member
Lukas Fischer
Join Date: May 2018
Location: Germany, Munich
Posts: 117
Rep Power: 8 |
Hi Bruno,
thank you very much for your quick and detailed reply. I really appreciate it. Quote:
Quote:
Quote:
Quote:
My "wish" would be to be refine whereever the user needs it. One could prevent a flux of lots of small cells into a bigger cell by planning smooth transitions from high refined mesh regions to low refined regions using several topoSets. In my application I like to refine regions in just one direction and in other, adjacent regions to refine all three or just two directions. This is not possible in a mesh which does not have only rectangular cells. Quote:
Best regards, Lukas Last edited by lukasf; November 2, 2018 at 07:41. |
||||||
Tags |
refinemesh |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[ICEM] Problems with coedge curves and surfaces | tommymoose | ANSYS Meshing & Geometry | 6 | December 1, 2020 12:12 |
[mesh manipulation] checkMesh Erros after refineMesh | mgdenno | OpenFOAM Meshing & Mesh Conversion | 10 | October 14, 2014 06:16 |
Im having some strange problems here | xTamx420 | FLUENT | 0 | June 1, 2011 16:00 |
Problems initializing a turbulence model | srinath | OpenFOAM Running, Solving & CFD | 3 | November 27, 2008 11:06 |
[Commercial meshers] Tgrid tetra mehs with problems | braennstroem | OpenFOAM Meshing & Mesh Conversion | 2 | June 18, 2007 04:39 |