|
[Sponsors] |
Run-time postprocessing - incorrect flow rate through faceZone |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 22, 2013, 13:39 |
|
#21 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
OK. Because usually when a cellSet looks like this the mesh has been reordered. The definition of the slaveCells is that they should all be on one side of the faceSet (to say "this is left"). From the picture you show it is not clear to me where the faceSet would be. It looks to me like for instance the one cell on the left "string" is on an inconsistent side compared to the others (and several others too). In that case a wrong mass-flow is perfectly explainable (as for instance this one face contributes with the wrong sign to the sum)
__________________
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, 16:24 |
|
#22 | |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Quote:
|
||
October 23, 2013, 02:57 |
|
#23 | |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Quote:
Above are the cells for one faceZone which is marked red. So you say for one faceZone the slaveCells should be all on the same side. I thought it is normal if the cells are on different sides marking one side as positive and the other as negative and consider this for the flux calculation. The question is why are some cells on the right side? Below is the code from topoSetDict I use for creating the zones. Code:
actions ( { name inte_1SlaveCells; type cellSet; action new; source faceZoneToCell; sourceInfo { name inte_1; option slave; } } ) |
||
October 26, 2013, 06:24 |
|
#24 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
@Daniel: If I remember this correctly, in order to define a "faceZone", one needs to have a "faceSet" and a "cellSet", where:
This is basically because a "set" only indicates a selection and a "zone" indicates a part of the mesh that acts as a ghostly geometry/mesh sub-domain, which means that the normals to that geometry are important. Best regards, Bruno
__________________
|
|
October 26, 2013, 07:37 |
|
#25 | |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Quote:
Afterwards I create the inte_*SlaveCells cellSets with topoSetDict by specifying the faceZones. So it seems instead of selecting just one side (the slave side as specified in topoSetDict) the cells on all sides are selected. |
||
October 26, 2013, 08:22 |
|
#26 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
You can diagnose which exact cells have been selected by running:
Code:
foamToVTK -cellSet inte_1SlaveCells
__________________
|
|
October 27, 2013, 02:37 |
|
#27 | |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Quote:
|
||
October 27, 2013, 04:09 |
|
#28 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Quote:
And since I didn't know which reader for ParaView you were using, I assumed the worst case scenario, hence suggesting foamToVTK. Then the picture in the post #18 is of the cellSet from which the faceZones are derived from? If so, is that cellSet created by HyperMesh? Because if it is, then it's a bug in HyperMesh. I say this because the normals for the faceZones are calculated based on the centers of the cells on the provided cellSet.
__________________
|
||
October 27, 2013, 09:55 |
|
#29 | |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Quote:
I also do not understand why I have to create the slaveCells cellSet as the face orientations are already there. In the faceZones file exported there is a flipMap after each faceZone which defines the orientation of the individual faces. |
||
October 27, 2013, 15:35 |
|
#30 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Daniel,
Sorry for making you repeated yourself once again I re-read the posts now and had a better look into the case you had shared with me. Hopefully I didn't miss anything this time. And my conclusion is the same as Bernhard's: Quote:
Now, in order to fix this problem, the change will likely have to be done prior to running the simulation Although if the renumber is identical, you might be able to copy the fixed "faceZones" file from a another case folder where the mesh was renumbered from the original. As for the fixed renumbered mesh, I have not tested this, but it seems that renumberMesh can use a dictionary file, as exemplified at "applications/utilities/mesh/manipulation/renumberMesh/renumberMeshDict": https://github.com/OpenFOAM/OpenFOAM...numberMeshDict - it seems to have options that might helped preserve the flipMaps for the faceZones. As for the necessity for the cellSets by swak4Foam: I have no idea. I can only guess that the pre-identified cells can help have a faster calculation, instead of having to infer said set from the faceZones... possibly at the start or on each iteration. Either way, as I wrote before, there is a relation between faceZones and cellSets, and that's for assigning the normals to the faceZones. Best regards, Bruno
__________________
|
||
October 28, 2013, 19:03 |
|
#31 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
A B 1 2 C D Now if A is the owner of 1 and D the owner of 2 then the faceNormal of 1 points down and 2 up (or the other way round; I keep forgetting). That means in order to get consistent mass flows we need the flip-field. For a faceZone this is already defined and swak is content (of course you depend on the preprocessing utility to define it correctly. If the programmer was lazy the flip is set to some arbitrary value). No cellSet needed faceSets have no flip-information. Therefor the slave-cellSet is needed (in our case that would be either AB or CD) to get directional information. The cellSet is only used by swak the first time that the flip-map is constructed
__________________
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 29, 2013, 07:43 |
|
#32 | ||
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Quote:
However one strange thing happened: If you remember the table with the results for the different postprocessing methods I posted in comment #16. The results for case Swak4Foam2 were I did not use flip were correct. Now without renumbering I get the same wrong results as for the OpenFOAM and Swak4Foam1 method. The results for the other methods remain the same. Maybe this is related to the following observation. The flipMaps from the faceZones exported from Hypermesh all look like this: Code:
flipMap List<bool> 372{1}; To find this out I manually switched the flipMaps back to being all 1 for zone inte_1 and inte_2. Now all postprocessing tools report the same correct mass flow. So it looks like renumberMesh is flipping some orientations it should not flip. However if do not run renumber there is something wrong as well. Am I going crazy? Quote:
|
|||
October 29, 2013, 07:46 |
|
#33 | |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Quote:
|
||
October 29, 2013, 12:05 |
|
#34 | |
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 29, 2013, 19:23 |
|
#35 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Quote:
The other idea is to fall back to the safest bet: define in HyperMesh the cellSets and faceSets and then use OpenFOAM to create its own faceZones. If this fails, then something veeery wrong is going on
__________________
|
||
October 30, 2013, 06:20 |
|
#36 | |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Quote:
Regarding falling back to the safest bet, I currently have no idea ho to define faceSets and cellSets in Hypermesh. |
||
October 30, 2013, 06:21 |
|
#37 | |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Quote:
|
||
October 30, 2013, 06:51 |
|
#38 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
But it writes Zones? Then you can always use the topoSet-utilitiy to create the corresponding sets from that. That would be the ultimate proof that the flip generated by Hypermesh is wrong: build sets (including the slave-cellZone). Use them to generate a new faceZone and check if the flip-field is uniform for that too
__________________
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 30, 2013, 09:35 |
|
#39 | |
Member
Daniel Pielmeier
Join Date: Apr 2012
Posts: 99
Rep Power: 14 |
Quote:
From this I did create a faceZone from only the faceSet, another one from the faceSet and the slaveCells and a third one from the faceSet and the ownerCells. Create slaveCells from faceZone: Code:
{ name inte_1SlaveCells; type cellSet; action new; source faceZoneToCell; sourceInfo { name inte_1; option slave; } } Code:
{ name inte_1Faces; type faceSet; action new; source zoneToFace; sourceInfo { name inte_1; } } Code:
{ name inte_1OwnerCells; type cellSet; action new; source faceToCell; sourceInfo { set inte_1Faces; option owner; } } Code:
{ name inte_1faceZone1; type faceZoneSet; action new; source setToFaceZone; sourceInfo { faceSet inte_1Faces; } } Code:
{ name inte_1faceZone2; type faceZoneSet; action new; source setsToFaceZone; sourceInfo { faceSet inte_1Faces; cellSet inte_1SlaveCells; } } Code:
{ name inte_1faceZone3; type faceZoneSet; action new; source setsToFaceZone; sourceInfo { faceSet inte_1Faces; cellSet inte_1OwnerCells; } } flipMap List<bool> 372{1}; and the flipMaps of the tree created faceZones like this: faceZone1 flipMap List<bool> 372{0}; faceZone2 flipMap List<bool> 372{1}; faceZone3 flipMap List<bool> 372{0}; With renumbering the flipMap of the exported faceZone looks like this: inte1.txt and the flipMaps of the tree created faceZones like this: faceZone1 flipMap List<bool> 372{0}; faceZone2 identical to the attached faceZone faceZone3 flipMap List<bool> 372{0}; I don't know which conclusion I should draw from this. faceZone2 from the faceSet and the slaveCells is always identical to the exported or renumbered one. For the other two faceZones the renumbering does not affect the result i.e. they are the same as without renumbering. But I guess only the method which creates faceZone2 is important. |
||
November 1, 2013, 19:57 |
|
#40 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
(I hope I didn't miss anything this time.) If my memory doesn't fail me, this geometry wasn't very complex on the face zone locations; more specifically, the faceZones were oriented with a particular axis orientation. Therefore, you can simply do this:
The tutorial "heatTransfer/buoyantSimpleFoam/circuitBoardCooling" is a good example of this. Best regards, Bruno
__________________
|
|
|
|
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 |