AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Two Phase Flow

skill-jskherman-engg-skills-two-phase-flow · by jskherman

>-

No reviews yet
0 installs
0 views
view→install

Install

$ agentstack add skill-jskherman-engg-skills-two-phase-flow

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-jskherman-engg-skills-two-phase-flow)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Two Phase Flow? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Two-Phase Pressure Drop

Overview

Three established gas-liquid two-phase pressure-drop correlations from the fluids.two_phase module. Each correlation has its strengths:

  • Lockhart-Martinelli: classical horizontal, widely cited, ±30% typical.
  • Beggs-Brill: handles inclination (essential for risers, hilly

pipelines).

  • Mueller-Steinhagen-Heck: smooth interpolation between all-liquid and

all-vapor frictional gradients; recommended starting point for refrigerant evaporator design.

Prerequisites

  1. uv available.
  2. On first use, the script writes LICENSE_NOTIFICATION.txt listing the

fluids library terms.

When to Use

  • Two-phase frictional pressure drop is needed in a pipe (flare, reboiler

return, riser, knock-out drum inlet, slug catcher manifold).

  • Comparing two correlations to bracket the design pressure drop.

Don't use for

  • Single-phase pipe flow — use pipe-flow-pressure-drop.
  • Choked / sonic flow at a relief valve outlet — use relief-valve-sizing-api520.
  • Two-phase across a control valve — consult vendor methods; the control-valve

sizing skill only covers liquid/gas ISA sizing, not two-phase trim rating.

Utility Scripts

  • uv run scripts/two_phase.py lm --m 5.0 --quality 0.3 --rho-l 600 --rho-g 30 --mu-l 0.0002 --mu-g 1.0e-5 --D 0.1 --L 50 --output /tmp/lm.json
  • uv run scripts/two_phase.py beggs-brill --m 5.0 --quality 0.3 --rho-l 600 --rho-g 30 --mu-l 0.0002 --mu-g 1.0e-5 --sigma 0.02 --P 1000000 --D 0.1 --L 50 --angle 30 --output /tmp/bb.json
  • uv run scripts/two_phase.py msh --m 5.0 --quality 0.3 --rho-l 600 --rho-g 30 --mu-l 0.0002 --mu-g 1.0e-5 --D 0.1 --L 50 --output /tmp/msh.json

Procedure

  1. Establish phase mass flow rates and quality x = m_g / (m_g + m_l).
  2. Get phase densities and viscosities at operating conditions (use

vle-flash-calculations if needed).

  1. Pick a correlation:
  • Horizontal, dilute liquid: Lockhart-Martinelli.
  • Inclined, any angle, oil/gas pipeline: Beggs-Brill.
  • Refrigerant / process evaporator, smooth quality range: Mueller-

Steinhagen-Heck.

  1. Run two correlations and compare; use the higher dP for the design

margin unless one is clearly outside its validity range.

Pitfalls

  • Using a single-phase friction factor on a two-phase stream.
  • Treating the slip ratio as 1 (homogeneous) for high-quality steam — fine

for refrigerant boiling, not for low-pressure flashing systems.

  • Ignoring vapor density variation along the pipe; for long lines the

acceleration term can dominate at the outlet.

  • Picking Lockhart-Martinelli for a vertical riser; it does not include

gravity head.

  • Picking Beggs-Brill horizontal mode at 0° without verifying the

correlation switches to the appropriate flow regime.

  • Forgetting that quality changes when heat is added or pressure drops

(flashing or condensing). The correlations assume a constant quality over the pipe length L; for large dP / large dT, segment the pipe.

  • Reporting only one correlation's number; a 2x spread between correlations

is normal for two-phase flow.

  • Using these correlations for entrained-droplet flow at high vapor velocity

with a demister downstream; entrainment loading matters and is not in the correlation.

Fallback Strategies

  • If fluids is not installed, escalate to the user; there is no clean

pure-Python fallback for Beggs-Brill that captures all flow regimes.

  • For very high quality (x → 1), the Lockhart-Martinelli parameter X

approaches 0 and the correlation degrades; switch to a homogeneous-flow approximation or to Mueller-Steinhagen-Heck.

Verification

  • Run the listed script with representative inputs and an --output file when a deterministic calculation is available.
  • Confirm the JSON result contains ok: true, expected units, and no unhandled warnings.
  • Check result magnitudes against the stated assumptions, references, and a hand calculation or known operating range before reporting them.

References

  • references/correlation_choice.md — when each correlation is most suitable.
  • Beggs & Brill, Two-Phase Flow in Pipes (Univ Tulsa Press, 1991).
  • Lockhart & Martinelli, Chem Eng Prog 45, 1949.
  • Mueller-Steinhagen & Heck, Chem Eng Proc 20, 1986.
  • fluids documentation: https://fluids.readthedocs.io/fluids.two_phase.html

Anti-Patterns

  • Picking one correlation and not documenting why.
  • Designing a flare line without checking back-pressure on multiple PRV

cases.

  • Treating two-phase dP as if it were 1.2x single-phase dP — that

shortcut fails dramatically in slug flow.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.