Skip to content

Commit

Permalink
Only print THPRES between neighboring equil regions (#403)
Browse files Browse the repository at this point in the history
* only print thpres between neighbouring equil regions

* changelog

* from 0-index to 1-index in template
  • Loading branch information
olelod authored May 10, 2021
1 parent 8fc3fe3 commit de23dc0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
- [#372](https://github.com/equinor/flownet/pull/372) Added option to let the additional flownodes initially be placed within the original volume rather than within the convex hull of the real wells. To do this set place_nodes_in_volume_reservoir to true.

### Fixes
- [#403](https://github.com/equinor/flownet/pull/403) Fixes bug in generation of THPRES keyword for OPM Flow
- [#391](https://github.com/equinor/flownet/pull/391) Fixes bug in generation of yaml files for visualization in Webviz.
- [#372](https://github.com/equinor/flownet/pull/372) Fixes bug of hull_factor not actually being used for placing additional nodes outside the perforations.
- [#374](https://github.com/equinor/flownet/pull/374) Fix for memory leak in result plotting script.
Expand Down
17 changes: 16 additions & 1 deletion src/flownet/parameters/_equilibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,22 @@ def render_output(self) -> Dict:
for connections_at_node in self._network.connection_at_nodes:
eqlnum_combinations.extend(list(combinations(connections_at_node, 2)))

eqlnum_combinations = list(set(eqlnum_combinations))
# Go from tube index to equilibrium region index (0-index to 1-index)
# remove duplicates, and only one way thpres needed
eqlnum_combinations = list(
{
(
self._eqlnum.loc[tube_a, "EQLNUM"],
self._eqlnum.loc[tube_b, "EQLNUM"],
)
for _, [tube_a, tube_b] in enumerate(eqlnum_combinations)
if self._eqlnum.loc[tube_b, "EQLNUM"]
> self._eqlnum.loc[tube_a, "EQLNUM"]
}
)
# sort for readability
eqlnum_combinations.sort()

eqlnum1 = list(list(zip(*eqlnum_combinations))[0])
eqlnum2 = list(list(zip(*eqlnum_combinations))[1])

Expand Down
2 changes: 1 addition & 1 deletion src/flownet/templates/THPRES.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
-- FROM TO VALUE
THPRES
{% for i in range(eqlnum1|length) -%}
{{ eqlnum1[i] + 1 }} {{ eqlnum2[i] + 1 }} 1* /
{{ eqlnum1[i]}} {{ eqlnum2[i]}} 1* /
{% endfor -%}
/

0 comments on commit de23dc0

Please sign in to comment.