Skip to content

Separate out geomechanical items from BCPROP to new keyword BCMECH - #5295

Merged
totto82 merged 1 commit into
OPM:masterfrom
svenn-t:bcmech
Sep 8, 2026
Merged

Separate out geomechanical items from BCPROP to new keyword BCMECH#5295
totto82 merged 1 commit into
OPM:masterfrom
svenn-t:bcmech

Conversation

@svenn-t

@svenn-t svenn-t commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

This PR separates out the items for defining geomechanics boundary condition from BCPROP to a new keyword BCMECH. This allows for both keywords to be used together in a deck, or defining one without the other.
Note that the class where both keywords are parsed is renamed from BCProp to BCState to avoid confusion, since it now parses two keywords, BCPROP and BCMECH.

@svenn-t svenn-t added the manual:new-feature This is a new feature and should be described in the manual label Aug 14, 2026
@svenn-t

svenn-t commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

jenkins build this opm-simulators=7326 please

@hnil

hnil commented Aug 25, 2026

Copy link
Copy Markdown
Member

I think it is fine, it will give minimal changes in decks.

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.

🟡 Changes recommended

The current BCState merge/update logic makes BCMECH + BCPROP interaction order-dependent and can leave mechanical state unapplied when multiple BCPROP components share the same INDEX.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR introduces a new BCMECH SCHEDULE keyword to carry geomechanical boundary-condition items previously embedded in BCPROP, and renames the parsing/state container from BCProp to BCState to reflect that it now aggregates state from multiple keywords.

Changes:

  • Added BCMECH keyword definition and registered a new schedule handler to parse it into ScheduleState::bcstate.
  • Refactored BCProp into BCState and updated schedule state storage/serialization and tests accordingly.
  • Removed geomechanics-related items from the BCPROP keyword definition and updated error messaging/documentation text.
File summaries
File Description
tests/parser/ScheduleTests.cpp Updated schedule test access from bcprop to bcstate.
tests/parser/BCConfigTests.cpp Updated BC parsing tests to use BCState and added a BCMECH parsing case.
opm/input/eclipse/share/keywords/keyword_list.cmake Registered new BCMECH keyword file for generation/build.
opm/input/eclipse/share/keywords/900_OPM/B/BCPROP Removed geomechanics items from BCPROP definition.
opm/input/eclipse/share/keywords/900_OPM/B/BCMECH Added new BCMECH keyword definition.
opm/input/eclipse/Schedule/ScheduleState.hpp Renamed stored boundary-condition state from bcprop to bcstate and updated serialization.
opm/input/eclipse/Schedule/KeywordHandlers.cpp Added BCMECH handler and updated BCPROP handler to target bcstate.
opm/input/eclipse/Schedule/BCState.hpp Introduced BCState API and new updateBCMech entry point.
opm/input/eclipse/Schedule/BCState.cpp Implemented split parsing (fromBCProp / fromBCMech) and update logic.
opm/input/eclipse/EclipseState/SimulationConfig/BCConfig.cpp Updated obsolete-keyword error message to reference BCPROP/BCMECH.
CMakeLists_files.cmake Switched build inputs from BCProp.* to BCState.*.
Review details

Suppressed comments (2)

opm/input/eclipse/Schedule/BCState.cpp:212

  • BCMECH updates are only applied to the first existing BCFace with the matching index. If multiple BCPROP records exist for the same INDEX (different COMPONENT), this leaves the remaining faces with stale/default mechanical state, and it also makes BCMECH+BCPROP order-dependent.
    opm/input/eclipse/Schedule/BCState.cpp:202
  • When a new BCFace is created from BCPROP, it doesn't inherit any existing BCMECH state for the same INDEX. This breaks the intended behavior of allowing BCMECH and BCPROP to be used together (and makes parsing order-dependent when BCMECH appears before BCPROP).
  • Files reviewed: 11/11 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +221 to 225
BCMECH
1 FIXED 1 0 0 1.0 * * 2.0 * * /
2 FIXED 0 1 0 * 3.0 * /
3 FREE 0 0 1 * * 4.0 * * 5.0 /
/

@svenn-t svenn-t Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added new test with BCPROP and BCMECH in the same deck. This revealed a small bug with parsing: If BCMECH was before BCPROP, both defining on same index, BCPROP would duplicate entry, and possibly that info would have been lost when queried later. Now it adds the BCPROP info to the index instead.

@totto82

totto82 commented Sep 4, 2026

Copy link
Copy Markdown
Member

I also suggest adding a BCMECH regression test. Or add BCMECH to one of the TPSA tests. I assume it doesn't have it since Jenkins didn't complain about the keyword change.

@svenn-t

svenn-t commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

I also suggest adding a BCMECH regression test. Or add BCMECH to one of the TPSA tests. I assume it doesn't have it since Jenkins didn't complain about the keyword change.

Added a new TPSA case in opm-tests with BCMECH (OPM/opm-tests#1583), as well as including it in the regression tests in the opm-simulators companion PR.

@totto82

totto82 commented Sep 8, 2026

Copy link
Copy Markdown
Member

jenkins build this opm-simulators=7326 please

- Add separate handling of BCPROP and BCMECH to allow for one without the other
- Renamed BCProp class to BCState since it still contain BC info on both
@totto82

totto82 commented Sep 8, 2026

Copy link
Copy Markdown
Member

jenkins build this opm-simulators=7326 please

@totto82

totto82 commented Sep 8, 2026

Copy link
Copy Markdown
Member

The test case fails as expected. I will create the ref solution.

@totto82

totto82 commented Sep 8, 2026

Copy link
Copy Markdown
Member

jenkins build this opm-simulators=7326 update_data please

@totto82

totto82 commented Sep 8, 2026

Copy link
Copy Markdown
Member

jenkins build this opm-simulators=7326 opm-tests=1591 please

@totto82

totto82 commented Sep 8, 2026

Copy link
Copy Markdown
Member

Thanks. With the regression ref. in place, I will start the merging process.

totto82 pushed a commit to OPM/opm-tests that referenced this pull request Sep 8, 2026
        PR OPM/opm-simulators#7326

Reason: PR OPM/opm-common#5295
        PR OPM/opm-simulators#7326

opm-common     = 9ba0983324e69a3af878d0874840202d268bc0f4
opm-grid       = 798166c5de06f16cc4d9d0acd19d15cc681f6ffd
opm-simulators = 016e665c5afd36e61767223fc0fb702f5f9f0884

### Changed Tests ###

  * tpsa_bc
totto82 added a commit to OPM/opm-tests that referenced this pull request Sep 8, 2026
…simulators_7326

Automatic Reference Data Update for PR OPM/opm-common#5295
@totto82
totto82 merged commit b111d23 into OPM:master Sep 8, 2026
2 checks passed
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.

4 participants