Great, I can contribute to the new TOUGH2 forum :-) I haven't used PyTOUGH with TOUGH2-MP in a while but it should work. For a quick check, try to open a result file from a TOUGH2-MP simulation with PyTOUGH, e.g.:
import t2listing as t2l
lst = t2l.t2listing("simulation.out")
If it doesn't break at the second step, it should work :-)
Hope that helps,
--- Florian ---
Hi Florian and Adrian, thx for the reply.
I have tried using PyTOUGH for TOUGH2-MP, It is very convenient for input and output, however, I found some minor things that make it not friendly for MP version.
1. It only reads the first block of the MP output file "OUTPUT_DATA". For example if my output file reads like this:
A1M21 702 0.11751E+08 37.00 0.00000E+00 0.00000E+00 0.31985E-01 0.10000E+01 0.45998E-03 0.00000E+00 0.10000E+01 0.00 1018.92
ELEM. INDEX P T SG SS XNACL YH2OG XCO2aq PCAP k-red. DG DL
(Pa) (deg-C) (Pa) (kg/m3) (kg/m3)
A1N21 703 0.11721E+08 37.00 0.00000E+00 0.00000E+00 0.31985E-01 0.10000E+01 0.45998E-03 0.00000E+00 0.10000E+01 0.00 1018.91
By using the following command
outfile = t2listing('OUTPUT_DATA')
I can only extract the information from A1M21 and previous blocks. I cannot read any information from A1N21, unless I remove all the \n before the ELEM block manually.
2. It cannot run TOUGH2-MP automatically, only support TOUGH2
dat.run(save_filename, incon_filename, simulator )
It would be great if I can fix the above problem so that it is possible to automate TOUGH2-MP with PyTOUGH. Any idea?
hi again Judith
1. That should work ok- but there are many subtly different TOUGH2 output formats, and it is quite challenging to support them all. Occasionally someone shows me one that I've never seen. It sounds to me like yours could be another one. Would you be able to email me an example output file to email@example.com?
2. Yes, the 'run()' command doesn't support TOUGH2-MP, because TOUGH2-MP is run through MPI rather than directly. And the exact command may depend on what type of MPI you are running (OpenMPI, MPICH2 etc.)- e.g. mpirun, mpiexec etc. Also you have to specify the number of processors. So for running TOUGH2-MP from your Python scripts I would recommend just using a system call, e.g. os.system('mpirun -np 16 t2eos1_mp') or similar. The PyTOUGH user guide does say that run() doesn't support TOUGH2-MP but I will add something about what you should do instead.