Commit Graph
2452 Commits
Author SHA1 Message Date
Arne Morten Kvarving 32413cec42 fix build with cuda 12.0
cuda 12.0 (default in ubuntu 24.04) cannot build fmt.
furthermore, cuda 12.0 only supports up to g++-12 as host compiler,
meaning there is no std::format either. so workaround where possible
by using stringstreams

the test_primary_variables_gpu pulls in too much generic code
so disable it.

i'm not entirely sure if 12.1 is enough for our code to compile
but at least this fixes build issues on a common configuration
2026-04-08 12:02:13 +02:00
Tor Harald Sandve e4842a3569 Merge pull request #6650 from svenn-t/tpsa_pr
Two-point stress approximation (TPSA) geomechanics
2026-04-07 10:14:20 +02:00
David Landa Marban d59ddcfbca Fixing a couple of warnings 2026-03-31 13:56:01 +02:00
Elyes Ahmed ed7fce0b04 Add RSCONST keyword support for simplified two-phase simulation
Implement the RSCONST keyword, which models oil/water systems with dead
oil and constant dissolved gas ratio (RS). This assumes RS is uniform
and pressure remains above the bubble point, enabling faster simulation
through simplified equation formulations.

- Add PVT calculations for RSCONST dead oil properties
- Update equilibration state initialization for RSCONST conditions
- Modify well model and state tracking for new phase behavior
- Add unit tests for well state validation
2026-03-31 10:37:27 +02:00
Svenn Tveit 106d8d51c9 TPSA implementation with coupling to Flow.
- TPSA-Flow coupling done at the nonlinear solver step level:
- -- Lagged coupling -> TPSA lags behind one time step
- -- Fixed-stress -> Iterate until Flow and TPSA converge
- Generic TPSA solver using Newton with associated linearizer.
- Linear elasticity equations implemented
- Specialized version of ISTL linear solver for TPSA
- Output to restart files and VTK
2026-03-26 15:23:47 +01:00
Håkon Hægland a9a694b9fa Add GCONINJE top-up phase validation
Reject invalid GCONINJE configurations where multiple RESV/VREP
injection phases conflict, either within the same group or along
an ancestor-descendant path in the group hierarchy. Disconnected
branches with different top-up phases remain allowed.

The validation runs once per time step from setCmodeGroup() when
processing the FIELD group, before injection controls and guide
rates are propagated.

Also add a defensive NETV guide rate check in GuideRateHandler
that rejects NETV usage when the group's top-up phase does not
match the guide rate phase.

Companion PR: opm-common change to exclude REIN from
Group::topup_phase(), so it only reflects RESV and VREP modes.
2026-03-24 07:20:39 +01:00
Arne Morten Kvarving b5c39c89d4 Merge pull request #6908 from akva2/hip_remove_unsupported_diag_suppression
remove unsupport diagnostic
2026-03-18 11:29:34 +01:00
Bård Skaflestad 7d175770e3 Merge pull request #6903 from akva2/janitoring_cuda
Janitoring: quell some cuda warnings
2026-03-10 14:55:35 +01:00
Arne Morten Kvarving a6dc3d959a adjust to removed HAVE_ECL_(IN|OUT)PUT options 2026-03-09 18:07:33 +01:00
Arne Morten Kvarving 5af2bf6a0e remove unsupport diagnostic
at least with rocm 7.1, hipcc does not support this diagnostic.
and thus it obviously isn't necessary (any longer)
2026-03-06 08:51:32 +01:00
Arne Morten Kvarving 7ae36dc520 quell some warnings in cuda kernels 2026-03-06 08:26:33 +01:00
Arne Morten Kvarving f435b43538 remove redundant initialization 2026-03-05 09:32:47 +01:00
Arne Morten Kvarving 620e1d49c7 remove virtual qualifier on override methods 2026-03-05 09:32:47 +01:00
Arne Morten Kvarving de2f405816 cosmetics 2026-03-05 09:32:47 +01:00
Arne Morten Kvarving 3ae1767e0a quell compiler warning
function is unused for bz == 1 (since we do not use cpr in that case),
but compiler doesn't know that so it will warn about oob deref in
getQuasiImpesWeights
2026-03-05 09:32:47 +01:00
Bård Skaflestad 1a2d15522f Merge pull request #6887 from akva2/fix_1x1_tests
changed: do not run cpr on 1x1 block system
2026-02-27 16:49:53 +01:00
Arne Morten Kvarving 66578d46ce changed: do not run cpr on 1x1 block system
it makes no sense. instead just use ilu0
2026-02-27 11:19:51 +01:00
Jakob Torben 61113726d8 Refactor logic based on iteration index 2026-02-26 17:35:14 +01:00
Bård Skaflestad 79eb2a0d8f Merge pull request #6873 from akva2/replace_erase_remove
replace erase-remove idiom with std::erase[_if]
2026-02-24 13:05:21 +01:00
Arne Morten Kvarving 7025f17da5 replace erase-remove idiom with std::erase[_if] 2026-02-24 11:38:54 +01:00
Arne Morten Kvarving 70e70b65e3 replace std::equal with std::ranges::equal where appropriate
the c++-20 constrained algorithm is safer and code is more readable
2026-02-24 11:30:38 +01:00
Arne Morten Kvarving 35d9ab77bb replace std::max_element with std::ranges::max_element where appropriate
the c++-20 constrained algorithm is safer and code is more readable
2026-02-24 07:59:48 +01:00
Arne Morten Kvarving e030a590a9 replace std::find with std::ranges::find where appropriate
the c++-20 constrained algorithm is safer and code is more readable
2026-02-23 13:18:29 +01:00
Arne Morten Kvarving f00ab30268 replace std::fill with std::ranges::fill where appropriate
the c++-20 constrained algorithm is safer and code is more readable
2026-02-23 10:23:45 +01:00
Tor Harald Sandve f29e84d06b Merge pull request #6837 from hakonhagland/refact_wgc
Move getAutoChokeGroupProductionTargetRate() to GroupStateHelper
2026-02-20 14:18:24 +01:00
Arne Morten Kvarving 670743f786 replace std::transform with std::ranges::transform where appropriate
the c++-20 constrained algorithm is safer and code is more readable
2026-02-20 13:28:11 +01:00
Håkon Hægland 7abd6f9b88 Move autochoke target rate to GroupStateHelper
Move getAutoChokeGroupProductionTargetRate() from
WellGroupControls (static method) to GroupStateHelper
(member method). The method has no well dependency and
manually reimplements chain iteration already available
as applyReductionsAndFractions_().

The moved implementation delegates to
applyReductionsAndFractions_() with do_addback=false
and the actual getLocalReductionLevel_() value, replacing
the manual reduction loop.

Make getLocalReductionLevel_() private again (reverting
the visibility change from the previous commit), since
its only external caller was the now-removed static
method in WellGroupControls.

Remove unused FractionCalculator.hpp include from
WellGroupControls.cpp and WellGroupControls.hpp include
from BlackoilWellModelNetwork_impl.hpp and the test file.
2026-02-19 20:17:33 +01:00
Håkon Hægland 9b9864551d Fix autochoke target rate and clean up guide rate
Add local_reduction_level gating to the autochoke target
loop in getAutoChokeGroupProductionTargetRate(), preventing
double-counting of reductions at intermediate groups with
group-controlled-wells count of zero.

Remove getGuideRate() from GroupStateHelper: the group path
is dead code (only caller was isAutoChokeGroupUnderperforming_
which now uses guide_rate_ directly), and the well path is
inlined into FractionCalculator::guideRate().

Improve isAutoChokeGroupUnderperforming_() to compute the
control group guide rate as the sum of its FLD children's
guide rates (matching how targets are distributed), and
accumulate efficiency factors from the autochoke group up
to the control group. This makes the formula correct for
the common case where the control group is the immediate
parent with no reductions.

Rename getLocalReductionLevel_ to getLocalReductionLevel
and make it public, as it is now called from
WellGroupControls.cpp.

Update test to verify the corrected target rate and remove
references to the now-fixed double-counting issue.
2026-02-17 15:41:08 +01:00
Håkon Hægland 504c8f62e5 Add tests for autochoke group target rate
Add two test cases for getAutoChokeGroupProductionTargetRate():

- TestAutoChokeGroupProductionTargetRate: normal case with
  MANI (autochoke, FLD) under intermediate group PLAT that
  has a guide rate. Verifies the autochoke reduction loop
  produces the same result as applyReductionsAndFractions_()
  when both are applicable.

- TestAutoChokeGroupTargetRateDoubleCountingBug: uses a
  NETWORK DATA file with NODEPROP (as_choke=YES) and lower
  well rates to naturally trigger underperformance detection
  (GCW=0). Documents the double-counting bug where missing
  local_reduction_level gating causes reductions to be
  subtracted at both FIELD and PLAT, producing a clamped-
  to-zero target instead of the correct value.

Also adds GROUP_HIGHER_CONSTRAINTS_NETWORK.DATA with
BRANPROP/NODEPROP keywords and parameterizes the test
fixture with mani2_control, data_file, and well rates.
2026-02-17 15:41:08 +01:00
Arne Morten Kvarving d3ddee8f55 fix breakage for gpu bridge with no cuda 2026-02-13 09:19:59 +01:00
Kai Bao c9ab29864e fixing compilation test_group_higher_constraints after rebasing 2026-01-27 10:34:03 +01:00
Arne Morten Kvarving b953b94f7d fixed: updating of restart reference files 2026-01-27 10:00:08 +01:00
Arne Morten Kvarving e1f16115f6 fix: update_data and failure_report triggers
for reason unknown, cmake sometimes choose to pad/escape test names with a
=[ ... ]= in the CTestTestFile. Due to changes lately, this has somehow
triggered. Since we rely on extrating information
from this file, update_data and failure_report triggers broke.

this makes the re's more resilient by allowing the existence of the separators
2026-01-23 13:26:59 +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 3903701283 Also suggest cmake tool abstraction
Also suggest build with cmake tool abstraction command line
2026-01-21 15:55:28 +01:00
Håkon Hægland 6fd1142db5 Improve error message for missing simulator binary in regression tests
Add a check in run-regressionTest.sh that provides a clear error message
with build instructions when the simulator binary is not found.
2026-01-21 15:31:03 +01:00
Håkon Hægland 327dcd5a3c Make GCONSUMP test DATA files runnable with flow simulator
Update GCONSUMP.DATA and GCONSUMP_COMPLEX.DATA to be valid input for
full simulation runs while preserving their unit test functionality:

- Fix EQUIL datum depth to match gas-oil contact (7020 → 7000)
- Fix PVTO bubble point relationship (Rs/Pbub must be monotonic)
- Extend PVDG pressure range to cover reservoir pressure (→ 300 bar)
- Adjust SGOF Sg_max to avoid floating-point SOGCR precision issue
2026-01-21 14:58:28 +01:00
Arne Morten Kvarving 59a95f6ac7 put message file in workspace
/tmp is not the same when built in docker
2026-01-20 10:59:10 +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
Håkon Hægland e5e589f54b Always extract the logger from groupStateHelper
Don't create extra deferred loggers that do not match
the logger in groupStateHelper
2026-01-14 09:49:36 +01:00
Håkon Hægland 3999a59024 Simplify method signatures by removing redundant DeferredLogger parameter
Methods that receive GroupStateHelper can obtain the DeferredLogger via
groupStateHelper.deferredLogger(), making the separate parameter redundant.
2026-01-14 07:23:22 +01:00
Håkon Hægland 3edabe430f Adapt test case to not pass deferred logger 2026-01-10 10:24:51 +01:00
Håkon Hægland c442f2da69 Cleanup 2026-01-04 10:39:19 +01:00
Håkon Hægland 70096bec80 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
2026-01-03 16:30:09 +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
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
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
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 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