Commit Graph
8111 Commits
Author SHA1 Message Date
Kai Bao 6ac9c77708 not setting gas lift optimization group to be NONE
trying to fix the test_glift1 regression.
2026-01-27 10:34:03 +01:00
Kai Bao 66e72e3470 using comm_.sum() to do the parallel communication
for the groups that contributes to  rate target for wells.
2026-01-27 10:34:03 +01:00
Kai Bao faac251539 using struct for SingleWellState::group_target
hopefully more readable and more extensiable.
2026-01-27 10:34:03 +01:00
Kai Bao 7c70f91109 marking some groups are NONE group control
based whether the group contribute to some SingleWellState::group_target
2026-01-27 10:34:03 +01:00
Kai Bao 5e5a57dfd3 adding the group name to the SingleWellState:;group_target
so we might be able to use it to identifiy the NONE control group
2026-01-27 10:34:03 +01:00
Håkon Hægland 56caf85a10 Fix some logging fallout to non-zero MPI ranks
In multi-rank MPI runs, some log messages were written by all ranks instead
of only rank 0, causing "logging fallout" files (e.g., CASE.1.DBG, CASE.2.DBG).

Changes:
- Add rank check before calling logPressures() in FlowThresholdPressure
- Make TimeStepControl verbose flag rank-aware in createController()

This ensures only rank 0 produces log output for these code paths.
2026-01-26 13:44:57 +01:00
Håkon Hægland b704741b4c Fix well model slave group data exchange for history mode reservoir coupling
In history mode reservoir coupling, no GRUPSLAV keyword is defined because
rate allocation is not needed (wells use WCONHIST with imposed rates).
This caused assertion failures when the well model attempted to exchange
slave group data with numSlaveGroups == 0.

Changes:
- Skip receiving slave group production/injection data when numSlaveGroups == 0
- Skip sending slave group data when numSlaveGroups == 0
2026-01-26 12:12:13 +01:00
Håkon Hægland 4a5cdb6bff Merge pull request #6759 from hakonhagland/hm_grupslav_fix
Allow reservoir coupling slaves without GRUPSLAV for history matching mode
2026-01-26 12:07:53 +01:00
Kai Bao 2559a5af82 Merge pull request #6760 from GitPaean/removing_duplicated_pw_info
Removing duplicated pw_info from MultisegmentWellEval and MultisegmentWellEquations
2026-01-26 12:04:41 +01:00
Håkon Hægland a49aab171e Simplify GroupTargetCalculator by delegating to GroupStateHelper
Eliminate complicated variant handling in initForInjector_() and
initForProducer_(). The code previously required knowledge of std::variant
internals to understand.

Changes:
- Add getInjectionGuideTargetMode() and getProductionGuideTargetMode()
  to GroupStateHelper, delegating the Phase/CMode to GuideRateModel::Target
  conversion
- Refactor initForInjector_() and initForProducer_() to construct
  calculators directly instead of going through variant intermediaries
- Merge getTargetFromCalculator() and getTargetNoGuideRate() into
  getGroupTargetNoGuideRate(), eliminating redundant method and
  unused variant parameter
- Call GroupStateHelper directly for groupTarget() instead of extracting
  from variant

The variant type is still used for calcModeRateFromRates() which requires
the polymorphic behavior.
2026-01-26 12:02:19 +01:00
Markus Blatt 58a5b103e6 Merge pull request #6754 from hakonhagland/slaves_ngm_fix
Allow SLAVES without GRUPMAST for history mode reservoir coupling
2026-01-26 10:48:22 +01:00
Kai Bao 0392948c7d renaming some pw_info to parallel_well_info
for consistent naming.
2026-01-26 10:47:34 +01:00
Håkon Hægland eb821ec6c3 Allow reservoir coupling slaves without GRUPSLAV for history mode
History mode reservoir coupling only synchronizes time steps between
master and slaves. No rate allocation occurs, so GRUPSLAV (which maps
slave groups to master groups for rate constraints) is not needed.

Changes:
- Reorder master-slave initial communication so slaves receive master
  group names before determining activation date
- Handle zero master groups case in getMasterGroupNamesForSlave_(),
  sendMasterGroupNamesToSlaves_(), and receiveMasterGroupNamesFromMasterProcess_()
- Add numMasterGroups_() method to ReservoirCouplingSlave to detect
  history mode (no GRUPMAST on master means no master groups)
- When no GRUPSLAV found and numMasterGroups is zero, assume slave
  activation at simulation start (history mode)
2026-01-24 14:53:09 +01:00
Kai Bao 6de814f52b removing pw_info_ from MultisegmentWellEquations also 2026-01-24 11:11:06 +01:00
Kai Bao 80c0cd72fd removing pw_info_ member from MultisegmentWellEval
it is the same with parallel_well_info_ from WellInterfaceGeneric, so we
do not need to store another one.
2026-01-23 16:20:10 +01:00
Håkon Hægland 3aca3940ab Allow SLAVES without GRUPMAST for history mode reservoir coupling
History mode reservoir coupling only requires time synchronization, not
rate allocation. GRUPMAST is only needed for prediction mode where the
master allocates rates to slaves.
2026-01-23 16:04:17 +01:00
Arne Morten Kvarving b82f01574a fixed: signed/unsigned comparison warnings 2026-01-23 11:28:15 +01:00
Tor Harald Sandve 2aa246fa13 Merge pull request #6723 from svenn-t/tuningdp
Convergence check on max. solution update (TUNINGDP)
2026-01-23 07:47:37 +01:00
Håkon Hægland fda1b04f7c Bugfix: Also initialize target calculator for injectors 2026-01-22 18:54:59 +01:00
Håkon Hægland 8d988ecb7b Don't store toplevel_control_mode as a member 2026-01-22 18:54:59 +01:00
Håkon Hægland 28522ee936 Bugfix: Don't calculate target for none control
Don't calculate target for an injection group phase that has no
control.
2026-01-22 18:54:59 +01:00
Håkon Hægland 1f72344262 Bugfix: get correct guide rate for injectors
The current code fetched production guide rates for injectors.
2026-01-22 18:54:59 +01:00
Håkon Hægland 2c765a57da Bugfix: Pass parent group not group itself
When checking higher order constraints, we should start with the
parent of the master group, not the master group itself.
2026-01-22 18:54:59 +01:00
Markus Blatt 2ee0e7a4b6 Merge pull request #6711 from hakonhagland/gcw_fix
Reservoir coupling: Fix group controlled wells (GCW) calculation for reservoir coupling master groups
2026-01-22 17:02:19 +01:00
David Landa-Marbán 42a94df4ba Merge pull request #6747 from daavid00/warn
Removing not used deferred_logger
2026-01-22 13:16:16 +01:00
Svenn Tveit 708af98b7e Only set relaxed CNV flag for PV fraction if > 0.0 2026-01-22 13:07:55 +01:00
Svenn Tveit c0e5851486 Replace relaxed tol. messages with debug flags 2026-01-22 13:05:37 +01:00
Svenn Tveit c621f5254d Removed debug message and fix tolerance parameter checks 2026-01-22 13:03:42 +01:00
David Landa Marban b4cf82c1cd Removing not used deferred_logger 2026-01-22 12:50:07 +01:00
Håkon Hægland 1ae9d880ca Merge pull request #6737 from hakonhagland/gconsump_eff
Fix GCONSUMP efficiency factor application
2026-01-22 12:23:07 +01:00
Håkon Hægland 31f7954f52 Fix rebase issues 2026-01-22 11:14:54 +01:00
Håkon Hægland 2adacd2223 Fix GCW calculation for reservoir coupling master groups
Master groups in reservoir coupling have no wells in the master
reservoir (they represent slave groups), so their GCW (Group Controlled
Wells) count was 0. This caused them to be incorrectly excluded from:
- Guide rate distribution (FractionCalculator)
- Local reduction level calculations
- Target constraint checking

Fix: Set GCW = 1 for RC master groups by convention. This is consistent
with how GCW is used throughout the code - only the condition GCW > 0
matters, not the actual count.
2026-01-22 11:14:52 +01:00
Markus Blatt 5b942ef9cb Merge pull request #6709 from hakonhagland/gcw_auto_choke
Refactor auto choke group controlled wells exclusion logic in GroupStateHelper
2026-01-22 10:32:19 +01:00
Håkon Hægland f1510deb50 Fix GCONSUMP efficiency factor application
The GCONSUMP efficiency factor calculation was incorrectly applying group
efficiency factors to the groups themselves, rather than following the
the pattern used elsewhere in the code base:
  - Groups are NOT affected by their own efficiency factors
  - Parent groups apply child efficiency factors when accumulating contributions

Changes:
  - Fix GroupState::update_gconsump() to implement correct efficiency pattern
  - Add test suite with simple and complex hierarchy scenarios
2026-01-20 09:28:36 +01:00
Markus Blatt dbaaf241a2 Merge pull request #6710 from hakonhagland/gs_target_refact
Refactor target calculation in GroupStateHelper into helper methods
2026-01-19 16:55:59 +01:00
Markus Blatt 1bc2fd8637 Merge pull request #6704 from hakonhagland/rc_fix_sync
Reservoir Coupling: Fix sync of group data to only occur on first substep
2026-01-19 16:43:14 +01:00
Arne Morten Kvarving f7cf7d83fc remove unused lambda captures 2026-01-19 14:31:55 +01:00
Håkon Hægland 4f9bd3b471 Clarify comment 2026-01-19 12:18:08 +01:00
Håkon Hægland bb59fa82d1 Condensing and polishing comment wordings 2026-01-19 11:36:14 +01:00
Håkon Hægland e2c0f9d473 Merge pull request #6734 from hakonhagland/ucgd_deflog
Remove deferred_logger from updateAndCommunicate()
2026-01-19 08:48:26 +01:00
Tor Harald Sandve 77a05c23c8 Merge pull request #6725 from totto82/gsatprod6
accumulate satellite production/gaslift in gaslift code
2026-01-19 08:16:51 +01:00
Håkon Hægland 7f288000e2 Remove deferred_logger from updateAndCommunicate()
Removed deferred_logger parameter from updateAndCommunicate() and
updateAndCommunicateGroupData()
2026-01-17 06:15:44 +01:00
Håkon Hægland 8b2d3815f9 Fix rebase issues 2026-01-16 17:02:27 +01:00
Håkon Hægland a207ee3ac0 Refactor target calculation in GroupStateHelper into helper methods
Extract duplicated target calculation algorithm from four methods
into two reusable helper methods:

- getLocalReductionLevel_(): Finds the deepest level in the group chain
  where a group has both a guide rate and group-controlled wells (GCW > 0)

- applyReductionsAndFractions_(): Applies local reductions, add-back
  (when applicable), and guide rate fractions to calculate the portion
  of a top-level group target assigned to a bottom group

The refactored methods are:
- checkGroupConstraintsInj()
- checkGroupConstraintsProd()
- getWellGroupTargetInjector()
- getWellGroupTargetProducer()

This is a pure refactoring with no functional change. The helper methods
use templates for the reduction and fraction lambdas to avoid std::function
overhead in case of performance-critical code.
2026-01-16 16:54:34 +01:00
Håkon Hægland 75b00ea4f3 Refactor auto choke GCW exclusion logic in GroupStateHelper
Move the auto choke exclusion logic out of the well loop in
updateGroupControlledWellsRecursive_() and into a new helper method
isAutoChokeGroupUnderperforming_(). The calculation determines whether
to exclude all wells in an auto choke group from the Group Controlled
Wells (GCW) count based on whether the group is meeting its target rate.

The original code recalculated this group-level decision redundantly
for each well in the loop, even though the result is the same for all
wells. The refactored code computes it once before the loop.

This is a pure refactoring with no functional change.
2026-01-16 16:36:40 +01:00
Atgeirr Flø Rasmussen cdc61cefd2 Merge pull request #6705 from hakonhagland/deflog
Refactor DeferredLogger as a mutable pointer into GroupStateHelper
2026-01-16 16:04:30 +01:00
Tor Harald Sandve 3e0976af4b Add satelite production to network rates (also compute for groups with zero wells) 2026-01-16 10:12:47 +01:00
Tor Harald Sandve 53ad152929 accumulate satelite gaslift in network model 2026-01-16 09:17:09 +01:00
Tor Harald Sandve cf2a262b10 accumulate satelite production/gaslift in gaslift code 2026-01-16 09:17:09 +01:00
Bård Skaflestad cd78cb9790 Merge pull request #6731 from akva2/janitoring
add missing include
2026-01-15 16:36:47 +01:00