|
[Sponsors] |
|
August 24, 2021, 10:12 |
Loop over faces of cell
|
#1 |
Member
Chris
Join Date: Dec 2020
Posts: 45
Rep Power: 5 |
Hey,
I have a surfaceScalarField phi2 which is kind of same like flux phi from U. Now I would like to combine phi and phi2 in another field phiFinal. To decide, which value of phi/phi2 needs to be added, I loop over all cells and check the value of my volScalarField A inside this cell. How can I change the values? At the moment I just know how to get the faces of my cell like this Code:
forAll(A,celli) { const labelList& faces = mesh.cells()[celli]; // returns "6(a b c d e f)" if(A[celli] < 0) { // Now I would like to add phi_face_value to phi3_face_value } else { // Now I would like to add phi2_face_value to phi3_face_value } } Thanks in advance Chris. |
|
August 27, 2021, 14:59 |
|
#2 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15 |
A face has always two cells which it is bounding. On which cell owner or neighbor you want to base your I else statement?
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] Add Mesh Layers doesnt work on the whole surface | Kryo | OpenFOAM Meshing & Mesh Conversion | 13 | February 17, 2022 07:34 |
[snappyHexMesh] Help with Snappy: no layers growing | GianF | OpenFOAM Meshing & Mesh Conversion | 2 | September 23, 2020 08:26 |
[snappyHexMesh] layer not added | Rasmusiwersen | OpenFOAM Meshing & Mesh Conversion | 1 | January 2, 2020 09:43 |
Need help setting up chtMultiRegion | OskarT | OpenFOAM Pre-Processing | 1 | September 25, 2019 15:51 |
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops | avinashjagdale | OpenFOAM Meshing & Mesh Conversion | 53 | March 8, 2019 09:42 |