Extend group constraint tests with multi-group hierarchy

This commit extends the test_group_higher_constraints test suite with:

1. Extended hierarchy: Added MANI-2 group (with WELL-B) under PLAT to
   create realistic group competition scenarios where fractions < 1.0.
   The new hierarchy is:

     FIELD -> PLAT -> MANI -> WELL-A, WELL-A2
                   -> MANI-2 -> WELL-B
           -> PLAT-2 -> WELL-C

2. New tests for getWellGroupTargetProducer():
   - TestWellGroupTargetProducerIndividualControl: WELL-A under ORAT
   - TestWellGroupTargetProducerGrupControl: WELL-A under GRUP
   - TestWellGroupTargetProducerWithSiblingIndividualControl: WELL-A
     under GRUP with sibling WELL-A2 under ORAT (demonstrates case
     where reduction != addback)

3. Updated existing tests:
   - TestGroupHigherConstraintsWithGuideRate: scale now 0.922 (was 1.39)
   - TestGroupHigherConstraintsProdWithoutGuideRate: scale now 0.901
This commit is contained in:
Håkon Hægland committed 2026-01-03 16:30:09 +01:00
1 parent 732eba5571
commit 70096bec80
3 files changed
+897 -257

No files matched your search

@@ -380,6 +380,24 @@ template<class Scalar> class WellContributions;
ReservoirCoupling::Proxy<Scalar>& rescoup() { return rescoup_; }
const ReservoirCoupling::Proxy<Scalar>& rescoup() const { return rescoup_; }
/// \brief Update guide rates for all wells and groups
///
/// Computes guide rates based on well potentials and group hierarchy.
/// This is typically called at the beginning of each timestep.
///
/// \param report_step_idx Current report step index
/// \param sim_time Current simulation time
/// \param deferred_logger Logger for deferred messages
void updateGuideRates(const int report_step_idx,
const double sim_time,
DeferredLogger& deferred_logger)
{
this->guide_rate_handler_.setLogger(&deferred_logger);
this->guide_rate_handler_.updateGuideRates(
report_step_idx, sim_time, this->wellState(), this->groupState()
);
}
/// @brief Check if this process is a reservoir coupling master
bool isReservoirCouplingMaster() const { return rescoup_.isMaster(); }
+65 -38
View File
@@ -3,24 +3,30 @@
-- individual contents of the database are licensed under the Database Contents
-- License: http://opendatacommons.org/licenses/dbcl/1.0/
-- Test case for efficiency factor handling in checkGroupConstraintsProd()
-- Test case for group higher constraints handling in checkGroupConstraintsProd() and getWellGroupTargetProducer()
-- Group hierarchy:
--
-- FIELD (ORAT = 10000)
-- |
-- PLAT (GEFAC=0.9, FLD, has GUIDERAT)
-- / \
-- / \
-- MANI (GEFAC=0.8) MANI2 (GEFAC=0.7)
-- ORAT control FLD control
-- | |
-- WELL-A WELL-B
-- FIELD (ORAT = 10000)
-- / \
-- / \
-- PLAT (GEFAC=0.9) PLAT-2 (GEFAC=0.85)
-- / \ |
-- / \ WELL-C
-- MANI (0.8) MANI-2 (0.75)
-- / \ |
-- WELL-A WELL-A2 WELL-B
--
-- This setup allows testing:
-- - local_reduction_level affects which fraction is applied at FIELD level
-- - When PLAT has guide rate: local_reduction_level=1 (PLAT), fraction at FIELD=1.0
-- - When no guide rate at PLAT: local_reduction_level=0 (FIELD), PLAT fraction<1.0
--
-- Having MANI-2 as sibling to MANI ensures:
-- - PLAT has group-controlled wells (via MANI-2)
-- - MANI competes with MANI-2 for rate allocation at PLAT level
-- - PLAT participates in FIELD-level fraction calculation
--
-- This setup triggers checkGroupConstraintsProd() for MANI with:
-- - local_reduction_level at PLAT (because PLAT has guide rate)
-- - efficiency_factor = 0.9 * 0.8 = 0.72
RUNSPEC
TITLE
@@ -41,7 +47,7 @@ START
WELLDIMS
-- max wells, max cons/well, max groups, max wells/group
4 5 5 4 /
6 5 6 4 /
TABDIMS
/
@@ -162,33 +168,41 @@ SCHEDULE
-- =============================================================================
GRUPTREE
'PLAT' 'FIELD' /
'MANI' 'PLAT' /
'MANI2' 'PLAT' /
'PLAT' 'FIELD' /
'PLAT-2' 'FIELD' /
'MANI' 'PLAT' /
'MANI-2' 'PLAT' /
/
-- Well specifications
WELSPECS
'WELL-A' 'MANI' 3 3 2010 'OIL' /
'WELL-B' 'MANI2' 2 2 2010 'OIL' /
'WELL-A' 'MANI' 3 3 2010 'OIL' /
'WELL-A2' 'MANI' 4 4 2010 'OIL' /
'WELL-B' 'MANI-2' 5 5 2010 'OIL' /
'WELL-C' 'PLAT-2' 2 2 2010 'OIL' /
/
COMPDAT
'WELL-A' 3 3 1 3 'OPEN' 1* 1* 0.2 /
'WELL-B' 2 2 1 3 'OPEN' 1* 1* 0.2 /
'WELL-A' 3 3 1 3 'OPEN' 1* 1* 0.2 /
'WELL-A2' 4 4 1 3 'OPEN' 1* 1* 0.2 /
'WELL-B' 5 5 1 3 'OPEN' 1* 1* 0.2 /
'WELL-C' 2 2 1 3 'OPEN' 1* 1* 0.2 /
/
-- Group efficiency factors
GEFAC
'PLAT' 0.9 /
'MANI' 0.8 /
'MANI2' 0.7 /
'PLAT' 0.9 /
'PLAT-2' 0.85 /
'MANI' 0.8 /
'MANI-2' 0.75 /
/
-- Well efficiency factors
WEFAC
'WELL-A' 1.0 /
'WELL-B' 1.0 /
'WELL-A' 1.0 /
'WELL-A2' 1.0 /
'WELL-B' 1.0 /
'WELL-C' 1.0 /
/
-- Group controls
@@ -197,31 +211,44 @@ GCONPROD
'FIELD' 'ORAT' 10000 1* 1* 1* 'RATE' /
/
-- PLAT is under FLD control with guide rate enabled ('YES' and 'FORM')
-- PLAT is under FLD control with explicit guide rate
-- Guide rate = E_MANI*(WELL-A+WELL-A2) + E_MANI2*WELL-B = 0.8*10000 + 0.75*2000 = 9500
-- Having a guide rate on PLAT triggers local_reduction_level at PLAT in checkGroupConstraintsProd()
GCONPROD
'PLAT' 'FLD' 1* 1* 1* 1* 'RATE' 'YES' 1* 'FORM' /
'PLAT' 'FLD' 1* 1* 1* 1* 'RATE' 'YES' 9500 'OIL' /
/
-- Guide rate formula (applies to all groups/wells using 'FORM' target)
GUIDERAT
-- min.int type A B C D E F allow.inc damp.factor use.free.gas
0 'OIL' 1.0 0.0 1.0 1.0 0.0 0.0 'YES' 1.0 'NO' /
-- PLAT-2 is under FLD control with explicit guide rate
-- Guide rate = E_PLAT2 * WELL-C = 0.85 * 3000 = 2550
GCONPROD
'PLAT-2' 'FLD' 1* 1* 1* 1* 'RATE' 'YES' 2550 'OIL' /
/
-- MANI has individual ORAT control (this triggers checkGroupConstraintsProd)
-- Guide rate = E_MANI * (WELL-A + WELL-A2) = 0.8 * 10000 = 8000
GCONPROD
'MANI' 'ORAT' 5000 1* 1* 1* 'RATE' /
'MANI' 'ORAT' 5000 1* 1* 1* 'RATE' 'YES' 8000 'OIL' /
/
-- MANI2 has FLD control - this creates a sibling for MANI to share PLAT's allocation via guide rates
-- MANI-2 is under FLD control with explicit guide rate
-- Guide rate = E_MANI2 * WELL-B = 0.75 * 2000 = 1500
GCONPROD
'MANI2' 'FLD' 1* 1* 1* 1* 'RATE' /
'MANI-2' 'FLD' 1* 1* 1* 1* 'RATE' 'YES' 1500 'OIL' /
/
-- Guide rate formula for wells (guide_rate = oil_potential)
-- Formula: guide_rate = potential^A / (B + C*R1^D + E*R2^F) where R1=wat/oil, R2=gas/oil
-- With A=1, B=1, C=0, D=0, E=0, F=0: guide_rate = oil_pot^1 / (1 + 0 + 0) = oil_pot
GUIDERAT
-- min.int type A B C D E F allow.inc damp.factor use.free.gas
0 'OIL' 1.0 1.0 0.0 0.0 0.0 0.0 'YES' 1.0 'NO' /
-- Wells under group control
WCONPROD
'WELL-A' 'OPEN' 'GRUP' 1* 1* 1* 1* 1* 100.0 /
'WELL-B' 'OPEN' 'GRUP' 1* 1* 1* 1* 1* 100.0 /
'WELL-A' 'OPEN' 'GRUP' 1* 1* 1* 1* 1* 100.0 /
'WELL-A2' 'OPEN' 'GRUP' 1* 1* 1* 1* 1* 100.0 /
'WELL-B' 'OPEN' 'GRUP' 1* 1* 1* 1* 1* 100.0 /
'WELL-C' 'OPEN' 'GRUP' 1* 1* 1* 1* 1* 100.0 /
/
TSTEP
File diff suppressed because it is too large. Load diff