Skip to content

Add thermal multi-segment well parsing support#5233

Open
GitPaean wants to merge 12 commits into
OPM:masterfrom
GitPaean:thermal_msw
Open

Add thermal multi-segment well parsing support#5233
GitPaean wants to merge 12 commits into
OPM:masterfrom
GitPaean:thermal_msw

Conversation

@GitPaean

@GitPaean GitPaean commented Jul 1, 2026

Copy link
Copy Markdown
Member
  • WELSEGS: parse the pipe-wall thermal properties (items 10-15) — wall area, volumetric heat capacity and thermal conductivity — with per-segment fallback to the record-1 defaults.

  • COMPSEGS: parse the effective thermal connection length (item 10), if defaulted, using the grid thickness.

  • WSEGHEAT: parse and apply the new keyword — COMP/SEG/TEMP heat-transfer coefficients with +/-/NONE set operations, a five-coefficient-per-segment cap, input validation, and deck-order application across overlapping well-name patterns.

@GitPaean GitPaean added the manual:new-feature This is a new feature and should be described in the manual label Jul 1, 2026
@GitPaean

GitPaean commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

jenkins build this please

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 extends the Eclipse deck parsing/scheduling for thermal multi-segment wells by adding support for additional thermal properties in WELSEGS/COMPSEGS and introducing a new WSEGHEAT keyword to define per-segment heat-transfer coefficients.

Changes:

  • Parse and store pipe-wall thermal properties from WELSEGS with per-segment override + fallback to record-1 defaults.
  • Parse and propagate COMPSEGS thermal connection length into Connection.
  • Add WSEGHEAT keyword definition, parsing, schedule application, and tests covering coefficient operations, validation, and deck-order behavior.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/parser/MultisegmentWellTests.cpp Adds integration and unit tests for WELSEGS thermal fields, COMPSEGS thermal length, and WSEGHEAT behavior/validation.
opm/input/eclipse/share/keywords/keyword_list.cmake Registers the new WSEGHEAT keyword for keyword generation.
opm/input/eclipse/share/keywords/001_Eclipse300/W/WSEGHEAT Defines the WSEGHEAT keyword schema and item dimensions/defaults.
opm/input/eclipse/share/keywords/000_Eclipse100/W/WELSEGS Extends WELSEGS schema with pipe-wall thermal items (top + per-segment).
opm/input/eclipse/Schedule/Well/WellConnections.cpp Preserves thermal length when updating/opening existing connections.
opm/input/eclipse/Schedule/Well/Well.hpp Adds Well::updateWSEGHEAT() API entry point.
opm/input/eclipse/Schedule/Well/Well.cpp Implements Well::updateWSEGHEAT() by delegating to WellSegments.
opm/input/eclipse/Schedule/Well/Connection.hpp Adds thermalLength() API, stores/serializes m_thermal_length, and threads it through updateSegment().
opm/input/eclipse/Schedule/Well/Connection.cpp Implements thermalLength(), updates serialization test object and equality to include thermal length.
opm/input/eclipse/Schedule/MSW/WellSegments.hpp Extends segment construction with wall thermal properties and declares updateWSEGHEAT().
opm/input/eclipse/Schedule/MSW/WellSegments.cpp Parses WELSEGS wall properties with fallback, unifies missing-segment handling, and applies WSEGHEAT records to segments.
opm/input/eclipse/Schedule/MSW/SegmentHeatTransfer.hpp Introduces data model for WSEGHEAT coefficients + record parsing API.
opm/input/eclipse/Schedule/MSW/SegmentHeatTransfer.cpp Implements WSEGHEAT parsing + item validation for resistance/target/temp requirements.
opm/input/eclipse/Schedule/MSW/Segment.hpp Stores wall thermal properties and per-segment heat-transfer coefficients; adds update/apply APIs.
opm/input/eclipse/Schedule/MSW/Segment.cpp Implements storage/accessors for thermal wall props and WSEGHEAT coefficient operations (replace/add/remove/clear, SEG cap).
opm/input/eclipse/Schedule/MSW/MSWKeywordHandlers.cpp Adds WSEGHEAT handler: expands patterns, preserves deck order per well, applies to schedule state.
opm/input/eclipse/Schedule/MSW/Compsegs.cpp Parses COMPSEGS thermal length and propagates it into connection segment updates.
opm/input/eclipse/Parser/ParseContext.hpp Renames missing-segment context key to SCHEDULE_MISSING_SEGMENT and broadens description.
opm/input/eclipse/Parser/ParseContext.cpp Registers SCHEDULE_MISSING_SEGMENT instead of the old key.
CMakeLists_files.cmake Adds new SegmentHeatTransfer compilation unit and public header install.

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

Comment thread opm/input/eclipse/Schedule/MSW/SegmentHeatTransfer.cpp
Comment on lines +587 to +593
/// A multisegment-well keyword (e.g. WSEGAICD, WSEGSICD, WSEGVALV,
/// WSEGHEAT) references a missing well segment.
///
/// Typically generates a warning and drops the device. Note,
/// however, that there are likely to be other issues in the input
/// deck when this situation occurs.
const static std::string SCHEDULE_ICD_MISSING_SEGMENT;
const static std::string SCHEDULE_MISSING_SEGMENT;

@GitPaean GitPaean Jul 1, 2026

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.

The build is fine and I think it is fine also. I would like to have some comments from @bska regarding this point, in case there are some other implications that I could not think of.

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

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.

Comment thread tests/parser/MultisegmentWellTests.cpp Outdated
Comment thread opm/input/eclipse/Schedule/Well/Connection.hpp Outdated
following copilot reviewing comments.
@GitPaean

GitPaean commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

jenkins build this please

@GitPaean GitPaean force-pushed the thermal_msw branch 5 times, most recently from 912eef6 to 0a93406 Compare July 2, 2026 08:52
GitPaean added 3 commits July 2, 2026 10:53
more properly reports the range of the segments does not match any
existing segment.
using SCHEDULE_MSW_KEYWORD_ON_NON_MSW_WELL category
@GitPaean

GitPaean commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

I am marking the PR as ready for review now.

@GitPaean GitPaean marked this pull request as ready for review July 2, 2026 11:40
@GitPaean

GitPaean commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

jenkins build this please

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

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.

Comment thread opm/input/eclipse/Schedule/MSW/SegmentHeatTransfer.cpp
Comment thread opm/input/eclipse/Schedule/MSW/WellSegments.cpp Outdated
@GitPaean

GitPaean commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

jenkins build this please

@GitPaean

GitPaean commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

I think Jenkins is having some hectic.

/build/default/build-opm-simulators/python/simulators && /usr/bin/strip /build/default/build-opm-simulators/python/opm/simulators/OnePhase.cpython-312-x86_64-linux-gnu.so
mold: failed to write to an output file. Disk full?
collect2: fatal error: ld terminated with signal 7 [Bus error], core dumped
compilation terminated.
[910/922] Building CXX object CMakeFiles/flow_comp.dir/flowexperimental/comp/flow_comp_dispatch9.cpp.o
FAILED: CMakeFiles/flow_comp.dir/flowexperimental/comp/flow_comp_dispatch9.cpp.o 
/usr/lib/ccache/g++ -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_CHRONO_DYN_LINK -DBOOST_CHRONO_NO_LIB -DBOOST_DATE_TIME_DYN_LINK -DBOOST_DATE_TIME_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_LOG_DYN_LINK -DBOOST_LOG_NO_LIB -DBOOST_LOG_SETUP_DYN_LINK -DBOOST_LOG_SETUP_NO_LIB -DBOOST_REGEX_DYN_LINK -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DCOMPILE_GPU_BRIDGE=1 -DDUNE_FEM_VERSION_MAJOR=2 -DDUNE_FEM_VERSION_MINOR=11 -DDUNE_FEM_VERSION_REVISION=0 -DFMT_SHARED -DHAVE_AVX2_EXTENSION=1 -DHAVE_CUDA=1 -DHAVE_DAMARIS=1 -DHAVE_DUNE_ALUGRID=1 -DHAVE_DUNE_COMMON=1 -DHAVE_DUNE_FEM=1 -DHAVE_DUNE_GRID=1 -DHAVE_DUNE_ISTL=1 -DHAVE_HDF5=1 -DHAVE_METIS=1 -DHAVE_MPI=1 -DHAVE_OPENMP=1 -DHAVE_OPM_COMMON=1 -DHAVE_PARMETIS=1 -DHAVE_SUITESPARSE_UMFPACK=1 -DHAVE_SUPERLU=1 -DHAVE_ZOLTAN=1 -DIS_SCOTCH_METIS_HEADER=1 -DLIMITS_HAS_QUAD=1 -DMETIS_API_VERSION=5 -DMPICH_SKIP_MPICXX=1 -DMPIPP_H -DMPI_2=1 -DMPI_NO_CPPBIND=1 -DModelP -DOMPI_SKIP_MPICXX=1 -DOPM_COMPILE_COMPONENTS_TEMPLATE_LIST=2,3,4,5,6,7,8,9,10 -DSCOTCH_METIS_VERSION=5 -DSUPERLU_INT_TYPE=int -D_MPICC_H -I/build/deps/opm-simulators -I/build/default/build-opm-simulators -isystem /build/default/install/include -isystem /usr/lib/x86_64-linux-gnu/openmpi/include -isystem /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -isystem /usr/include/trilinos -isystem /usr/include/metis -isystem /usr/include/scotch -isystem /usr/include/suitesparse -isystem /usr/include/parmetis -isystem /usr/include/hdf5/openmpi -isystem /usr/local/cuda/targets/x86_64-linux/include -isystem /usr/include/superlu -DDISABLE_CUSPARSE_DEPRECATED=1 -fuse-ld=mold -O3 -DNDEBUG -std=c++20 -pipe -Wall -Wextra -Wshadow -Wno-dangling-reference -mtune=native -UNDEBUG -fopenmp -fext-numeric-literals -MD -MT CMakeFiles/flow_comp.dir/flowexperimental/comp/flow_comp_dispatch9.cpp.o -MF CMakeFiles/flow_comp.dir/flowexperimental/comp/flow_comp_dispatch9.cpp.o.d -o CMakeFiles/flow_comp.dir/flowexperimental/comp/flow_comp_dispatch9.cpp.o -c /build/deps/opm-simulators/flowexperimental/comp/flow_comp_dispatch9.cpp
{standard input}: Fatal error: CMakeFiles/flow_comp.dir/flowexperimental/comp/flow_comp_dispatch9.cpp.o: No such file or directory
[911/922] Building CXX object CMakeFiles/flow_comp.dir/flowexperimental/comp/flow_comp_dispatch10.cpp.o
[912/922] Building CXX object CMakeFiles/flow_comp.dir/flowexperimental/comp/flow_comp_dispatch9_2p.cpp.o
[913/922] Building CXX object CMakeFiles/flow_comp.dir/flowexperimental/comp/flow_comp_dispatch10_2p.cpp.o
[914/922] Building CXX object CMakeFiles/flowexp_blackoil.dir/flowexperimental/flowexp_blackoil.cpp.o
[915/922] Building CXX object CMakeFiles/flow_blackoil_float.dir/flow/flow_blackoil_float_main.cpp.o
[916/922] Building CXX object CMakeFiles/flow_blackoil_polyhedralgrid.dir/flow/flow_blackoil_polyhedralgrid.cpp.o
[917/922] Building CXX object CMakeFiles/flow_blackoil_alugrid.dir/flow/flow_blackoil_alugrid.cpp.o
ninja: build stopped: subcommand failed.
Build step 'Execute shell' marked build as failure
Archiving artifacts
Recording test results
ERROR: Step ‘Publish JUnit test result report’ failed: No test report files were found. Configuration error?
[analysis] Skipping execution of recorder since overall result is 'FAILURE'
Setting status of bb7752e003dc544a9121768937b2b67efc048044 to FAILURE with url https://ci.opm-project.org/job/opm-common-PR-builder/10042/ and message: 'Build finished. '
Finished: FAILURE

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

Labels

manual:new-feature This is a new feature and should be described in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants