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

if pythough can read exist input file? #19

Closed chenmingzhang closed 5 years ago

chenmingzhang commented 5 years ago

Hi Adrain: i understand that pytough could generate mesh very well, i am wondering if pytough can read existing input files. the reason i ask this is that i wish to read all the input and output of all examples to explore the capacity of tough /itough. As you may know, flopy, a pre- and post-processing tool has got many examples for users to get hand on very quickly. if there is no such capacity i may have to do that from scratch and merge them into this because putting all input/output to scripting language like python is really the way to analyse the result.

thanks, Chenming

acroucher commented 5 years ago

PyTOUGH can read existing TOUGH2 input files via the t2data class, e.g. if your input file is called 'model.dat' then you can read it into a t2data object like this: dat = t2data('model.dat'). Is that what you meant?

jxalfoudqt commented 5 years ago

PyTOUGH can read existing TOUGH2 input files via the t2data class, e.g. if your input file is called 'model.dat' then you can read it into a t2data object like this: dat = t2data('model.dat'). Is that what you meant? Hi Adrain:

I have used this method to read a TOUGH2 input data. It seems that I can only get simulation control parameters by dat.parameter. May I ask How should I get the Rocktype/block parameters, such as bulk density, porosity, permeability, relative permeability and capillary functions (IRP and ICP values, as well as relative parameters).

Thanks. Tao

acroucher commented 5 years ago

You can access all data in your input file via t2data. For example if your t2data object is called dat, and it contains a rocktype named rock1, the porosity of that rocktype is given by dat.rocktype['rock1'].porosity. Have a look at the example scripts on the PyTOUGH wiki for more examples.

jxalfoudqt commented 5 years ago

Hi Adrain:

It works by dat.grid.rocktype['rock1'].porosity.

Many thanks. Tao