Commit Graph
23634 Commits
Author SHA1 Message Date
Håkon Hægland e87ae22727 Rebased on #6567 2025-12-20 05:30:36 +01:00
Håkon Hægland d29ead4813 Add comment about future refactorization potential 2025-12-20 05:30:36 +01:00
Håkon Hægland 23c9a9e37b Reorganized reservoir coupling files
Moved files specific to reservoir coupling to sub folder rescoup
2025-12-20 05:30:36 +01:00
Håkon Hægland 818da54499 Added some documentation for GroupTargetCalculator 2025-12-20 05:30:36 +01:00
Håkon Hægland f942da0b99 Rebased on master 2025-12-20 05:30:36 +01:00
Håkon Hægland 92d71abd91 Only send targets to activated slaves 2025-12-20 05:30:36 +01:00
Håkon Hægland b702697a4a Remove duplicate comment 2025-12-20 05:30:36 +01:00
Håkon Hægland deb201c765 Added missing trailing newline at eof 2025-12-20 05:30:36 +01:00
Håkon Hægland 819cc79000 Fix unintended copy in ReservoirCouplingSlave::maybeActivate()
Change auto to const auto& when accessing rescoup() to avoid unnecessary
copy of ReservoirCoupling::CouplingInfo object. The ptr_member::operator()()
returns a const reference, but auto deduces the value type, triggering
copy constructor overhead.

Performance improvements:
* Eliminates copy constructor/destructor calls
* Reduces memory allocation during method execution
* Improves cache efficiency
* Consistent with usage patterns elsewhere in codebase

Addresses performance concern from code review about unintended
copy operations.
2025-12-20 05:30:36 +01:00
Håkon Hægland 60fcd9c3f1 Send master group targets to slaves
Calculate master group targets based on slave group potentials, then
send the targets to the slave groups
2025-12-20 05:30:36 +01:00
Håkon Hægland 2d614b47fa Add ReservoirCoupling::Proxy to reduce #ifdef clutter in well model
Introduce a thin proxy class that encapsulates reservoir coupling
master/slave pointers and provides mode queries (isMaster/isSlave)
that work regardless of MPI availability.

Benefits:
- Mode queries can be called without #ifdef guards
- Member variables no longer need #ifdef protection
- Centralizes MPI-conditional includes in one header
- Consumer code becomes cleaner and more readable

Files changed:
- New: opm/simulators/wells/rescoup/RescoupProxy.hpp
- Modified: BlackoilWellModel.hpp, GuideRateHandler.hpp,
  GroupStateHelper.hpp to use the proxy pattern

The proxy is non-owning (just holds pointers) and copyable.
Setter methods remain guarded since they use MPI-only types.
2025-12-20 05:30:36 +01:00
Markus Blatt 3eee2885a2 Merge pull request #6681 from hakonhagland/fix_eff_factor
Bugfix: Use correct efficiency factor when adding back local reduction contribution in group constraint checking
2025-12-19 17:31:16 +01:00
Markus Blatt 17e35dc14e Merge pull request #6626 from hakonhagland/fix_group_target
Refactor TargetCalculator
2025-12-19 17:29:19 +01:00
Arne Morten Kvarving bfcd737256 Merge pull request #6699 from akva2/par_update_data
jenkins: parallelize reference data update
2025-12-19 14:27:51 +01:00
Arne Morten Kvarving ce80032ade parallelize reference data update 2025-12-19 13:46:33 +01:00
Arne Morten Kvarving 14cc5c2a05 fixed: also do opm-simulators rev parsing in loop
we do not want to rely on cwd
2025-12-19 13:04:18 +01:00
Arne Morten Kvarving fb9cb0be81 Merge pull request #6677 from atgeirr/fix-sprintf
Move linear system export and make it safer.
2025-12-19 12:55:30 +01:00
Atgeirr Flø Rasmussen e436efa295 Move linear system export and make it safer.
- Remove the print...() functions that only wrote partial information.
   If this is needed it may be done by extracting from the export...()
   output instead.
 - Move the export...() functions to a separate file. Keeping the
   top-level function though, and the logic it contained relating to
   avoiding re-writing the sparsity pattern.
 - Make the implementation safer by removing all use of sprintf().
2025-12-19 10:57:20 +01:00
Arne Morten Kvarving 01df15d657 Merge pull request #6698 from akva2/jenkins_add_sca
add static analysis
2025-12-18 14:25:51 +01:00
Arne Morten Kvarving 371b523d1a add static analysis 2025-12-18 14:11:35 +01:00
Bård Skaflestad 6c0a0bb8d4 Merge pull request #6683 from bska/operate-work-init-tests
Add INIT File Tests for WORK Arrays in OPERATE/OPERATER
2025-12-18 13:00:25 +01:00
Bård Skaflestad 020eae42c4 Add INIT File Tests for WORK Arrays in OPERATE/OPERATER
Uses the example models provided in PR OPM/opm-tests#1441.

These are INIT file only tests because the simulation models in
the two example cases aren't particularly interesting.
2025-12-18 12:03:38 +01:00
Bård Skaflestad bf03334b65 Merge pull request #6696 from bska/support-updating-init-files-only
Support Updating INIT File Only Test Cases
2025-12-18 11:59:27 +01:00
Bård Skaflestad 5c24cd2dab Support Updating INIT File Only Test Cases
Certain example models don't have meaningful dynamic results, but
we'd still like to be able to automatically update the static result
files like EGRID and INIT. This commit adds such support under the
assumption that those test cases have names that match the pattern

    *compareECLInitFiles*

While here, also adapt the existing Norne-based INIT file test to
use this file update mechanism instead of its original special case
treatment.
2025-12-18 11:35:47 +01:00
Bård Skaflestad c5caa0861b Merge pull request #6695 from bska/guard-against-missing-result-files
Guard Against Non-Existent Files in Comparison
2025-12-18 11:19:28 +01:00
Bård Skaflestad a3e0453324 Guard Against Non-Existent Files in Comparison
If the reference file does not exist, then this is typically a new
file type or a new case. If the updated file does not exist, then
this is typically because the case no longer generates that
particular file type. If neither the reference nor the update
exists, then that is typically an error that should have been caught
earlier. We nevertheless emit a line into 'data_diff' in this case.
2025-12-18 10:51:29 +01:00
Bård Skaflestad ecd09ccbb3 Merge pull request #6688 from bska/refactor-refdata-update-script
Refactor Reference Solution Update Script
2025-12-17 17:57:17 +01:00
Bård Skaflestad e7100402f0 Refactor Reference Solution Update Script
In particular, separate the individual "update" cases out to
per-case helper functions:

  - updateFullSimulationResults -- Common case.  Updates all file
    types (EGRID, INIT, RFT, SMSPEC, UNSMRY, UNRST) for both base
    runs and restarted runs.
  - updateRestartResults -- Updates all file types for restarted
    runs only.
  - updateDamarisResults -- Updates Damaris-related file types.
  - updateNorneInitFiles -- Updates INIT and EGRID files for the
    Norne case as needed.

While here, also switch to a 'while read' loop for processing
'LastTestsFailed.log' to avoid a needless use of 'cat' and add
rudimentary script and function documentation.  Finally, switch to
using 'printf' instead of an 'echo' loop to generate the commit
message's list of changed test cases.
2025-12-17 17:33:25 +01:00
Arne Morten Kvarving ab3bc80738 Merge pull request #6692 from akva2/jenkins_sep_clone
separate cloning from building in jenkins pipeline
2025-12-17 14:57:13 +01:00
Arne Morten Kvarving e270de559d separate cloning from building in jenkins pipeline 2025-12-17 12:58:32 +01:00
Kai Bao 46ced47847 Merge pull request #6690 from GitPaean/glift_case
correcting the GRUPTREE in GLIFT1.DATA
2025-12-17 12:26:25 +01:00
Kai Bao 4a95285987 correcting the GRUPTREE in GLIFT1.DATA
PROD should be PLAT-A.
2025-12-17 11:53:22 +01:00
Bård Skaflestad c2981c4c3b Merge pull request #6685 from bska/move-add-multi-tests
Move ADD_MULTIPLE_TESTS to Main Test Setup File
2025-12-15 15:37:59 +01:00
Bård Skaflestad 7d92052fd1 Move ADD_MULTIPLE_TESTS to Main Test Setup File
This makes the macros available to all test categories.
2025-12-15 14:04:00 +01:00
Håkon Hægland da720e1900 Fix efficiency factor addback in group constraint checking
The addback calculation at local_reduction_level was using the
accumulated efficiency factor (from entity to control group) instead
of the partial efficiency factor (from entity to local_reduction_level).

This caused incorrect constraint violations when checking higher-level
group constraints. The fix computes the partial efficiency by multiplying
efficiency factors from local_reduction_level down to the entity.
2025-12-15 08:28:39 +01:00
Håkon Hægland 172d62e93a Add test for checkGroupConstraintsProd efficiency factor bug
This test exposes a bug in GroupStateHelper::checkGroupConstraintsProd()
where the addback calculation uses the accumulated efficiency factor
instead of the partial efficiency factor at local_reduction_level.

Test setup:
- Group hierarchy: FIELD -> PLAT (E=0.9) -> MANI (E=0.8) / MANI2 (E=0.7)
- MANI has individual ORAT control, PLAT has guide rate
- WELL-A produces 10000 SM3/day under MANI

The bug causes:
- Addback uses 0.72 (E_MANI * E_PLAT) instead of 0.8 (E_MANI)
- This results in scale = 0.9465 (false constraint violation)
- Correct calculation would give scale = 1.0288 (no violation)

The test currently passes with the buggy expected values. A subsequent
commit will fix the bug and update the test expectations.
2025-12-13 08:00:12 +01:00
Håkon Hægland 823abc8358 Remove unused variable 2025-12-12 18:22:18 +01:00
Håkon Hægland 55750a3f4f Fix indentation 2025-12-12 18:17:52 +01:00
Håkon Hægland eefd944e32 Add comment explaining non-const reference
Added a comment explaining why we cannot push a const
group state to GroupStateHelper
2025-12-12 18:17:52 +01:00
Håkon Hægland 9c5469d6ad Refactor TargetCalculator
Refactor TargetCalculator::groupTarget() to
WellGroupHelper::getProductionGroupTarget(), and
don't pass Group::ProductionControls as a parameter. Since
TargetCalculator only works for a given group, passing control as a
parameter is confusing and can be error prone if being passed a control
for a different group than the TargetCalculator was constructed for.
2025-12-12 18:17:52 +01:00
Markus Blatt 461184d85e Merge pull request #6679 from hakonhagland/push_well_state
Bugfix: groupStateHelper uses potentially wrong WellState
2025-12-12 17:40:19 +01:00
Bård Skaflestad 464daffc85 Merge pull request #6678 from akva2/janitoring_clang
Janitoring: quell clang warnings
2025-12-12 11:30:28 +01:00
Arne Morten Kvarving 57696b58de disable unused inline methods 2025-12-12 10:36:58 +01:00
Arne Morten Kvarving 4c604277ae remove unused variable 2025-12-12 10:36:58 +01:00
Arne Morten Kvarving e9c37df8e1 remove useless assignment 2025-12-12 10:36:58 +01:00
Håkon Hægland 857ae931eb Bugfix: groupStateHelper uses wrong WellState
When well_state is copied, groupStateHelper should be updated to use
that copy
2025-12-12 10:33:28 +01:00
Markus Blatt 8760adab72 Merge pull request #6658 from hakonhagland/rc_proxy
Add ReservoirCoupling::Proxy to reduce #ifdef clutter in well model
2025-12-11 21:13:58 +01:00
Håkon Hægland 5430b489eb Add header that conditonally defines RESERVOIR_COUPLING_ENABLED 2025-12-11 15:22:28 +01:00
Håkon Hægland 23322c174f Remove #include <config.h> 2025-12-11 15:10:28 +01:00
Håkon Hægland 86fb442452 Add ReservoirCoupling::Proxy to reduce #ifdef clutter in well model
Introduce a thin proxy class that encapsulates reservoir coupling
master/slave pointers and provides mode queries (isMaster/isSlave)
that work regardless of MPI availability.

Benefits:
- Mode queries can be called without #ifdef guards
- Member variables no longer need #ifdef protection
- Centralizes MPI-conditional includes in one header
- Consumer code becomes cleaner and more readable

Files changed:
- New: opm/simulators/wells/rescoup/RescoupProxy.hpp
- Modified: BlackoilWellModel.hpp, GuideRateHandler.hpp,
  GroupStateHelper.hpp to use the proxy pattern

The proxy is non-owning (just holds pointers) and copyable.
Setter methods remain guarded since they use MPI-only types.
2025-12-11 14:52:49 +01:00