Skip to content

Add optional verify/run simulator integration - #55

Merged
magnesj merged 3 commits into
mainfrom
add-simulator-support
Jun 30, 2026
Merged

Add optional verify/run simulator integration#55
magnesj merged 3 commits into
mainfrom
add-simulator-support

Conversation

@magnesj

@magnesj magnesj commented Jun 30, 2026

Copy link
Copy Markdown
Member

Adds optional, opt-in support for verifying and running a deck with a locally installed OPM Flow binary, directly from the editor.

Commands

Both appear on the editor right-click menu and the Command Palette (restricted to .DATA files):

  • OPM Flow: Verify Deck (dry run) — runs flow in dry-run mode (--enable-dry-run=true). The deck is fully parsed and the model is initialized (grid, properties, wells, schedule) without simulating the time steps — a fast check that the deck and everything it pulls in via INCLUDE / PATHS loads cleanly.
  • OPM Flow: Run Simulation — runs the full simulation.

Both run in a reused integrated terminal, started in the deck's own directory so relative paths resolve, with live output (and Open PRT File afterwards).

Configuration (opt-in)

Nothing runs until opm-flow.simulator.executablePath is set. New opm-flow.simulator.* settings:

Setting Default Purpose
executablePath "flow" flow binary (a WSL path when useWsl is on)
useWsl false run through wsl.exe
wslDistribution "" target distribution (empty = default)
verifyArgs ["--enable-dry-run=true"] args for Verify
runArgs [] extra args for Run

Cross-platform

  • Windows + WSL: deck Windows paths are translated to their /mnt/<drive> mount (and \wsl$ UNC paths unwrapped); an optional distribution is targeted.
  • Linux / macOS: flow runs natively in the integrated terminal's POSIX shell.
  • Windows without WSL: steered to settings rather than routing a POSIX command line through PowerShell.

Pure path/command-building helpers live in simulator.ts with unit tests.

Other changes

  • Editor context menu reorganised into three separated, ordered groups: formatting, navigation, verify/run.
  • Verify/run documented in the extension and repo READMEs.

All 360 tests pass; tsc clean.

magnesj added 3 commits June 30, 2026 10:51
Two new commands launch a locally installed OPM Flow binary on the open deck in
an integrated terminal:

- OPM Flow: Verify Deck (dry run) — parses and initializes the model without
  solving (flow --enable-dry-run=true), confirming the deck and its
  INCLUDE/PATHS files load cleanly.
- OPM Flow: Run Simulation — full run.

Both start in the deck's own directory so relative paths resolve. New
opm-flow.simulator.* settings configure the executable path, args, and WSL.

Windows users run via WSL (wsl.exe): the deck's Windows path is translated to
its /mnt/<drive> mount (and \wsl$ UNC paths are unwrapped) and an optional
distribution is targeted. Linux/macOS run flow natively; native Windows without
WSL is steered to settings. Pure path/command-building helpers live in
simulator.ts with unit tests.
Split the OPM Flow editor right-click commands into three separated, ordered
groups — formatting (align, headers, comment), navigation (open PRT), and
verify/run — instead of one flat list.
@magnesj
magnesj merged commit b8c1ffd into main Jun 30, 2026
4 checks passed
@magnesj
magnesj deleted the add-simulator-support branch June 30, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant