acroucher / PyTOUGH

A Python library for automating TOUGH2 simulations of subsurface fluid and heat flow
GNU Lesser General Public License v3.0
96 stars 36 forks source link

Can Pytough read "volume- and mass- balance" in output file #25

Closed jxalfoudqt closed 4 years ago

jxalfoudqt commented 4 years ago

Hi Adrian,

I wonder if PyTOUGH can read the information of "volume- and mass- balance" in the output file, which shows at each time step. This is really helpful for checking mass balance. I think PyTOUGH should have a function that can read this information, but I do not find it in the source code. Would you please give me some help.

Many thanks. Tao

acroucher commented 4 years ago

Hi Tao,

Currently PyTOUGH does not read the volume and mass balance information in the output listing files. I agree it would be a nice thing to have.

I have just been looking through my collection of TOUGH2 output files, and it looks like the balance information is written in quite different ways in different varieties of TOUGH2. Sometimes there are just two lines with "PHASE VOLUMES IN PLACE" and "MASS IN PLACE", but sometimes there are other lines like "MASS OF COMPONENTS IN PLACE" or "INTERNAL ENERGY IN PLACE", and sometimes the data are formatted in tables instead of lines. Sometimes there are also separate balance tables for different domains. I think it depends on the EOS.

So that might make coding it a little difficult.

There is also the question of how you think it should work. The simplest thing would be to add some kind of 'balance' property to the t2listing class, perhaps a dictionary containing different items for the different phases, components etc. That would enable you to get the balance information at the current time step. But you might want to be able to extract histories (i.e. time series of balances) as well? I'm not sure how that would work, given that the information contained in the listing file looks quite different for different EOS modules and varieties of TOUGH2.

jxalfoudqt commented 4 years ago

Hi Adrien, many thanks for your reply.