Skip to content

Commit

Permalink
fixed issues with mismatch in equilibration and saturation region num…
Browse files Browse the repository at this point in the history
…bers
  • Loading branch information
Olwijn Leeuwenburgh (OG SUB CON) committed Dec 9, 2021
1 parent 0e2e38e commit dbad233
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/flownet/ahm/_run_ahm.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,9 @@ def run_flownet_history_matching(
[1] * len(network.grid.model.unique()), columns=["SATNUM"]
)

# total number of regions in the field data
satnum_max = field_data.init("SATNUM").get_max()

# Create a pandas dataframe with all parameter definition for each individual tube
relperm_dist_values = pd.DataFrame(columns=column_names_probdist + ["satnum"])

Expand All @@ -688,15 +691,16 @@ def run_flownet_history_matching(
)

defined_satnum_regions = []
if config.model_parameters.relative_permeability.scheme == "regions_from_sim":
if config.model_parameters.relative_permeability.scheme == "regions_from_sim":
relp_config_satnum = config.model_parameters.relative_permeability.regions
for reg in relp_config_satnum:
defined_satnum_regions.append(reg.id)
else:
relp_config_satnum = [config.model_parameters.relative_permeability.regions[0]]
defined_satnum_regions.append(None)

for i in np.sort(df_satnum["SATNUM"].unique()):
#for i in np.sort(df_satnum["SATNUM"].unique()):
for i in range(1, satnum_max+1):
if i in defined_satnum_regions:
idx = defined_satnum_regions.index(i)
else:
Expand Down Expand Up @@ -800,6 +804,9 @@ def run_flownet_history_matching(
[1] * len(network.grid.model.unique()), columns=["EQLNUM"]
)

# total number of regions in the field data
eqlnum_max = field_data.init("EQLNUM").get_max()

# Create a pandas dataframe with all parameter definition for each individual tube
equil_dist_values = pd.DataFrame(columns=column_names_probdist + ["eqlnum"])

Expand All @@ -813,7 +820,8 @@ def run_flownet_history_matching(
equil_config_eqlnum = [config.model_parameters.equil.regions[0]]
defined_eqlnum_regions.append(None)

for i in np.sort(df_eqlnum["EQLNUM"].unique()):
#for i in np.sort(df_eqlnum["EQLNUM"].unique()):
for i in range(1, eqlnum_max+1):
if i in defined_eqlnum_regions:
idx = defined_eqlnum_regions.index(i)
else:
Expand Down
2 changes: 2 additions & 0 deletions src/flownet/data/compdat.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ def deck2dfs(
Returns:
Dictionary with dataframes, at least for COMPDAT, COMPSEGS and WELSEGS.
"""
# pylint: disable=too-many-branches, too-many-statements, too-many-lines, too-many-locals

compdatrecords = [] # List of dicts of every line in input file
compsegsrecords = []
welopenrecords = []
Expand Down

0 comments on commit dbad233

Please sign in to comment.