Skip to content

Commit

Permalink
Add column with total oil/gas volumes to VolumetricAnalysis
Browse files Browse the repository at this point in the history
  • Loading branch information
tnatt committed May 21, 2024
1 parent c3109ec commit 7917818
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
18 changes: 18 additions & 0 deletions webviz_subsurface/_models/inplace_volumes_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class InplaceVolumesModel:
"GIIP",
"ASSOCIATEDOIL",
"ASSOCIATEDGAS",
"STOIIP_TOTAL",
"GIIP_TOTAL",
"BULK",
"NET",
"PORV",
Expand Down Expand Up @@ -81,6 +83,7 @@ def __init__(
self._dataframe.loc[
self._dataframe["FACIES"].isin(non_net_facies), "NET"
] = 0

else:
self._dataframe = volumes_table
# Workaround the FUID ZONE needs to be defined in the
Expand Down Expand Up @@ -109,6 +112,21 @@ def __init__(
self._set_initial_property_columns()
self._dataframe = self.compute_property_columns(self._dataframe)

# fill volume columns with 0 if nan
self._dataframe[self.volume_columns] = self._dataframe[
self.volume_columns
].fillna(0)

# create HC_TOTAL columns
if "STOIIP" in self._dataframe and "ASSOCIATEDOIL" in self._dataframe:
self._dataframe["STOIIP_TOTAL"] = (
self._dataframe["STOIIP"] + self._dataframe["ASSOCIATEDOIL"]
)
if "GIIP" in self._dataframe and "ASSOCIATEDGAS" in self._dataframe:
self._dataframe["GIIP_TOTAL"] = (
self._dataframe["GIIP"] + self._dataframe["ASSOCIATEDGAS"]
)

@property
def dataframe(self) -> pd.DataFrame:
return self._dataframe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def comparison_callback(
responses = [selections["Response"]] + [
col
for col in volumemodel.responses
if col not in volumemodel.hc_responses and col != selections["Response"]
if col not in volumemodel.hc_responses + ["STOIIP_TOTAL", "GIIP_TOTAL"]
and col != selections["Response"]
]
df = create_comparison_df(
volumemodel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ def __init__(
volumes_table=volumes_table,
fipfile=get_path(self.fipfile) if self.fipfile else None,
)
if self.fipfile and vcomb.dframe.empty:
raise ValueError(
"Not possible to obtain any results using the provided fipfile."
)
self.disjoint_set_df = vcomb.disjoint_set_df
self.volmodel = InplaceVolumesModel(
volumes_table=vcomb.dframe,
Expand Down

0 comments on commit 7917818

Please sign in to comment.