CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

File structure of surfaceScalarField in output

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By elmo555

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 11, 2016, 03:09
Default File structure of surfaceScalarField in output
  #1
Member
 
Lennart
Join Date: Feb 2016
Posts: 46
Rep Power: 10
elmo555 is on a distinguished road
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 <<
);
and assign each line to cell (i,j) in the order (1,1), (1,2), ... (1,20),(2,1),...,(20,20).

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
elmo555 is offline   Reply With Quote

Old   April 11, 2016, 05:15
Default
  #2
Member
 
Lennart
Join Date: Feb 2016
Posts: 46
Rep Power: 10
elmo555 is on a distinguished road
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.
ashish.vinayak likes this.
elmo555 is offline   Reply With Quote

Reply

Tags
file structure, openfoam, output file, parsing, post-processing


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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 21:03
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 16:02
SparceImage v1.7.x Issue on MAC OS X rcarmi OpenFOAM Installation 4 August 14, 2014 06:42
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 09:17
[swak4Foam] build problem swak4Foam OF 2.2.0 mcathela OpenFOAM Community Contributions 14 April 23, 2013 13:59


All times are GMT -4. The time now is 02:45.