Skip to content

Term-project demo prep: RsDb rename, per-step compositions, vapor placeholder drop - #10

Closed
olefair wants to merge 2 commits into
mainfrom
claude/fix-plus-fraction-dew-GYWe4
Closed

Term-project demo prep: RsDb rename, per-step compositions, vapor placeholder drop#10
olefair wants to merge 2 commits into
mainfrom
claude/fix-plus-fraction-dew-GYWe4

Conversation

@olefair

@olefair olefair commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

GUI polish + DTO plumbing so the PETE 665 term-project mini-sim demo shows complete, correctly-labelled results. Sits on top of the earlier dew-fix commit (22d72da) on this branch.

Changes

  • RsDiRsDb rename across the GUI layer. RsDb (solution GOR at the bubble point) is the accurate label and matches the assignment nomenclature. Renamed in:

    • Text output DL table header + stat line (src/pvtapp/widgets/text_output_view.py)
    • Results view plot series key + label (src/pvtapp/widgets/results_view.py)
    • DL composition-table column header (src/pvtapp/widgets/results_view.py)
    • CSV export column header (src/pvtapp/main.py)
  • Per-step phase compositions surfaced to the Text Output view. The engine already emits liquid_composition / vapor_composition on each CCEStepResult and liquid_composition / gas_composition on each DLStepResult, but the DTO layer was stripping them. Now:

    • CCEStepResult / DLStepResult schemas carry optional component-keyed dicts (src/pvtapp/schemas.py)
    • job_runner.execute_cce / execute_dl zip the engine arrays into dicts via a new _composition_array_to_dict helper (src/pvtapp/job_runner.py)
    • Text Output renders wide-format pressure-by-component tables after the CCE and DL result tables (src/pvtapp/widgets/text_output_view.py)
  • Remove unwired "Vapor saturation" calc-type placeholder from the main window (src/pvtapp/main.py) — the underlying engine path is not implemented and the placeholder is a visible artifact during live demo.

Test plan

  • pytest tests/ — 663 passed, no regressions
  • Manual GUI smoke test on the assignment composition (C1/C2/C3/nC4/nC5 + PSEUDO+, T = 128.5 °F, PR78, k_ij = 0): bubble-point, CCE at 1000/1250/1500 psia, DL at 500/300/100 psia — verify plots, tables, and per-step composition tables render cleanly
  • Verify CSV export uses RsDb header

https://claude.ai/code/session_01Lp51eQA5DXfTPJb9HoAc8g

claude added 2 commits April 21, 2026 04:58
…ake Newton dew guess-invariant

The plus-fraction dew-point lumped-path validation test was silently xfailed
across six parametrizations (dry_gas_a/b, gas_condensate_a/b, co2_rich_gas_a/b)
because the lumped dew pressure disagreed with the explicit-fluid dew pressure
by 3-30%. Two separate regressions were driving this:

1. The default lumping_method was flipped from "contiguous" to "whitson" in
   a checkpoint commit. The stored test fixtures (and the desktop runtime's
   gas_condensate preset, which explicitly expects lumping_n_groups=2) were
   captured under contiguous lumping. Restore "contiguous" as the default in
   CharacterizationConfig, PlusFractionEntry, and all six plus_fraction_policy
   presets, and update the runtime contract test accordingly.

2. The Newton dew-point fast path was seeding Newton directly from a
   user-supplied pressure_initial. For retrograde fluids this frequently
   pushed the iterate onto the upper dew branch (e.g. 14.5 MPa instead of
   ~17 kPa for dry_gas_b at 5e7 Pa init), producing guess-dependent
   answers. Always seed Newton from the Wilson estimate, which lies close
   to the lower dew branch and produces a canonical, guess-invariant dew
   pressure.

Refresh the two gas_condensate fixtures whose stored values predate the
current Newton solver, and remove the xfail decorator so the test runs
strictly in CI.
…or placeholder

- Rename RsDi (initial solution GOR) to RsDb (solution GOR at bubble point)
  everywhere in the GUI layer: text output table/header, results view plot
  series key+label, DL composition_table header, CSV export column header.
  RsDb is the more accurate label (Rs at P=Pb) and matches the term-project
  assignment nomenclature.
- Plumb per-step phase compositions through to the Text Output view. The
  engine already emits liquid_composition/vapor_composition (CCE) and
  liquid_composition/gas_composition (DL) on each step; extend the DTO
  schemas (CCEStepResult, DLStepResult), zip them into dicts in the
  job_runner, and render wide-format pressure-by-component tables after the
  CCE and DL result tables.
- Remove the "Vapor saturation" calculation placeholder (label + ViewSpec +
  view_widgets entry) from the main window. That calc type is not wired to
  the engine and the placeholder is a visible artifact during the demo.

https://claude.ai/code/session_01Lp51eQA5DXfTPJb9HoAc8g
@olefair olefair closed this Apr 21, 2026
@olefair
olefair deleted the claude/fix-plus-fraction-dew-GYWe4 branch April 21, 2026 06:59
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.

2 participants