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

Setting of dense data times by the flag -t t1,t2,... #26

Merged
merged 1 commit into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/finner_grids/spe11a.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ PERM7 0 PORO7 0
"""injection time, time step size to write results, maximum solver time step, injected fluid (0 water, 1 co2) (well1), injection rate [kg/s] (well1), temperature [C] (well1), injected fluid (0 water, 1 co2) (well2), ..."""
2.5 0.5 .0001 1 1.7e-7 20 1 0 20
2.5 0.5 .0001 1 1.7e-7 20 1 1.7e-7 20
115 0.5 .0001 1 0 20 1 0 20
115 1 .0001 1 0 20 1 0 20
4 changes: 3 additions & 1 deletion examples/finner_grids/spe11b.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ PERM7 1e-5 PORO7 1e-6 THCONR7 2.00
1000 1000 0.1 1 0 10 1 0 10
25 5 0.1 1 0.035 10 1 0 10
25 5 0.1 1 0.035 10 1 0.035 10
950 5 0.1 1 0 10 1 0 10
50 25 0.1 1 0 10 1 0 10
400 50 0.1 1 0 10 1 0 10
500 100 0.1 1 0 10 1 0 10
6 changes: 4 additions & 2 deletions examples/finner_grids/spe11c.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ corner-point #Type of grid (cartesian, tensor, or corner-point)
420 #If cartesian, number of x cells [-]; otherwise, variable array of x-refinment
125 #If cartesian, number of y cells [-]; otherwise, variable array of y-refinment [-] (for spe11c)
5,3,1,2,3,1,2,2,5,2,4,4,2,4,2,8,8,3 #If cartesian, number of z cells [-]; if tensor, variable array of z-refinment; if corner-point, fix array of z-refinment (18 entries)
70 36.25 #Temperature bottom and top rig [C]
70 36.12 #Temperature bottom and top rig [C]
300 3e7 0.1 #Datum [m], pressure at the datum [Pa], and multiplier for the permeability in the z direction [-]
1e-9 2e-8 10 #Diffusion (in liquid and gas) [m^2/s] and dispersion [m] (dispersion requires a Flow version newer than 17-11-2023)
8.5e-1 2500 #Rock specific heat and density (for spe11b/c)
Expand Down Expand Up @@ -52,4 +52,6 @@ PERM7 1e-5 PORO7 1e-6 THCONR7 2.00
1000 1000 0.1 1 0 10 1 0 10
25 5 0.1 1 50 10 1 0 10
25 5 0.1 1 50 10 1 50 10
950 5 0.1 1 0 10 1 0 10
50 25 0.1 1 0 10 1 0 10
400 50 0.1 1 0 10 1 0 10
500 100 0.1 1 0 10 1 0 10
2 changes: 1 addition & 1 deletion examples/hello_world/spe11c.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cartesian #Type of grid (cartesian, tensor, or corner-point)
42 #If cartesian, number of x cells [-]; otherwise, variable array of x-refinment
25 #If cartesian, number of y cells [-]; otherwise, variable array of y-refinment [-] (for spe11c)
12 #If cartesian, number of z cells [-]; if tensor, variable array of z-refinment; if corner-point, fix array of z-refinment (18 entries)
70 36.25 #Temperature bottom and top rig [C]
70 36.12 #Temperature bottom and top rig [C]
300 3e7 0.1 #Datum [m], pressure at the datum [Pa], and multiplier for the permeability in the z direction [-]
1e-9 2e-8 0 #Diffusion (in liquid and gas) [m^2/s] and dispersion [m] (dispersion requires a Flow version newer than 17-11-2023)
8.5e-1 2500 #Rock specific heat and density (for spe11b/c)
Expand Down
7 changes: 3 additions & 4 deletions src/pyopmspe11/core/pyopmspe11.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ def pyopmspe11():
dic["resolution"] = cmdargs[
"resolution"
].strip() # Spatial resolution to write the data
dic["time_data"] = float(
cmdargs["time"].strip()
) # Temporal resolution to write the dense data
dic["time_data"] = cmdargs["time"] # Temporal resolution to write the dense data
dic["dt_data"] = float(
cmdargs["write"].strip()
) # Temporal resolution to write the sparse and performance data
Expand Down Expand Up @@ -127,7 +125,8 @@ def load_parser():
"-t",
"--time",
default="5",
help="Time interval for the spatial maps (spe11a [h]; spe11b/c [y]) ('24' by default).",
help="If one number, time step for the spatial maps (spe11a [h]; spe11b/c "
"[y]) ('5' by default); otherwise, times separated by commas.",
)
parser.add_argument(
"-r",
Expand Down
1 change: 0 additions & 1 deletion src/pyopmspe11/utils/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def plotting(dic):
"-d " + f"{dic['spe11']}",
"-g " + f"{dic['generate']}",
"-r " + f"{dic['resolution']}",
"-t " + f"{dic['time_data']}",
]
print(" ".join(plot_exe))
prosc = subprocess.run(plot_exe, check=True)
Expand Down
14 changes: 8 additions & 6 deletions src/pyopmspe11/utils/writefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,24 @@ def opm_files(dic):
os.system(f"rm -rf {dic['exe']}/{dic['fol']}/deck/saturation_functions.py")
inj_t = 0.0
skip_unrst = 0
d_t = 0.0
ini_count = 0
times = ["0."]
for inj in dic["inj"]:
if inj[4] + inj[7] == 0.0:
if inj[4] + inj[7] == 0.0 and ini_count == 0:
inj_t += inj[0]
skip_unrst += int(inj[0] / inj[1])
else:
d_t = inj[1]
break
ini_count = 1
for _ in range(int(inj[0] / inj[1])):
times.append(f"{inj[1] + float(times[-1])}")
with open(
f"{dic['exe']}/{dic['fol']}/deck/dt.txt",
"w",
encoding="utf8",
) as file:
file.write(f"{d_t}\n")
file.write(f"{inj_t}\n")
file.write(f"{skip_unrst}")
file.write(f"{skip_unrst}\n")
file.write(" ".join(times))
text = []
for row in dic["safu"]:
text.append(f"{row[1]} ")
Expand Down
Loading
Loading