|
[Sponsors] |
How to find downwind cells of a cell in OpenFOAM ? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 20, 2019, 05:40 |
How to find downwind cells of a cell in OpenFOAM ?
|
#1 | |||
Member
Paul Palladium
Join Date: Jan 2016
Posts: 93
Rep Power: 10 |
Dear Foamers
I would like to know how to find the downwind cells of a cell. As mentionned here : owner and neighbor #4 : Quote:
At the moment I do the folowing thing : Quote:
So I suppose I am doing wrong something. Has anyone an idea how to solve this problem ? Another question : what is the difference between Quote:
Huge thanks |
||||
October 7, 2019, 07:36 |
|
#2 |
Member
Fabien Robaux
Join Date: Oct 2016
Posts: 51
Rep Power: 10 |
Hi,
I think there is a problem with your indices, you should do own[faces[facei]] instead of faces[facei] if you want the owner cell of the facei-th face of the cell. Same applies to Phi[facei]=> Phi[faces[facei]]. (otherwise facei goes from 1 to not much - like 10 max) I think that a positive flux goes from owner to neighbor just means that, when the flux is positive, the flow effectively goes from owner to neighbour. When it is negative, the flow is reversed. Basically, that just means that the normal of a face is oriented outwards (from its owner to its neighbour) for the faceNeighbour() vs neighbour() I don't know where you find the "neighbour()" function. faceNeighbour()[f] is returning the neighbouring cell of the face of label f (again you should use "label f=faces[facei]"). I hope I'm clear, Fabien |
|
October 8, 2019, 09:58 |
|
#3 | ||
Member
Paul Palladium
Join Date: Jan 2016
Posts: 93
Rep Power: 10 |
Dear Frobaux,
Thank you for you message. I am going to use your solution and see if it's ok. Since my first message I found out that in isoadvector there is a function wich seems to calculate downwindFaces : Quote:
For example in the code of linearUpwind : The build of the surfaceScalarField returned by the "correction" function is obtained by looping over all faces of the mesh. From my understanding there is no [faces[facei]]. Clearly I am missig something. Could you go more in details please ? Quote:
P |
|||
October 8, 2019, 10:09 |
|
#4 |
Member
Fabien Robaux
Join Date: Oct 2016
Posts: 51
Rep Power: 10 |
Yes, you are right faceNeighbour() is defined in polyMesh.H and neighbour() is defined in fvMesh.H. I don't know the difference, but as fvMesh is a child of polyMesh, you have access to both of them..
and the same is true for owner() and faceOwner() by the way. However be careful, the type they return are different, faceOwner returns a list of face when owner returns a list of labels. The difference between your code and the downwind cell is the indexing: you do Code:
forAll(c, fi) // fi goes from 0->8 if 8 faces on cell c const scalar phi = faceValue(phi_, fi); // whatever the cell, you wil get only phi[0] .. phi[8] so the 8 first flux of the faces of mesh if (own[fi] == celli) { .... } } Code:
forAll(c, fi) const label facei = c[fi]; // for the, lets say 3rd face of the cell c, c[3] is the global index of that face! const scalar phi = faceValue(phi_, facei); if (own[facei] == celli) { .... } } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] snappyHexMesh sticking point | natty_king | OpenFOAM Meshing & Mesh Conversion | 11 | February 20, 2024 10:12 |
Map of the OpenFOAM Forum - Understanding where to post your questions! | wyldckat | OpenFOAM | 10 | September 2, 2021 06:29 |
[blockMesh] Create internal faces as patch in blockMesh | m.delta68 | OpenFOAM Meshing & Mesh Conversion | 14 | July 12, 2018 15:43 |
interFoam running blowing up | sandy13 | OpenFOAM Running, Solving & CFD | 2 | May 5, 2015 08:16 |
Suggestion for a new sub-forum at OpenFOAM's Forum | wyldckat | Site Help, Feedback & Discussions | 20 | October 28, 2014 10:04 |