Skip to content

Commit

Permalink
Merge pull request #9 from daavid00/developing
Browse files Browse the repository at this point in the history
Improvements for the -e option
  • Loading branch information
daavid00 committed Jun 6, 2024
2 parents 38565b0 + 81ab2c3 commit 14cdadf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/expreccs/core/expreccs.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ def expreccs():
plot_results(dic)
return

# Process the input file (open expreccs.utils.inputvalues to see the abbreviations meaning)
dic = process_input(dic, file)

# Make the output folders
write_folders(dic)

# For regional and site given decks, then we create a new deck with the proyected pressures
if dic["expreccs"]:
dic["reg"] = dic["expreccs"].split(",")[0]
dic["sit"] = dic["expreccs"].split(",")[1]
create_deck(dic)
return

# Process the input file (open expreccs.utils.inputvalues to see the abbreviations meaning)
dic = process_input(dic, file)

# Make the output folders
write_folders(dic)

# Get the location of wells and faults in the reservoirs
dic = mapping_properties(dic)
write_properties(dic)
Expand Down
6 changes: 5 additions & 1 deletion src/expreccs/utils/reg_sit_given_decks.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@

def create_deck(dic):
"""Create a deck from given reg and site decks with projected pressures"""
if not os.path.exists(f"{dic['exe']}/{dic['fol']}"):
os.system(f"mkdir {dic['exe']}/{dic['fol']}")
if not os.path.exists(f"{dic['exe']}/{dic['fol']}/bc"):
os.system(f"mkdir {dic['exe']}/{dic['fol']}/bc")
case = f"{dic['exe']}/{dic['reg']}/{dic['reg'].upper()}"
rst = case + ".UNRST"
grid = case + ".EGRID"
Expand Down Expand Up @@ -372,7 +376,7 @@ def write_files(dic):
lol.append("'BCCON.INC' /")
count = 1
with open(
f"{dic['exe']}/{dic['fol']}/EXPRECCS.DATA",
f"{dic['exe']}/{dic['fol']}/{dic['fol'].upper()}.DATA",
"w",
encoding="utf8",
) as file:
Expand Down
2 changes: 0 additions & 2 deletions src/expreccs/utils/writefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ def write_folders(dic):
if not os.path.exists(f"{dic['exe']}/{dic['fol']}"):
os.system(f"mkdir {dic['exe']}/{dic['fol']}")
if dic["expreccs"]:
if not os.path.exists(f"{dic['exe']}/{dic['fol']}/bc"):
os.system(f"mkdir {dic['exe']}/{dic['fol']}/bc")
return
for fil in ["preprocessing", "jobs", "output", "postprocessing"]:
if not os.path.exists(f"{dic['exe']}/{dic['fol']}/{fil}"):
Expand Down
3 changes: 1 addition & 2 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ def test():
assert os.path.exists("./rotate/postprocessing/rotate_site_closed_pressure.png")
os.system("scp -r ./rotate/preprocessing/regional/. ./rotate/output/regional")
os.system("scp -r ./rotate/preprocessing/site_closed/. ./rotate/output/site_closed")
os.system("scp rotate.txt ./rotate/output")
os.chdir(f"{cwd}/tests/configs/rotate/output")
os.system("expreccs -i rotate.txt -o expreccs -e regional,site_closed")
os.system("expreccs -o expreccs -e regional,site_closed")
assert os.path.exists("./expreccs/BCCON.INC")
os.chdir(f"{cwd}/tests/configs/rotate/output/expreccs")
os.system("flow EXPRECCS.DATA --enable-tuning=true --linear-solver=cprw")
Expand Down

0 comments on commit 14cdadf

Please sign in to comment.