|
[Sponsors] |
Run-time postprocessing - incorrect flow rate through faceZone |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 3, 2013, 08:45 |
Run-time postprocessing - incorrect flow rate through faceZone
|
#1 |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Hello,
I try to post-process the flow rate through different faceZones. The solver is simpleFoam and the mesh consists of mostly hexaeders, difficult geometric areas are meshed with tetraeders. There is one inlet (turbulent flow profile created with groovyBC) which splits into two separate channels and combines again. This happens three times in total and afterwards there is an outlet (fixed pressure). geo1.jpggeo2.jpggeo3.jpg Above pictures show the geometry with the flow direction and the position of the faceZones for evaluating the flow rate. Due to the flow not approaching symmetrical before the split I expect a different flow rate in the splits. However the sum should always be the flow rate of the inlet. What I get now is correct sums for the splits 3+4 and 5+6 but the sum for the split 1+2 is only about 75% of the total flow rate. flow_rate.png From the picture above it is clearly visible that split 1+2 are misbehaving in some way as they should be both in the same range (3e-5) like the other four splits. I tried postprocessing with swakExpression (swak4foam) and OpenFOAM's fieldFunctionObjects but the results are the same. So I assume there must be something wrong with the mesh. I deleted parts of the mesh around the faceZones and remeshed them which gave me correct values for other splits but wrong ones which were correct before. The mesh was created by Hypermesh and exported to OpenFoam format. I had the same problems when exporting to fluent format first and converting the mesh using fluent3DMeshToFoam. I have no clue how to debug this. Maybe someone can give me a hint. |
|
October 4, 2013, 09:24 |
|
#2 |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
This is definitely a problem with the mesh. I did create a new mesh (only tetraeder) for the same geometry and now the flow rates are reported correct. Is there any way to find out what is wrong with the previous mesh?
|
|
October 5, 2013, 09:16 |
|
#3 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Greetings Daniel,
Without a snapshot of what the mesh looks like and the values in the relevant cells, I'm only able to suggest two things:
Bruno
__________________
|
|
October 5, 2013, 10:41 |
|
#4 | ||
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Hi Bruno,
thanks for the response. Quote:
Quote:
In addition to the first mesh which produces the wrong results and the tetaeder only mesh which reports the flow rate correct I have created a mesh with a prism boundary layers and a tetraeder core. This one also produces wrong results for the flow rate at the faceZones. The results for Velocity and Pressure look sane for all meshes. I can report this to Altair. However if I know what is wrong with their meshes it is likely to be fixed earlier. Do you need the complete mesh or just the information about the faceZones. |
|||
October 6, 2013, 11:40 |
|
#5 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Daniel,
I only need to have a look at the surface mesh on both sides of the "faceZones". If you had values for those faceZones, with the representation "surface with edges", that would make it even if more clearer. Here's an example of my idea, although it uses surface mesh, not a faceZone: http://www.cfd-online.com/Forums/ope...tml#post451688 - check the attached images on post #6. Best regards, Bruno
__________________
|
|
October 7, 2013, 04:56 |
|
#6 | |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Quote:
In the meantime I will attach the faceZones colored by U and p. U_mag.jpgU_Y.jpgp.jpg |
||
October 7, 2013, 18:06 |
|
#7 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Daniel,
I had to re-read the whole thread again, to try and figure out what's happening. Quote:
Quote:
OK, my guesses are as follows:
Bruno
__________________
|
|||
October 8, 2013, 08:00 |
|
#8 | |||||
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Hi Bruno,
thank you very much for taking the time. Quote:
Quote:
Quote:
Quote:
Quote:
I will attach the flow rates for the three meshes I have created. The sum of the flow rates of split 1+2 should be 0.00006m3s. The same goes for split 3+4 and split 5+6. First the hexaeder mesh which includes tetraeders in some areas where a mapped mesh is not possible: hexaeder.png As you can see the sum for split 1+2 is lower than 0.00006m3/s (approx. 0.0000046m3/s). Split 3+4 and split 5+6 are okay (the same as for the tetraeder mesh below) Second the tetraeder only mesh: tetraeder.png Here the sums are all 0.00006m3/s as it should be. Third the tetraeder mesh with the boundary layer: tetraeder_boundary.png The strange thing is that the sums of split 1+2 are okay (the same as for the tetraeder mesh above) but now split 3+4 and split 5+6 are too low. So I guess there must be something with the mesh which affects the post-processing of the flow rate. PS: Regarding the fluctuations you are correct. For the tetraeder mesh with the boundary layer the flow rates are not that fluctuating compared to the other two meshes. |
||||||
October 13, 2013, 06:31 |
|
#9 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Daniel,
Attached are a couple of images that demonstrate how bad tetrahedral cells can be:
The idea is that tetrahedral cells can be used with success on OpenFOAM, but the mesh has to be perfectly uniform and well shaped, otherwise things will get bad fast enough. Of course that the same applies to hexahedral cells, as demonstrated on this post: http://www.cfd-online.com/Forums/ope...tml#post446350 post #17 - the image in question is this one: Don't mind the triangles, because it's a representation artifice used on ParaView. The cells are nicely shaped cubes, but the problem is that the change in the mesh refinement occurs in a very bad place, leading to having simulated flow that goes against the actual flow direction. In conclusion: you should closely analyse how the flow is behaving throughout all of your mesh, not just in the sections where you are monitoring the mass flow. Best regards, Bruno
__________________
|
|
October 18, 2013, 04:29 |
|
#10 |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
I took a look at the mesh and I still do not think this is related to the quality of the mesh. May I provide the meshes somewhere so you can take a look at them?
|
|
October 18, 2013, 04:52 |
|
#11 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Quick answer: You can upload it to DropBox or something similar and then send me the link through a private message, if your case is of a sensitive nature.
__________________
|
|
October 19, 2013, 07:15 |
|
#12 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Daniel,
I've received your PM and I've been taking a look at your case V7. Here's what I observed:
As checkMesh implies, this is overall a very nice mesh and seems very much like a very perfect mesh. And the solver is able to respect that and has very nice residuals as a result! But from the looks of the results themselves, it feels that those very suspicious cells are deforming the fluid flow, which can influence how the curvatures of the flow are shaped and the amount of fluid going through those curved flow ducts. The clear example of this is shown in the image "Suspect_05.jpg". Notes:
Bruno
__________________
|
|
October 19, 2013, 08:04 |
|
#13 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Daniel,
I was curious and took a look at the other meshes you also provided. Here's what I found out:
Bruno
__________________
|
|
October 19, 2013, 08:54 |
|
#14 |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Hi Bruno,
thanks for taking the time. Especially on the weekend I did not expect such a quick reply. It is surely possible to improve the mesh now even more with the help of your useful remarks. I already tried to convert my mesh to a polyhedra mesh but I got the same results as you, probably because of delaunay violations as mentioned in this post. It seems that polyDualmesh splits all hexaeders into eight Hexaeders and all Tetraeders into four hexaeders. This is why the mesh size increases that much. This also makes the mesh quality worse. Imagine a bad tetraeder split into four heaeders. The angles get even worse. You took a look an all three meshes and found issues for all of them. So the question is. Why are the fluxes reported correctly with the tetraeder mesh and not with the hybrid (hexaeder/tetraeder) and the mesh with the boundary layer. Just take a look at fluxes reported by running "gnuplot massfluxsplit.gnuplot" in the directories or take the latest outputs from log.simpleFoam. You can see the sums of split1+2, split3+4 and split5+6 are the same as the specified inflow rate (6e-05) for the tetraeder mesh but split1+2 are to low (4.5e-05) for the hexaeder mesh. For the boundary layer mesh the results are to low for split5+6 (2.9e-5). At the outlet the flux is correct again. So how can I insert a flux of 6e-05, split the flow where the sum is 4.5e-05 combine it again and have 6e-05 again. If there is such a discrepancy the residuals wouldn't be were they are. So I guess there is anything wrong with the reported values. As I measure with openfoam and swak4foam and the results are the same I guess there is something wrong with the mesh not related to the quality which only influences the reporting and nothing else. Additionally, V7 is the seventh variant of those geometries and up to this one I was meshing with the same meshing technique as for the hexaeder/tetraeder mesh you have seen and did not have problems like this. Well I had this some problems for some variants but remeshing with only slightly altered settings fixed it somehow. I was not able to do so for this seventh variant. This is another argument why I do not believe this is a mesh quality issue but something strange in the mesh produced by Hypermesh. PS: I currently run the Polymesh-Version of the boundary mesh and the results are the same as for the original mesh. |
|
October 19, 2013, 12:43 |
|
#15 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Daniel,
It's easier for me to answer on weekends Quote:
But as I meant to write on the previous post: the tetrahedral mesh with boundary layer is very coarse and the transition to the boundary layer might be too steep. Quote:
I believe that the V7 mesh you provided results for, can be improved in the transition zones and then provide the best solution. Good luck! Best regards, Bruno
__________________
|
|||
October 21, 2013, 11:40 |
|
#16 |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
I have found the problem, it is definitely related to the mesh but not the quality.
I tried different methods to calculate the flow rate. Code:
OpenFOAM { type faceSource; log yes; valueOutput false; source faceZone; sourceName inte_1; operation sum; fields ( phi ); } Swak4Foam1 { type swakExpression; valueType faceZone; outputControl outputTime; outputControlMode timeStep; outputInterval 1; zoneName inte_1; expression "phi*flip()"; accumulations ( sum ); verbose true; } Swak4Foam2 { type swakExpression; valueType faceZone; outputControl outputTime; outputControlMode timeStep; outputInterval 1; zoneName inte_1; expression "phi"; accumulations ( sum ); verbose true; } Swak4Foam3 { type swakExpression; valueType faceZone; outputControl outputTime; outputControlMode timeStep; outputInterval 1; zoneName inte_1; expression "mag(U & Sf())"; accumulations ( sum ); verbose true; autoInterpolate true; } Swak4Foam4 { type swakExpression; valueType faceZone; outputControl outputTime; outputControlMode timeStep; outputInterval 1; zoneName inte_1; expression "mag(U.y * area())"; // faceZone lies in the xz-plane accumulations ( sum ); verbose true; autoInterpolate true; } results.png It looks like there is a problem with face flipping for split 1 and split2. OpenFOAM seems to flip the face automatically. If I remove face flipping in swak4foam (Swak4Foam1 vs. Swak4Foam2) the results are correct (all sums are 6.0e-5). So there must be anything wrong with the mesh and it is not a bug in OpenFOAM else the results would be wrong for all splits. Now how to find the bug in the mesh? |
|
October 21, 2013, 18:14 |
|
#17 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Daniel,
Nice catch! "faceZone" normals... it should be the "faceZone" normals that are somehow broken. You can try something that sometimes fixes crazy mesh issues in OpenFOAM: Code:
transformPoints -translate '(1 0 0)' transformPoints -translate '(-1 0 0)' How exactly was that "faceZone" created? Best regards, Bruno
__________________
|
|
October 22, 2013, 03:52 |
|
#18 | |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Quote:
slaveCells.jpg The SlaveCells marked red are the ones for split1 and split 2. As you can see for the other four splits all cells are at the same side so no flipping is required. The flipMap in constant/polyMesh/faceZones also shows that the faces of split 1 and split 2 have different orientations while the others do not. This is the reason why split 3 to 6 work even if flipping is applied. Now I believe there is a bug in OpenFOAM and also swak4foam as they both fail to correctly flip the directions. Well I made the faceZones in Hypermesh were I simply created Surface-Elements on the relevant faces of the the previously existing volume mesh. |
||
October 22, 2013, 09:57 |
|
#19 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
October 22, 2013, 10:03 |
|
#20 | |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Quote:
This is why creating the sets is the last operation I run on the decomposed case before actually solving the case. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Transient simulation not converging | skabilan | OpenFOAM Running, Solving & CFD | 14 | December 17, 2019 00:12 |
High Courant Number @ icoFoam | Artex85 | OpenFOAM Running, Solving & CFD | 11 | February 16, 2017 14:40 |
dynamic Mesh is faster than MRF???? | sharonyue | OpenFOAM Running, Solving & CFD | 14 | August 26, 2013 08:47 |
same geometry,structured and unstructured mesh,different behaviour. | sharonyue | OpenFOAM Running, Solving & CFD | 13 | January 2, 2013 23:40 |
Velocity of flow v time | MitsubishiEvo6 | FLUENT | 0 | August 31, 2012 00:51 |