Skip to content

Commit

Permalink
Add column with total oil/gas volumes to VolumetricAnalysis (#1293)
Browse files Browse the repository at this point in the history
  • Loading branch information
tnatt committed May 21, 2024
1 parent c2c8243 commit 2dcbed9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [UNRELEASED] - YYYY-MM-DD

### Added
- [#1293](https://github.com/equinor/webviz-subsurface/pull/1293) - Added automatic calculation of `STOIIP_TOTAL` / `GIIP_TOTAL` in `VolumetricAnalysis`.

### Fixed
- [#1287](https://github.com/equinor/webviz-subsurface/pull/1287) - Fixed bug when grouping on FACIES for non-standard static sources.

Expand Down
12 changes: 12 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 @@ -93,6 +95,16 @@ def __init__(
self._dataframe, self.pmodel.sens_df, on=["ENSEMBLE", "REAL"]
)

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

# set column order
colorder = self.selectors + self.VOLCOL_ORDER
self._dataframe = 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 Expand Up @@ -135,9 +136,11 @@ def comparison_callback(
require_response = selections["Response"] in ("STOIIP", "GIIP")
required_columns = ["BULK", "PORO", "SW"]
required_columns.append("BO" if selections["Response"] == "STOIIP" else "BG")
if not require_response or all(col in df for col in required_columns):
if not (
require_response and all(f"{col} diff" in df for col in required_columns)
):
return html.Div(
"Waterfall plot is only available for analyzing STOIIP/GIIP changes from static"
"Waterfall plot is only available for analyzing STOIIP/GIIP changes from static "
f"sources containing all {required_columns=}."
)
return waterfall_plot_layout(
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 2dcbed9

Please sign in to comment.