Skip to content

Added compositional variant in flow#7145

Open
hnil wants to merge 7 commits into
OPM:masterfrom
hnil:genneral_flow_comp_new
Open

Added compositional variant in flow#7145
hnil wants to merge 7 commits into
OPM:masterfrom
hnil:genneral_flow_comp_new

Conversation

@hnil

@hnil hnil commented Jun 5, 2026

Copy link
Copy Markdown
Member

Added compositinal solver based on the flow nonlinear solver and timestepping.

@hnil hnil requested review from GitPaean and totto82 June 5, 2026 12:35
@hnil

hnil commented Jun 5, 2026

Copy link
Copy Markdown
Member Author

I will rebase this as son as the restructuring is merged.

@bska

bska commented Jun 10, 2026

Copy link
Copy Markdown
Member

I will rebase this as son as the restructuring is merged.

The upstream PR #7143 was merged into the master branch. Please feel free to rebase this work at your convenience.

@GitPaean GitPaean added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Jun 11, 2026
Comment thread CMakeLists_files.cmake Outdated
Comment thread opm/simulators/utils/ComponentName.cpp Outdated
hnil and others added 2 commits June 11, 2026 20:08
The standard-flow main pulls in OPMRST (HDF5) save/load state through
SimulatorFullyImplicit, which requires the whole model and problem to be
serializable. Provide serializeOp for FlashPrimaryVariables (plain
FieldVector contents) and empty implementations for EmptyModel and
CompWellModel, where restart support is not implemented yet.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@hnil hnil force-pushed the genneral_flow_comp_new branch from 9e4b77b to 4374de7 Compare June 11, 2026 18:08
@GitPaean

Copy link
Copy Markdown
Member

jenkins build this please

@hnil

hnil commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

This should be rebased now.

@hnil

hnil commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

jenkins build this please

hnil and others added 3 commits June 12, 2026 09:47
The new standard-flow compositional simulators are the first users of
the Opm::Main entry point that exercise dune-fem code paths on builds
configured with dune-fem. dune-fem requires an explicit
MPIManager::initialize() at startup (as done by the start.hh runner used
by flowexp) and otherwise aborts with
"InvalidStateException: MPIManager has not been initialized".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Remove trailing whitespace, add missing end-of-file newlines and add
the standard license header to the new ComponentName files.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Removed hpp files form source

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 introduces an additional compositional solver/variant built on the existing flow nonlinear solver and time-stepping infrastructure, along with build/test plumbing to compile and validate new compositional executables and variants.

Changes:

  • Adds a new compositional nonlinear system implementation (NonlinearSystemCompositional) and wires it into the compositional flow problem properties.
  • Extends build configuration to produce additional compositional executables (including component-count-specific binaries) and broadens template instantiations needed for these variants.
  • Updates regression/comparison test macros to support distinguishing the simulator-under-test from the reference simulator, and adds new run tests for new compositional binaries.

Reviewed changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
regressionTests.cmake Updates a compositional regression test entry to support dev/reference simulator separation.
opm/simulators/utils/ComponentName.hpp Makes ComponentName header-only by including a new implementation header.
opm/simulators/utils/ComponentName.cpp Removes the former explicit-instantiation translation unit.
opm/simulators/utils/ComponentName_impl.hpp New template implementation for ComponentName constructor (more generic via requires).
opm/simulators/flow/OutputCompositionalModule.hpp Extends compositional output module parameter registration and adds FIP/RESV log + CSV output helpers.
opm/simulators/flow/NonlinearSystemCompositional.hpp New compositional nonlinear system interface (Flow-side solver integration).
opm/simulators/flow/NonlinearSystemCompositional_impl.hpp New compositional nonlinear system implementation (Newton iteration, residual metrics, linear solve).
opm/simulators/flow/NonlinearSolver.cpp Extends explicit instantiations to support larger equation block sizes (up to 11).
opm/simulators/flow/Main.cpp Ensures Dune::Fem::MPIManager is initialized when using dune-fem.
opm/simulators/flow/FlowUtils.cpp Switches VTK parameter hiding to HideIfRegistered to avoid errors when parameters are not registered.
opm/simulators/flow/FlowProblemCompProperties.hpp Wires the compositional problem tag to use NonlinearSystemCompositional.
opm/simulators/flow/FlowProblemComp.hpp Adds report propagation + output finalization hooks to the compositional problem.
opm/simulators/flow/FlowGenericProblem.cpp Adds explicit instantiations of FlowGenericProblem for GenericOilGasWaterFluidSystem (2..10 comps, water on/off).
opm/models/utils/parametersystem.hpp Adds public HideIfRegistered() API.
opm/models/utils/parametersystem.cpp Implements HideIfRegistered_() in the parameter system registry.
opm/models/ptflash/flashprimaryvariables.hh Adds serializeOp() for FlashPrimaryVariables restart/serialization support.
flowexperimental/comp/wells/SingleCompWellState.hpp Adds API to copy runtime state between well state instances.
flowexperimental/comp/wells/SingleCompWellState_impl.hpp Implements copyRuntimeStateFrom() for dynamic well variables.
flowexperimental/comp/wells/CompWellState.hpp Adds convenience helpers (has, copyDynamicStateFrom).
flowexperimental/comp/wells/CompWellState_impl.hpp Copies runtime state from a previous well state when initializing a report step.
flowexperimental/comp/wells/CompWellModel.hpp Extends compositional well model interface for timestep recovery and reporting/state tracking.
flowexperimental/comp/wells/CompWellModel_impl.hpp Implements accepted-state persistence across timesteps and adds forced well shutdown support.
flowexperimental/comp/wells/CompWell_impl.hpp Adds additional debug/info logging for well control checks (fmt-based).
flowexperimental/comp/flowexp_comp3_2p_main.cpp New main for a 3-component, 2-phase experimental compositional binary.
flowexperimental/comp/flowexp_comp2_2p_main.cpp New main for a 2-component, 2-phase experimental compositional binary.
flowexperimental/comp/flow_comp3_2p.cpp New main that dispatches the “flow_comp” path for 3 components, 2-phase.
flowexperimental/comp/flow_comp2_2p.cpp New main that dispatches the “flow_comp” path for 2 components, 2-phase.
flowexperimental/comp/flow_comp.hpp New compositional flow type-tag/property setup for flow_comp dispatch.
flowexperimental/comp/flow_comp.cpp New runtime dispatch executable selecting a compiled component-count variant based on deck RUNSPEC.
flowexperimental/comp/EmptyModel.hpp Adds no-op serializeOp() for restart compatibility.
compareECLFiles.cmake Adds REFERENCE_SIMULATOR support for compare tests and new run tests for added compositional binaries.
CMakeLists.txt Adds new compositional executables to the build.
CMakeLists_files.cmake Removes ComponentName.cpp from sources and adds new public headers for NonlinearSystemCompositional.

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

Comment thread flowexperimental/comp/wells/CompWellModel_impl.hpp
Comment thread flowexperimental/comp/wells/CompWellState.hpp Outdated
Comment thread opm/simulators/utils/ComponentName.hpp
Comment thread compareECLFiles.cmake Outdated
Comment thread opm/simulators/flow/FlowUtils.cpp Outdated
Comment thread opm/simulators/flow/FlowGenericProblem.cpp
@GitPaean

Copy link
Copy Markdown
Member

jenkins build this please

@GitPaean

Copy link
Copy Markdown
Member

jenkins build this please

Comment thread opm/simulators/flow/NonlinearSystemCompositional_impl.hpp Outdated
@GitPaean

Copy link
Copy Markdown
Member

I only have one comment there and I think we should try to get it in soon. There will be continuous efforts to improve the flow_comp in the future.

@GitPaean

Copy link
Copy Markdown
Member

jenkins build this failure_report please

@GitPaean

Copy link
Copy Markdown
Member

jenkins build this please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement 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