OPM / opm-output

This repository is intended for output-writer functionality for the flow simulators in OPM
http://www.opm-project.org
GNU General Public License v3.0
3 stars 21 forks source link

The summary file not working with some MRST reading functions any more #75

Closed GitPaean closed 8 years ago

GitPaean commented 8 years ago

I have been using the same routine readSummaryLocal from MRST to read the summary file from OPM for long.

Now the problem happens when reading the .SMSPEC file. When reading some data type information (INTE, REAL, DOUB, etc.). A new type like H or H appears now and it causes problem with MRST.

The routine still works well with the SUMMARY files from the Eclipse.

Anyone working with output routines has any clue? or which part I should look at the output code to figure out the possible reason?

Thanks.

joakim-hove commented 8 years ago

Hello;

yes - this seems like a bug in opm-output. Can you:

  1. Try the ert based reader - e.g. summary.x on the summary files.
  2. Send med the broken UNSMRY / SMSPEC files?
GitPaean commented 8 years ago

Thanks.

I just sent you the UNSMRY/SMSPEC files, which is from one example in the OPM-data.

I will try to learn some summary.x. Sorry for not having been using them.

joakim-hove commented 8 years ago

I just sent you the UNSMRY/SMSPEC files

Yes - I have got them; thank you.

I will try to learn some summary.x

You must set the BUILD_APPLICATIONS switch to on when building ert. Then you can invoke summary.x as:

/path/to/ert/bin/summary.x PATH/TO/SIMUALTION  FOPT FOPR WWCT:OPX

and it will load the summary results and print the vectors FOPT, FOPR and WWCT:OPX.

Anyway - I have tried loading the case you sent me with summary.x - and also with the commercial application S3Graf - and that seems to work fine. Could the bug be in MRST?

GitPaean commented 8 years ago

Yes. I have the summary.x and I am able to output some results.
Could you please tell me some information or practice on how to visualize based on the ert or ert-python? It will be great if there are some links or tutorial.

Could the bug be in MRST?

It could be. I can talk with someone from MRST side to see what possibly causes the problem.

The fact is that the MRST function works well with Eclipse summary file and also the old OPM summary file (in OPM-data). It is just recently (I do not know how recent it can be, weeks or one or two months?) something wrong happened.

It also can be true that not many people use both MRST and OPM. More likely, people work with MRST and ECL or OPM and ECL. I can be the one of the few people encounter this problem.

Anyway, I would like to learn some ert based plotting or visualization techiniques.

alfbr commented 8 years ago

Plotting from summary files is now supported in Resinsight, just compile the dev branch from github :-)

GitPaean commented 8 years ago

Plotting from summary files is now supported in Resinsight, just compile the dev branch from github :-)

It is good to know about that, thanks. I have been trying to learn ResInsight from time to time. It is very good, especially for complicated simulation cases.

The reason I like MRST based plotting routine is that it gives some flexibility to customize the style, and also plotting different results for comparison, etc. , which is important for publishing.

The python based plotting routine probably also can provides some similiar features, hopefully.

alfbr commented 8 years ago

Comparing curves is well supporter inn Resinsight. Please provide feed-back with specific suggestions if you miss something on the stylistic side.

joakim-hove commented 8 years ago

Anyway, I would like to learn some ert based plotting or visualization techiniques.

The ert based stuff is mainly a toolbox; to get beautiful plots with semi-transparent nudes in the background you must still do some tinkering! Anyway - if you are interested in this you could start with the summaryplot in opm-utilities. The absolutely simplest plotting program you could make would be something like:

#!/usr/bin/env python
import sys

from ert.ecl import EclSum
import matplotlib.pyplot as pyplot

def plot_vector(case, key):
    values = case.get_values( key )
    dates = case.get_mpl_dates( )

    pyplot.plot_date( dates , values ,
                      xdate = True,
                      ydate = False,
                      color = "Red",
                      ls    = "-",
                      lw    = 2.0,
                      marker = None)

    filename = "/tmp/%s_%s.png" % (case.base, key)
    pyplot.savefig(filename)
    print("Plot saved to: %s" % filename)
    pyplot.show( )

# The script should be called as: plot /path/to/CASE key1 key2 ... 

case = EclSum(sys.argv[1])
for key in sys.argv[2:]:
    plot_vector( case , key )

The plotting in this example is based on matplotlib - getting the plot to look like you want is then a question of fiddling with matplotlib.

joakim-hove commented 8 years ago

I'll close this now under the rude assumption that the initial bug was in the MRST read routine; please feel free to reopen if you disagree.