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 not run the first example #17

Closed chenmingzhang closed 4 years ago

chenmingzhang commented 6 years ago

I am new to PyTOUGH and wish to get the first example runnning to get the idear about using this package. once running the very first example (https://github.com/acroucher/PyTOUGH/wiki/Horizontal-1D-model) the program stuck at

dat.run(simulator = 't2eos1')

where it shows

In [35]:dat.run(simulator = '/home/cmzhang/tr2.087_eos1_lnx') forrtl: severe (24): end-of-file during read, unit 33, file /home/chenming/Projects/TOUGHREACT/trial_1/flow.inp Image PC Routine Line Source tr2.087_eos1_lnx 00000000005B786A Unknown Unknown Unknown tr2.087_eos1_lnx 00000000005B63E5 Unknown Unknown Unknown tr2.087_eos1_lnx 00000000005631E6 Unknown Unknown Unknown tr2.087_eos1_lnx 000000000051D305 Unknown Unknown Unknown tr2.087_eos1_lnx 000000000051CAC1 Unknown Unknown Unknown tr2.087_eos1_lnx 0000000000541C33 Unknown Unknown Unknown tr2.087_eos1_lnx 000000000062B31B Unknown Unknown Unknown tr2.087_eos1_lnx 000000000040030C Unknown Unknown Unknown tr2.087_eos1_lnx 00000000005C4A10 Unknown Unknown Unknown tr2.087_eos1_lnx 00000000004001D9 Unknown Unknown Unknown

In [36]: !ls flow.inp flow.out GENER geom.dat horiz1D.dat horiz1D.listing INCON LINEQ MESH SAVE TABLE VERS

In [37]: !cat flow.inp

In [38]:

as you can see there is no flow.inp ready for this simulation. how can i correct this? thanks chenming

acroucher commented 6 years ago

I'm not sure which version of TOUGH2 you're running, but if it expects the input file to be called flow.inp, you will need to change the previous line of the script so it writes the data file out to that name, i.e.

dat.write('flow.inp')

teechung commented 5 years ago

Hi there,

I also tried horizontal-1D example. For me, I got message:

't2eos1' is not recognized as an internal or external command, operable program or batch file. Traceback (most recent call last): File "modelsetupbuild.py", line 59, in lst = t2listing('horiz1D.listing') File "C:\Users\tee\Downloads\PyTOUGH-master\t2listing.py", line 177, in init raise Exception('Could not detect simulator type.') Exception: Could not detect simulator type.

It seems I did not start the TOUGH2 programme, so it can not detect the simulator 't2eos1". Do you have more notes to show how to link TOUGH2 programme files with pyTOUGH? or point me to your page which already describes how to launch TOUGH2 EOS01.

Regards, Tomas

teechung commented 5 years ago

I tried to modify the codes to launch to launch the EOS3 (I got this from my colleague as we did not have EOS1):

1st trial

--- run the model ------------------------------------

import os os.system(r'"C:\Program Files\141218_Modified\eos3gw.exe"') dat.run()

It returns: 'AUTOUGH2_2' is not recognized as an internal or external command, operable program or batch file. Traceback (most recent call last): File "modelsetupbuild.py", line 60, in lst = t2listing('horiz1D.listing') File "C:\Users\tchung\Downloads\PyTOUGH-master\t2listing.py", line 177, in init raise Exception('Could not detect simulator type.') Exception: Could not detect simulator type.

2nd trial

--- run the model ------------------------------------

dat.run(simulator = '/home/141218_Modified/eos3gw.exe')

It returns: The system cannot find the path specified. Traceback (most recent call last): File "modelsetupbuild.py", line 58, in lst = t2listing('horiz1D.listing') File "C:\Users\tchung\Downloads\PyTOUGH-master\t2listing.py", line 177, in init raise Exception('Could not detect simulator type.') Exception: Could not detect simulator type.

Is this Horizontal-1D example created a AUTOUGH2 input, I need to convert it to TOUGH2 format?

acroucher commented 5 years ago

It seems I did not start the TOUGH2 programme, so it can not detect the simulator 't2eos1".

No, you don't need to start TOUGH2 before running the script. If it says "'t2eos1' is not recognized as an internal or external command" that means it can't find the t2eos1 executable on your system.

I tried to modify the codes to launch to launch the EOS3 (I got this from my colleague as we did not have EOS1)

OK, so it sounds like you didn't have t2eos1 installed. If you wanted to run the problem on EOS3 instead, you would also have to modify the script to set up initial conditions etc. for EOS3. Single-phase EOS1 has primary thermodynamic variables (P, T) but EOS3 has (P, X, T) where X is the air mass fraction.