Skip to content

docs(flow-assurance): replace unsafe overview screening - #2920

Merged
EvenSol merged 1 commit into
masterfrom
docs/d048-flow-assurance-overview
Aug 10, 2026
Merged

docs(flow-assurance): replace unsafe overview screening#2920
EvenSol merged 1 commit into
masterfrom
docs/d048-flow-assurance-overview

Conversation

@EvenSol

@EvenSol EvenSol commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Refs #2499.

Frozen D048 scope

Rotation scope 5: PVT, flow assurance, standards, and gas/oil quality.

Changed paths:

  • docs/pvtsimulation/flow_assurance_overview.md
  • src/test/java/neqsim/pvtsimulation/flowassurance/FlowAssuranceDocumentationTest.java

Evidence-only source and tests inspected:

  • DeBoerAsphalteneScreening
  • ScalePredictionCalculator
  • ThermodynamicOperations
  • hydrate, asphaltene, and scale implementation tests and linked model guides

No open PR found for issue #2499 or this flow-assurance page before publication. PR #2337's fluid-characterization mathematics page and PR #2632's benchmark/reference indexes were explicitly excluded.

Confirmed defects and root cause

The previous overview accumulated unrelated fragments and presented illustrative shortcuts as engineering decisions. The bounded scan confirmed 11 defects: 4 high, 6 medium, 1 low.

High

  1. Twelve addTBPfraction calls supplied molecular weights such as 95–1000 where the API expects kg/mol.
  2. The purported “complete” screen invented a De Boer pressure-difference/asphaltene-content formula and thresholds instead of using NeqSim's implemented density-dependent screening boundaries.
  3. A phase count greater than two was treated as proof of an asphaltene-rich phase, although water or another configured phase can produce the same count.
  4. Scale, sweet-corrosion, sour-service, and chemical-treatment conclusions were inferred directly from bulk CO2/H2S/water mole fractions without aqueous chemistry, fugacity, wall, velocity, kinetics, materials, or standards evidence.

Medium

  1. “30 wt% MEG” was represented by component mole amounts, conflating mass and mole bases.
  2. A combined operating envelope hard-coded WAT/AOP values and described WAT as pressure-independent and AOP as temperature-independent.
  3. Several code fragments depended on undeclared state; the pipeline fragment used undefined wellStream, fluid, and ops.
  4. Hydrate and other calculation exceptions were swallowed and presented as “No hydrate” or no result.
  5. Fixed pH, FeCO3, and velocity values were labeled broadly optimal without an applicability boundary or source.
  6. “Full” capability and mitigation claims exceeded what the illustrated models establish.

Low

  1. Eleven source links omitted the explicit .md target used by this documentation tree.

Fix

  • Replaced the fragmented overview with one complete Java 8 screen using supported APIs:
    • electrolyte-CPA hydrate equilibrium for a fully specified gas/water/MEG/brine composition;
    • DeBoerAsphalteneScreening with bara and kg/m3 inputs;
    • ScalePredictionCalculator with explicit produced-water chemistry in mg/L.
  • Let calculation failures propagate instead of interpreting failure as absence of risk.
  • Added result-specific limitations for equilibrium, kinetics, deposition, transportability, materials, integrity, and chemical qualification.
  • Replaced hard-coded operating-envelope conclusions with a governed study workflow covering cases, input basis, profiles, uncertainty, validation, mitigation, and decision records.
  • Defined hydrate subcooling and mineral saturation index with balanced display math.
  • Made all related internal links explicit .md targets.
  • Extended the focused documentation test to execute every hydrate and scale API call shown; the existing test continues to lock the De Boer classification and risk index.

Before/after behavior

Before: the page did not provide a reliably executable or technically defensible integrated screen.

After, the exact fenced program compiles and executes with NeqSim 3.17.0 / Java 17.0.19 and returns:

Hydrate equilibrium temperature: -12.46 °C
De Boer screen: MODERATE_PROBLEM; risk index 1.600
Calcite SI: -52.281; barite SI: 0.166; any scale flag: true

These are case-specific demonstration results; the page explicitly prohibits transferring them to another fluid or water analysis.

Validation

Final checkout is based on current master 60a6bde70de6f0a99b7b59d454e9a936d61d296d.

  • python devtools/run_spotless.py apply — exit 0; rerun exit 0 with unchanged candidate hashes.
  • python devtools/run_spotless.py check — exit 0.
  • python devtools/check_documentation_search.py — exit 0; 647 Markdown pages and 1 standalone HTML page audited.
  • pre-commit run --all-files --hook-stage pre-commit — exit 0; Spotless format passed.
  • pre-commit run --all-files --hook-stage pre-push — exit 0; Spotless check and documentation-search hook passed.
  • ./mvnw -s .task-maven-settings.xml -o -Dtest=neqsim.pvtsimulation.flowassurance.FlowAssuranceDocumentationTest test — exit 0; 2 tests, 0 failures/errors/skips; 3,146 main and 1,665 test sources compiled.
  • ./mvnw -s .task-maven-settings.xml -o -Dtest=neqsim.pvtsimulation.flowassurance.ScalePredictionTest test — exit 0; 24 tests, 0 failures/errors/skips.
  • Focused slow hydrate reference test at 50 bara with -Dgroups=slow -DexcludedTestGroups= — exit 0; 1 test, 0 failures/errors/skips.
  • Exact Java fence compared byte-for-byte with the launched source, compiled by Java single-file source mode, and executed — exit 0 with the output above.
  • Static Markdown scan — valid front matter; one H1; balanced Java fence and math delimiters; no raw HTML; no images; no external links; no extensionless relative links.
  • Internal-link scan — all 15 unique relative targets resolve; no page-local anchor references.
  • Stale-pattern rescan — no incorrect TBP calls, invented De Boer shortcut, phase-count shortcut, swallowed calculation exceptions, hard-coded WAT/AOP envelope, or unsupported “Full” claims remain.
  • Source/API comparison — constructor units, method signatures, SI definition, and scale-risk semantics match current Java source.

Maven used a task-local settings file whose central repository ID points to the canonical https://repo.maven.apache.org/maven2/ endpoint. Validation completed from the existing verified local dependency cache because this environment could not resolve public Maven DNS during the first attempt; no repository configuration is included in the commit.

Rendering, links, equations, and notebooks

  • Local Jekyll rendering was unavailable because Ruby and Bundler are not installed. The repository's hosted documentation-search job builds the complete Jekyll site and must pass before this draft is ready.
  • No external links or images exist in the changed page, so no HTTP retry or image inspection was applicable.
  • The page contains no Python or notebook example. The NeqSim Python bootstrap policy was therefore not triggered.
  • No index change is needed: this is an existing indexed overview, not a new or orphaned page.

Regression coverage

FlowAssuranceDocumentationTest now covers every public hydrate and scale API call in the page. The existing De Boer test covers the demonstrated constructor, classification, index, and description. Adjacent scale and slow hydrate reference tests also passed.

Next scan

After this PR merges and the ledger records D048 complete, continue D049 with rotation scope 6: process safety, risk, safety-analysis recipes, and standards boundaries.

Replace stale and non-executable screening shortcuts with an evidence-based Java example using the supported hydrate, De Boer, and aqueous scale APIs. Document the engineering boundaries of each result and add focused executable coverage for every demonstrated API call.

Refs #2499
@EvenSol
EvenSol marked this pull request as ready for review August 10, 2026 04:53
@EvenSol
EvenSol merged commit d628980 into master Aug 10, 2026
22 checks passed
@EvenSol
EvenSol deleted the docs/d048-flow-assurance-overview branch August 10, 2026 04:54
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