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

File structure of surfaceScalarField in output

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 11, 2016, 03:09
Default File structure of surfaceScalarField in output
  #1
New Member
 
Lennart
Join Date: Feb 2016
Posts: 21
Rep Power: 2
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
New Member
 
Lennart
Join Date: Feb 2016
Posts: 21
Rep Power: 2
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.
elmo555 is offline   Reply With Quote

Reply

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

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem installing swak_2.x for OpenFoam-2.4.0 towanda OpenFOAM Installation 6 September 5, 2015 21:03
swak4foam building problem GGerber OpenFOAM Installation 54 April 24, 2015 16:02
SparceImage v1.7.x Issue on MAC OS X rcarmi OpenFOAM Installation on Windows, Mac and other Unsupported Platforms 4 August 14, 2014 06:42
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 09:17
build problem swak4Foam OF 2.2.0 mcathela OpenFOAM Installation 14 April 23, 2013 13:59


All times are GMT -4. The time now is 16:59.