Commit Graph
24362 Commits
Author SHA1 Message Date
Kjetil Olsen Lye 49dc9bcb18 Basic .clang-tidy and recommendation to use it (#7023)
* Added .clang-tidy

* Added description in CONTRIBUTION.md
2026-04-30 13:52:56 +02:00
Bård Skaflestad 04873a8eb9 Merge pull request #7019 from GitPaean/DEBUGLOG_co2_ptflash_ecfv
Add DEBUGLOG backend to PTFlash example co2_ptflash_ecfv
2026-04-29 14:05:49 +02:00
Markus Blatt 481b03f787 Merge pull request #7012 from blattms/bugfix/support-parmetis-again
[cmake] Search for ParMETIS and use it if it is there.
2026-04-29 13:15:34 +02:00
Kai Bao bb5d1230fb Add DEBUGLOG backend to PTFlash example co2_ptflash_ecfv 2026-04-29 13:14:21 +02:00
Markus Blatt 88b985c2af Document the processing of the *prereq.cmake file a bit. 2026-04-29 12:52:35 +02:00
Markus Blatt 2314c80699 Only search for ParMETIS in the prereq file
and make sure that we always search for ParMETIS in the *prereq.cmake file

This file gets processed when running CMake for opm-simulators and
during a find_package(opm-simulators) call.
2026-04-29 12:52:35 +02:00
Arne Morten Kvarving 50478b7516 Merge pull request #7002 from blattms/bugfix/recover-avx-flags
[bugfix,cmake] Make sure avx2 defines are set for compilation if supported.
2026-04-29 08:14:31 +02:00
Markus Blatt 827fdda14f [bugfix] Make sure avx2 defines are set for compilation if supported.
Previously this was done via config.h, but due to the recent build
system refactoring these defines became MIA and some  code is never
activated even if it would be supported by the hardware.

We now set the necessary compile definitois as properties for the relevant
source files to fix this.
2026-04-28 20:58:40 +02:00
Markus Blatt 656cd9540c Merge pull request #6972 from aritorto/bridgeNNCs
[LGR] Pass in writeInitial an NNCCollection to allow output of the 3 NNC types
2026-04-28 20:06:58 +02:00
Bård Skaflestad 3bce02799a Merge pull request #7013 from akva2/janitoring_move_log_to_tu
SimulatorFullyImplicitBlackoil: move tuning logging to TU
2026-04-28 13:57:19 +02:00
Bård Skaflestad 84442eddcf Merge pull request #7010 from hakonhagland/sfib_doxygen
Add Doxygen to SimulatorFullyImplicitBlackoil.hpp
2026-04-28 13:39:14 +02:00
Arne Morten Kvarving 46cc3dcedd SimulatorFullyImplicitBlackoil: move tuning logging to TU 2026-04-28 12:42:07 +02:00
Håkon Hægland 9457b7ea2f Add Doxygen to SimulatorFullyImplicitBlackoil.hpp
Document the class, the constructor, and the member functions whose
semantics are not self-evident from the name; add brief annotations
to the member variables describing role, ownership, and lifecycle.

Class-level docs cover the per-report-step loop, what the class owns
(solver, tuning-update callback, report aggregation, convergence-output
thread, OPMRST, reservoir-coupling bring-up), and how it is instantiated.

Member functions documented individually: the constructor, destructor,
registerParameters, both run() overloads (RC and non-RC),
checkRunningAsReservoirCouplingMaster, both init() overloads,
updateTUNING, updateTUNINGDP, runStep, finalize, serializeOp,
loadState, saveState, getHeader, createSolver.

Outdated comments removed/rewritten.

No behavior change.
2026-04-28 12:28:13 +02:00
Håkon Hægland f493b4e4c5 Merge pull request #7008 from hakonhagland/refact_sfib
Split SimulatorFullyImplicitBlackoil header
2026-04-28 12:26:09 +02:00
Tor Harald Sandve 2c3ce902d4 Merge pull request #6999 from hakonhagland/fix_sync_steps
Reservoir coupling: Sync master and slaves at master time steps by default
2026-04-28 11:23:42 +02:00
Kjetil Olsen Lye e7351300b5 Merge pull request #6995 from kjetilly/gpu_description
Added a description of how to port a class to GPU
2026-04-28 08:45:59 +02:00
Bård Skaflestad eac3fbb428 Merge pull request #7011 from GitPaean/removing_segment_indices
removing unused segment_indices in initWellStateMSWell
2026-04-27 16:53:33 +02:00
Markus Blatt 6c29bef524 [cmake] Search for ParMETIS and use it if it there.
This is what we did before refactoring the build system. Somehow this
was accidentally skipped during the refactoring and this commit
reintroduces it.

This is needed, because without it we will always directly agglomerate
the data on the coase levels to on process instead of fewer and fewer.
This should make a difference in scalability of the linear solver when
using many processes.
2026-04-27 16:52:04 +02:00
Kai Bao b3d43acf60 removing unused segment_indices in initWellStateMSWell 2026-04-27 16:34:24 +02:00
Håkon Hægland 4f68559a50 Delete unconventional blank line 2026-04-27 15:13:16 +02:00
Håkon Hægland a3c0c6d755 Split SimulatorFullyImplicitBlackoil header
Move all template-method definitions out of
SimulatorFullyImplicitBlackoil.hpp into a new
SimulatorFullyImplicitBlackoil_impl.hpp, mirroring the layout
already used by AdaptiveTimeStepping, BlackoilModel, and most
template classes under opm/simulators/.

The .hpp now contains only declarations (with Doxygen) plus
trivial inline accessors (grid, model, eclState, schedule,
isRestart, wellModel_, getCellMapping). The header shrinks from 754
to 223 lines, making the public API of the class easier to skim
as new methods are added.

Pure mechanical refactor: method bodies are moved verbatim
modulo template<class TypeTag> and qualifier prefixes.
2026-04-27 14:08:16 +02:00
Atgeirr Flø Rasmussen 0267e51139 Merge pull request #6997 from hakonhagland/rc_tracy
Instrument reservoir coupling MPI exchanges for Tracy
2026-04-27 13:31:40 +02:00
Bård Skaflestad 380461b8ca Merge pull request #7003 from hakonhagland/tuning_test
Adaptive time-stepping: rename `dt` callback param and add Doxygen
2026-04-27 10:55:05 +02:00
Håkon Hægland 4ea59677d7 Add Doxygen to AdaptiveTimeStepping.hpp
Document the three classes, the TuningUpdateCallback alias, and the
member functions whose semantics are not self-evident from the name.

No behavior change.
2026-04-24 18:24:58 +02:00
Håkon Hægland 90f7b2ac2b Rename tuning-update callback parameters
Rename the `dt` and `timeStep` parameters of the tuning-update
callback and its passthroughs to `substep_length` and
`sub_step_number`.  The old names were generic enough to hide the
"substep vs report-step" distinction whose confusion caused the
bug fixed in #6998: the callback fires once per substep and its
length/index arguments are specifically substep-scoped, not
report-step-scoped.
2026-04-24 17:08:13 +02:00
Atgeirr Flø Rasmussen c4dc12226b Merge pull request #6993 from hnil/hypre_fix
fixed issures with parallel hypre on mac ++
2026-04-24 15:48:06 +02:00
Håkon Hægland 145e2ae118 Sync rescoup master loop at master time steps by default
Restructure the rescoup master's outer substep loop so that each
outer iteration is one master actual time step.  The master's
adaptive timestepping now drives the sync cadence instead of
saturating at the slave report-step size.  This matches the
coupling semantics of the reference simulator, where
master<->slave exchanges are tied to master actual time steps
rather than to slave report steps.

Introduce two sync modes, selected by the
--rescoup-sync-at-report-steps CLI flag added in the previous
commit:

  TSYNC (default, flag=false)
    Each outer iteration is one master time step.  Sync-step
    length is chosen fresh each iteration from the master's
    adaptive suggestion, capped at the max time step and at the
    remaining report-step time, then chopped against slave
    report dates.

  RSYNC (flag=true)
    Each chunk between slave report-step boundaries is one sync
    step.  Preserves the pre-change OPM behavior.

Both modes share a single outer-loop function; the mode-specific
bits (step-length selection, user-visible log line, chop against
slave reports) are encapsulated in the new private helper
`getRcMasterSyncStepLength_`.
2026-04-24 12:33:50 +02:00
Håkon Hægland 42871af2cd Add --rescoup-sync-at-report-steps CLI flag
Add a new boolean parameter `RescoupSyncAtReportSteps` (default `false`)
to the time-stepping parameter set, registered with a developer-facing
description.  Read it in the `ReservoirCouplingMaster` constructor,
store it as a member, expose it via a `syncAtReportSteps()` getter, and
log the chosen mode once at simulation start.

This is a no-op precursor for the upcoming change to the master's outer
sync loop.  The flag is read and made available, but no code consults
it yet, so behavior is unchanged on both values.

Future use: when `true`, the master will sync with its slaves at slave
report-step boundaries (the current OPM behavior).  When `false`, the
master will sync at every master actual time step.
2026-04-24 12:33:50 +02:00
Håkon Hægland ee85ac5f98 Merge pull request #6998 from hakonhagland/fix_tuning_call
Fix wrong args passed to maybeUpdateTuning_
2026-04-24 12:27:55 +02:00
Håkon Hægland 3e7795831b Fix wrong args passed to maybeUpdateTuning_
The tuning_updater callback expects (elapsed, dt, sub_step_number)
where dt is the length of the upcoming substep and sub_step_number
is 0 at the start of a report step.  All three call sites in
runStepOriginal_ and the reservoir coupling variants were passing
outer SimulatorTimer values instead: The report-step length (Sites
A, C), the sync-step length (Site B), and the report-step index
(Site A).

Use suggestedNextTimestep_() and /*substep=*/0 at all three sites,
matching the pattern already in use at the initial tuningUpdater
invocation in SimulatorFullyImplicitBlackoil::runStep and inside
maybeUpdateTuningAndTimeStep_.

Impact is gated by WCYCLE being active in the deck.  The TUNING
branch of the callback is unaffected (TUNING_CHANGE and
TUNINGDP_CHANGE are already cleared by the initial call in
SimulatorFullyImplicitBlackoil::runStep).  The WCYCLE branch
re-runs with a too-wide look-ahead horizon, causing
WCYCLE::nextTimeStep to over-chop and invoke
updateNEXTSTEP(wcycle_time_step) when no chop was warranted.  The
wrong sub_step_number in runStepOriginal_ also bypasses the
REQUEST_OPEN_WELL guard for every report step after the first.

Regression introduced in b94868633 when the callback signature
grew three parameters as part of reconciling the impl file with
the WCYCLE-support PR (#5792).
2026-04-23 15:54:47 +02:00
Kjetil Olsen Lye c13e6222e4 added information about the fluidsystem 2026-04-23 15:24:26 +02:00
Kjetil Olsen Lye 49f874c369 Stressed that one should prefer to edit classes rather than adding new ones 2026-04-22 15:40:35 +02:00
Håkon Hægland 7da2456c00 Instrument rescoup MPI exchanges for Tracy
Add OPM_TIMEFUNCTION() to the eight MPI exchange entry points between
the master and slave processes in reservoir coupling, so the per-call
cost of each exchange is visible in Tracy traces.

Functions instrumented (four pairs):

  master -> slave   sendMasterGroupConstraintsToSlaves
  slave  -> master  receiveGroupConstraintsFromMaster
  slave  -> master  sendSlaveGroupDataToMaster
  master -> slave   receiveSlaveGroupData
  slave  -> master  sendNextReportDateToMasterProcess
  master -> slave   receiveNextReportDateFromSlaves
  master -> slave   sendNextTimeStepToSlaves
  slave  -> master  receiveNextTimeStepFromMaster

The macros are no-ops unless built with USE_TRACY_PROFILER=ON, so this
adds no overhead in normal builds.

Motivated by upcoming work to change the rescoup sync cadence from
per-slave-report-step to per-master-actual-step.  The new cadence
increases the number of MPI exchange events per simulation, so the
ability to measure per-exchange cost is needed to verify the overhead
stays acceptable.
2026-04-22 07:01:21 +02:00
Kjetil Olsen Lye c947996b5d added cmake description 2026-04-20 21:41:38 +02:00
Kjetil Olsen Lye e0263534f3 Added a description of how to port a class to GPU 2026-04-20 13:26:06 +02:00
hnil b0c3cadfca fixed issures with parallel hypre on mac ++ 2026-04-20 12:06:58 +02:00
Tor Harald Sandve 8509d5fa4d Merge pull request #6952 from totto82/test_co2h2sol
Add CO2SOL and H2SOL for regression
2026-04-16 15:56:05 +02:00
Tor Harald Sandve d0f54dea83 Add CO2SOL and H2SOL for regression 2026-04-16 14:53:06 +02:00
Tor Harald Sandve 8442daf6a7 Merge pull request #6983 from hakonhagland/sg_constraint_fix2
Reservoir coupling: Apply master group targets on slave Schedule
2026-04-16 11:35:49 +02:00
Atgeirr Flø Rasmussen f5895a96c7 Merge pull request #6894 from blattms/bugfix/correct-output-for-actionx-exit
[bugfix] Mark output writing due to EXIT in ACTIONX as last writing.
2026-04-16 10:11:32 +02:00
Håkon Hægland 50cae0de47 Use flags for RC slave group recognition
Replace updateSlaveGroupTargetsInSchedule() (which created
synthetic GCONPROD/GCONINJE) with markSlaveGroupsInSchedule()
which sets lightweight boolean flags on slave groups.

The flags make isProductionGroup()/isInjectionGroup() return
true so the existing constraint enforcement gates pass.  The
actual target values are still provided by the master via
hasMasterProductionTarget()/hasMasterInjectionTarget().

Requires the companion opm-common commit that adds the flag
mechanism to Group and Schedule.
2026-04-15 20:29:44 +02:00
Antonella Ritorto ce735da879 Pass in writeInitial an NNCCollection to allow output of the 3 NNC types, in CpGrid with LGRs 2026-04-15 12:18:40 +02:00
Bård Skaflestad f726e18ca6 Merge pull request #6985 from svenn-t/tpsa_throw_fix
Safeguard against running TPSA simulations without FlowProblemTPSA
2026-04-15 09:23:11 +02:00
Bård Skaflestad 7ba73e1680 Merge pull request #6984 from bska/maybe-unused-dt
Tag Potentially Unused Parameter as Maybe_Unused
2026-04-15 09:22:34 +02:00
Markus Blatt 5740acfb7f [bugfix] Mark output writing due to EXIT in ACTIONX as last writing.
We do some special things in the last write out (e.g. writing RSM
file). Previously, that was only done if we reached the last report
step. With an EXIT in an executed ACTIONX the simulation end is
reached earlier and we missed some output, though.

With this change we perform the same write out, if there was an
ACTIONX/EXIT, as for a regular write out at the last report step.
2026-04-14 15:08:23 +02:00
Bård Skaflestad a089e6049c Tag Potentially Unused Parameter as Maybe_Unused
The time step size parameter is referenced only when reservoir
coupling is enabled, which is not the case for sequential builds.
2026-04-14 14:39:54 +02:00
Håkon Hægland 55ef6e9f5b Apply master group targets on slave Schedule
After receiving constraints from the master, the slave
updates its Schedule with synthetic GCONPROD/GCONINJE entries
so the existing constraint enforcement mechanisms recognize
the groups and apply the master's targets.  Without this,
slave groups without deck-level GCONPROD/GCONINJE would be
skipped by isProductionGroup()/isInjectionGroup() gates in
checkGroupHigherConstraints, getWellGroupTargetProducer, etc.

Requires the companion opm-common PR that adds
Schedule::updateSlaveGroupProductionTarget() and
Schedule::updateSlaveGroupInjectionTarget().
2026-04-14 14:14:02 +02:00
Bård Skaflestad 98282b35a6 Merge pull request #6979 from hakonhagland/fix_summary2
Reservoir coupling: Populate satellite data for summary output
2026-04-14 14:01:25 +02:00
Bård Skaflestad 6fc4742427 Merge pull request #6986 from steink/fix-unintended-logging-output
Switch to debug-logging
2026-04-14 10:13:13 +02:00
Stein Krogstad 5a0f49545e switch to debug-logging 2026-04-14 09:45:37 +02:00