keurfonluu / toughio

Pre- and post-processing Python library for TOUGH
Other
59 stars 9 forks source link

Parameters visualization problem (Gas saturation, XCO2aq, etc) #142

Closed jousheinfo closed 1 year ago

jousheinfo commented 1 year ago

Hello,

I am trying to obtain data on the gas saturation from a T2WELL output file, but it is not working. I want to extract the data for the first hour of the simulation and plot it with time (also extracted using toughio), but when using slicing ([:24]), I get a problem.

I would like to kindly request your help. Thank you for your time and consideration!

Please take a look at the Python code below and the error I get.

import toughio output = toughio.read_output('injection.listing')[:24] SG = output.data['SG']

AttributeError: 'list' object has no attribute 'data'

jousheinfo commented 1 year ago

Moreover, I get a deprecation warning with using the above mentioned code

keurfonluu commented 1 year ago

Hi @jousheinfo,

toughio.read_output returns a list of outputs for each time step requested in block TIMES, so output is a list. I am not sure what your 24 means, but output = toughio.read_output('injection.listing')[:24] will return the 24 first time steps. If you want to get SG of the Nth time step, you should use:

SG = output[N].data['SG']

What's the deprecation warning you get?

jousheinfo commented 1 year ago

Dear @keurfonluu,

unfortunately, the code you suggested did not work correctly. I get the following output:

[1.0, 2.0, 346270.0, 35.25, 0.0, 0.0, 0.0, 1.0, 7.2418e-09, 0.0, 1.0, 6.07, 994.12]

It is mixing pressure, temperature, saturation........how to fix this, please?

And regarding the deprecation warning, when I type this:

toughio.read_output('injection.listing')[22]

I get the following message:

C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\toughio_io\output\tough_tough.py:80: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. variables = np.array([[v[2:] for v in variable] for variable in variables])

Thank you so much!

keurfonluu commented 1 year ago

I will need the simulations files in order to be able to investigate.

jousheinfo commented 1 year ago

Dear @keurfonluu,

please find attached the input and output file of my simulation. Thanks!

injection_Pwh_50_gas_CO2_salinity_output.txt injection_Pwh_50_gas_CO2_salinity_input.txt

keurfonluu commented 1 year ago

Hi @jousheinfo,

Sorry for the delay, I have been pretty busy lately. Your issue has been fixed in the development branch, please install that version as follows:

pip uninstall toughio
pip install https://github.com/keurfonluu/toughio/archive/devel.zip

Let me know if it doesn't work.

keurfonluu commented 1 year ago

Fixed in #144.