Skip to content

Flow compositional#7049

Open
hnil wants to merge 4 commits into
OPM:masterfrom
hnil:genneral_flow_comp
Open

Flow compositional#7049
hnil wants to merge 4 commits into
OPM:masterfrom
hnil:genneral_flow_comp

Conversation

@hnil
Copy link
Copy Markdown
Member

@hnil hnil commented May 13, 2026

This is work on making a compositional simulator more similar to flow.

The pullrequest also do:

  • added flow_comp variants + test aginst the flowexp_comp executable
  • it still remain some renaming to make things more consistent
  • renamed and refactored BlackoilModel.hpp to NonlinearSystem +++

since now the SimulatorFullyImplicitBlackoil + BlackoilModel.hpp is simulator an nonlinear system for more general systems.

@hnil hnil requested review from GitPaean and atgeirr May 13, 2026 12:25
@hnil hnil marked this pull request as draft May 13, 2026 12:25
@hnil hnil added the manual:irrelevant This PR is a minor fix and should not appear in the manual label May 13, 2026
@hnil hnil force-pushed the genneral_flow_comp branch from c856087 to bd365b1 Compare May 15, 2026 07:38
@GitPaean
Copy link
Copy Markdown
Member

jenkins build this please

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR generalizes Flow’s fully implicit simulator path so compositional variants can share more of the standard Flow infrastructure, while renaming/refactoring the black-oil nonlinear model into a more generic nonlinear-system structure.

Changes:

  • Renames/refactors SimulatorFullyImplicitBlackoil/BlackoilModel concepts into generic SimulatorFullyImplicit and nonlinear-system classes.
  • Adds compositional Flow executable variants and comparison/regression test wiring.
  • Extends compositional output/well-model glue and parameter hiding behavior to fit the shared Flow driver.

Reviewed changes

Copilot reviewed 76 out of 76 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
CMakeLists.txt Adds compositional Flow/FlowExp executable test targets.
CMakeLists_files.cmake Updates source/header registration for renamed and new simulator files.
compareECLFiles.cmake Adds reference simulator arguments for comparison helpers.
comparisonTests.cmake Adds compositional Flow vs FlowExp comparison tests.
regressionTests.cmake Switches compositional regression to new Flow compositional variant with reference simulator.
flow/flow_blackoil.cpp Updates simulator include.
flow/flow_blackoil_legacyassembly.cpp Updates simulator include.
flow/flow_blackoil_nohyst.cpp Updates simulator include.
flow/flow_blackoil_temp.cpp Updates simulator include.
flow/flow_biofilm.cpp Updates simulator include.
flow/flow_brine.cpp Updates simulator include.
flow/flow_brine_precsalt_vapwat.cpp Updates simulator include.
flow/flow_brine_saltprecipitation.cpp Updates simulator include.
flow/flow_energy.cpp Updates simulator include.
flow/flow_extbo.cpp Updates simulator include.
flow/flow_foam.cpp Updates simulator include.
flow/flow_gasoil.cpp Updates simulator include.
flow/flow_gasoil_energy.cpp Updates simulator include.
flow/flow_gasoildiffuse.cpp Updates simulator include.
flow/flow_gaswater.cpp Updates simulator include.
flow/flow_gaswater_brine.cpp Updates simulator include.
flow/flow_gaswater_dissolution.cpp Updates simulator include.
flow/flow_gaswater_dissolution_diffuse.cpp Updates simulator include.
flow/flow_gaswater_energy.cpp Updates simulator include.
flow/flow_gaswater_saltprec_energy.cpp Updates simulator include.
flow/flow_gaswater_saltprec_vapwat.cpp Updates simulator include.
flow/flow_gaswater_solvent.cpp Updates simulator include.
flow/flow_micp.cpp Updates simulator include.
flow/flow_oilwater.cpp Updates simulator include.
flow/flow_oilwater_brine.cpp Updates simulator include.
flow/flow_oilwater_polymer.cpp Updates simulator include.
flow/flow_oilwater_polymer_injectivity.cpp Updates simulator include.
flow/flow_polymer.cpp Updates simulator include.
flow/flow_solvent.cpp Updates simulator include.
flow/flow_solvent_foam.cpp Updates simulator include.
flowexperimental/comp/flow_comp.cpp Adds dynamic compositional Flow entry point.
flowexperimental/comp/flow_comp.hpp Adds Flow compositional type tag/properties and Newton method.
flowexperimental/comp/flow_comp2_2p.cpp Adds fixed 2-component two-phase Flow compositional executable.
flowexperimental/comp/flow_comp3_2p.cpp Adds fixed 3-component two-phase Flow compositional executable.
flowexperimental/comp/flowexp_comp2_2p_main.cpp Adds fixed FlowExp compositional main.
flowexperimental/comp/flowexp_comp3_2p_main.cpp Adds fixed FlowExp compositional main.
flowexperimental/comp/wells/CompWellModel.hpp Adds Flow-driver compatibility methods/state to compositional well model.
flowexperimental/comp/wells/CompWellModel_impl.hpp Captures report-step well/group events.
flowexperimental/comp/wells/CompWell_impl.hpp Adds well-control diagnostic logging.
opm/models/utils/parametersystem.cpp Adds HideIfRegistered_.
opm/models/utils/parametersystem.hpp Exposes HideIfRegistered.
opm/simulators/flow/BlackoilModelNldd.hpp Updates model type references and convergence helper use.
opm/simulators/flow/BlackoilModelParameters.hpp Updates comment terminology.
opm/simulators/flow/BlackoilModelTPSA.hpp Updates inheritance to renamed nonlinear system.
opm/simulators/flow/FlowGenericProblem.cpp Adds compositional fluid-system instantiations.
opm/simulators/flow/FlowMain.hpp Switches FlowMain to generic fully implicit simulator.
opm/simulators/flow/FlowProblemBlackoilProperties.hpp Updates black-oil nonlinear-system property.
opm/simulators/flow/FlowProblemComp.hpp Adds report/final-output hooks needed by generic driver.
opm/simulators/flow/FlowProblemCompProperties.hpp Wires compositional problem to new nonlinear system.
opm/simulators/flow/FlowUtils.cpp Hides optional VTK/well parameters only if registered.
opm/simulators/flow/NonlinearSystem.hpp Adds shared nonlinear-system base helpers.
opm/simulators/flow/NonlinearSystemBlackOilReservoir.hpp Renames/refactors black-oil model class onto shared base.
opm/simulators/flow/NonlinearSystemBlackOilReservoir_impl.hpp Moves shared nonlinear logic to base and updates renamed class implementation.
opm/simulators/flow/NonlinearSystemCompositional.hpp Adds compositional nonlinear-system interface.
opm/simulators/flow/NonlinearSystemCompositional_impl.hpp Adds compositional nonlinear-system implementation.
opm/simulators/flow/OutputCompositionalModule.hpp Adds parameter registration and FIP/RESV log output hooks.
opm/simulators/flow/SimulatorFullyImplicit.cpp Switches implementation include to generic simulator header.
opm/simulators/flow/SimulatorFullyImplicit.hpp Adds generic fully implicit simulator header.
opm/simulators/flow/SimulatorFullyImplicit_impl.hpp Adds generic fully implicit simulator implementation.
opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp Renames class in legacy black-oil header.
opm/simulators/flow/SimulatorFullyImplicitBlackoil_impl.hpp Renames implementation symbols in legacy black-oil impl header.
opm/simulators/flow/rescoup/ReservoirCouplingMaster.cpp Updates renamed simulator reference in comment.
opm/simulators/timestepping/AdaptiveTimeStepping.hpp Updates renamed simulator references in comments.
opm/simulators/timestepping/AdaptiveTimeStepping_impl.hpp Updates renamed simulator references in comments.
opm/simulators/timestepping/ConvergenceReport.hpp Updates renamed convergence comment reference.
opm/simulators/utils/ComponentName.cpp Extends component naming to compositional fluid systems.
opm/simulators/wells/rescoup/RescoupProxy.hpp Updates renamed owner comment.
tests/rescoup/test_chopstep.cpp Updates nonlinear-system include.
tests/run-comparison.sh Supports comparing two simulator executables/output directories.
tests/run-regressionTest.sh Supports reference simulator directory override.
tests/test_wellmodel.cpp Updates nonlinear-system include.
Comments suppressed due to low confidence (1)

flowexperimental/comp/wells/CompWellModel.hpp:137

  • This stub is now used by the generic adaptive time-stepping failure path, which asks the well model to shut failing wells before retrying a substep. Always returning false disables that recovery path for compositional wells, so well convergence failures that black-oil can recover from by shutting a well will instead keep chopping/failing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread opm/simulators/flow/NonlinearSystem.hpp Outdated
Comment thread CMakeLists_files.cmake
Comment thread flowexperimental/comp/wells/CompWell_impl.hpp Outdated
Comment thread opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp Outdated
Comment on lines +134 to +135
const std::map<std::string, double>& wellOpenTimes() const { return well_open_times_; }
const std::map<std::string, double>& wellCloseTimes() const { return well_close_times_; }
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now this is not relevant I think.

Comment thread opm/simulators/utils/ComponentName.cpp Outdated
Comment thread opm/simulators/flow/FlowGenericProblem.cpp Outdated
Comment thread flowexperimental/comp/flow_comp.cpp
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 84 out of 84 changed files in this pull request and generated 4 comments.

Comment thread opm/simulators/flow/NonlinearSystem.hpp
Comment thread opm/simulators/utils/ComponentName.cpp Outdated
Comment thread flowexperimental/comp/wells/CompWell_impl.hpp Outdated
Comment on lines +152 to +160
status = other.status;
bhp = other.bhp;
surface_phase_rates = other.surface_phase_rates;
phase_fractions = other.phase_fractions;
reservoir_phase_rates = other.reservoir_phase_rates;
total_molar_fractions = other.total_molar_fractions;
phase_molar_fractions = other.phase_molar_fractions;
injection_cmode = other.injection_cmode;
production_cmode = other.production_cmode;
@hnil hnil requested a review from Copilot May 15, 2026 13:22
@hnil
Copy link
Copy Markdown
Member Author

hnil commented May 15, 2026

@copilot apply changes based on the comments in this thread

@hnil hnil marked this pull request as ready for review May 15, 2026 13:24
@hnil
Copy link
Copy Markdown
Member Author

hnil commented May 15, 2026

One could probably remove even more code. But some of the changes will will change reference. So better to uniform the code when fixes is applied to the main code i.e. blackoil.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 84 out of 84 changed files in this pull request and generated 7 comments.

Comment thread flowexperimental/comp/wells/CompWell_impl.hpp Outdated
Comment on lines +152 to +160
status = other.status;
bhp = other.bhp;
surface_phase_rates = other.surface_phase_rates;
phase_fractions = other.phase_fractions;
reservoir_phase_rates = other.reservoir_phase_rates;
total_molar_fractions = other.total_molar_fractions;
phase_molar_fractions = other.phase_molar_fractions;
injection_cmode = other.injection_cmode;
production_cmode = other.production_cmode;
Comment thread opm/simulators/flow/NonlinearSystem.hpp
Comment thread opm/simulators/utils/ComponentName.cpp Outdated
Comment thread opm/simulators/flow/NonlinearSystem.hpp
Comment thread opm/simulators/flow/NonlinearSystem_impl.hpp
Comment thread flowexperimental/comp/flow_comp.hpp
@GitPaean
Copy link
Copy Markdown
Member

@hnil , I am looking into the PR now and it needs to be rebased.

@GitPaean
Copy link
Copy Markdown
Member

jenkins build this failure_report please

1 similar comment
@GitPaean
Copy link
Copy Markdown
Member

jenkins build this failure_report please

@hnil hnil marked this pull request as draft May 21, 2026 06:59
@hnil
Copy link
Copy Markdown
Member Author

hnil commented May 21, 2026

Converted to draft. Need to be fixed after rebase and review comments.

@GitPaean
Copy link
Copy Markdown
Member

yeah, the same compilation error showed up in my rebased PR from this PR when compiling the float version of the simulator.

@GitPaean
Copy link
Copy Markdown
Member

jenkins build this opm-common=5178 please

@hnil hnil force-pushed the genneral_flow_comp branch from 4d353ed to 1c0aa22 Compare May 26, 2026 12:17
@hnil
Copy link
Copy Markdown
Member Author

hnil commented May 26, 2026

Move this for review again. More tests on making flowexp and flow equal is in #7088 which is draft.

@hnil hnil marked this pull request as ready for review May 26, 2026 12:19
@hnil hnil force-pushed the genneral_flow_comp branch from 1c0aa22 to 5f623ca Compare May 26, 2026 12:55
@hnil
Copy link
Copy Markdown
Member Author

hnil commented May 26, 2026

rebased and removed tests agains old solver (which had to fail)

@bska
Copy link
Copy Markdown
Member

bska commented May 26, 2026

jenkins build this please

@GitPaean
Copy link
Copy Markdown
Member

jenkins build this opm-common=5178 please

@hnil
Copy link
Copy Markdown
Member Author

hnil commented May 27, 2026

Comment: flow_comp flowexp_comp both fails bad with no input. This is a separate question and not related to this pullrequest.

@hnil
Copy link
Copy Markdown
Member Author

hnil commented May 27, 2026

Comment: It is no test here since it will fail with given reference and trying to get flow flowexp to run equal made to much changes se #7088

@GitPaean
Copy link
Copy Markdown
Member

jenkins build this opm-common=5178 please

@GitPaean
Copy link
Copy Markdown
Member

#7062 this version compiles on Jenkins, but there are three regression failures. Will have a look later today or tomorrow.

https://ci.opm-project.org/job/opm-simulators-PR-builder/9992/

@hnil hnil force-pushed the genneral_flow_comp branch from 33d072e to 7f9478d Compare June 3, 2026 11:22
@hnil hnil requested review from totto82 and removed request for atgeirr June 3, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:irrelevant This PR is a minor fix and should not appear in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants