CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

read binary tensor field

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 17, 2015, 22:20
Default read binary tensor field
  #1
Member
 
J.-H. Wang
Join Date: Oct 2010
Posts: 72
Rep Power: 15
f0208secretx is on a distinguished road
Hi Foamers,

I have velocity gradient output at every time step in binary, compressed format using calcFvcGrad library. I now want to write a custom binary reader to port this data for each time step to other solvers I wrote. I can't seem to find the descriptions of how this binary is formatted anywhere. I need to know precision, order of array (NCell*9 matrix), corresponding vertex/cell position etc. Will appreciate for any help. Thanks.
f0208secretx is offline   Reply With Quote

Old   August 18, 2015, 14:32
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by f0208secretx View Post
I can't seem to find the descriptions of how this binary is formatted anywhere. I need to know precision, order of array (NCell*9 matrix), corresponding vertex/cell position etc. Will appreciate for any help. Thanks.
Quick answer:
  1. The order is the exact same as when writing in "ascii".
  2. The precision is part of one of the build options. You can check by running:
    Code:
    echo $WM_ARCH_OPTION
    echo $WM_PRECISION_OPTION
    which should tell you if it's built with 32 or 64-bit and if Single or Double Precision (SP or DP).
  3. For the format of the tensor, check the programmer's guide (references: http://openfoamwiki.net/index.php/Ma...rGuideAddendum ) or check the source code of the test utility "applications/test/tensor".
wyldckat is offline   Reply With Quote

Reply


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
how to calculate mass flow rate on patches and summation of that during the run? immortality OpenFOAM Post-Processing 104 February 16, 2021 08:46
[Resolved] GPU on Fluent Daveo643 FLUENT 4 March 7, 2018 08:02
Cannot read 2nd column of data in libforces.so output force.dat file musahossein OpenFOAM Programming & Development 9 February 21, 2015 22:43
Error in solution using "Grid Interface" agustinvo FLUENT 4 January 20, 2015 12:03
Read Plot3D Binary File John Main CFD Forum 3 January 17, 2001 03:57


All times are GMT -4. The time now is 12:14.