|
[Sponsors] |
File structure of surfaceScalarField in output |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 11, 2016, 04:09 |
File structure of surfaceScalarField in output
|
#1 |
Member
Lennart
Join Date: Feb 2016
Posts: 46
Rep Power: 10 |
Hey,
I need to do some custom post-processing and would like to read the output files with a script. In this case, I have a 2D simulation with a mesh, let's say 20x20, resulting in 400 cells. I can easily read a volScalarField file with 400 lines between Code:
internalField nonuniform List<scalar> 400 ( >> all my data << ); A surfaceScalarField has 760 entries: all internal faces without the boundary faces. How are the faces stored in this file? E.g. how can I relate a line in the file to the horizonal/vertical face of cell (i,j)? I tried various approaches, but none seems to work. Any help is appreciated |
|
April 11, 2016, 06:15 |
|
#2 |
Member
Lennart
Join Date: Feb 2016
Posts: 46
Rep Power: 10 |
After asking this question, I figured it out myself...
Each row of the n*m mesh (constant i-coordinate) contains n+m-1 faces, e.g. n x-faces and m-1 y-faces, in an alternating fashion (x y x y ... x). The last row contains just y-faces. This is also the order in which the faces are stored in the file: (x11, y11, x12, y12, ..., x1(n-1), y1(n-1), x1n, x21, y21, ..., x2n, ...,x(m-1)n, ym1, ym2, ..., ymn) Interpreting the file like that works nicely and gives the expected results. Maybe this will be helpful for somebody else in the future. |
|
Tags |
file structure, openfoam, output file, parsing, post-processing |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] Problem installing swak_2.x for OpenFoam-2.4.0 | towanda | OpenFOAM Community Contributions | 6 | September 5, 2015 22:03 |
[swak4Foam] swak4foam building problem | GGerber | OpenFOAM Community Contributions | 54 | April 24, 2015 17:02 |
SparceImage v1.7.x Issue on MAC OS X | rcarmi | OpenFOAM Installation | 4 | August 14, 2014 07:42 |
OpenFOAM without MPI | kokizzu | OpenFOAM Installation | 4 | May 26, 2014 10:17 |
[swak4Foam] build problem swak4Foam OF 2.2.0 | mcathela | OpenFOAM Community Contributions | 14 | April 23, 2013 14:59 |