[Opm] Flow UNRST binary file format

Joakim Hove joaho at statoil.com
Fri Feb 10 15:11:59 UTC 2017

     *   You can use the RestartIO class from the the opm-output and write a small C++ program - that way you will only be working with C++/Opm datastructures.
     *   You can write an ert program using the low level ecl_xxx datastructures; if going this way you can use the python bindings.

A third option - would of course to be to modify opm-output, and add the calls to write your data into the RestartIO implemeentation - the RestartIO::save() https://github.com/OPM/opm-output/blob/master/opm/output/eclipse/RestartIO.cpp#L485 could be augmented with something like (untested again):

      std::fstream out("pressure.txt" , ios_base::app);
      const auto& p = cells.data("PRESSURE")

      out << sim_time << " ";
      for (const auto& ijk : {{1,2,3} , {2,3,4}})   {
            size_t active_index = grid.getActiveIndex( ijk[0] , ijk[1] , ijk[2]);
             out << p[active_index];

      out.close( );

That way you would get 'pressure.txt' file as part of your simulation - which is obviously neat, but you would have to maintain change to C++ code yourself, as I do not see us merging something special like this. I guess this will be the "best" solution - and the Python solution is the simplest. Your call.


The information contained in this message may be CONFIDENTIAL and is
intended for the addressee only. Any unauthorised use, dissemination of the
information or copying of this message is prohibited. If you are not the
addressee, please notify the sender immediately by return e-mail and delete
this message.
Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <//opm-project.org/pipermail/opm/attachments/20170210/0f6ff727/attachment.html>

More information about the Opm mailing list