Install
$ agentstack add skill-jskherman-engg-skills-vle-flash-calculations ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo 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.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
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 →About
Vapor-Liquid Equilibrium Flash Calculations
Overview
Solves VLE flashes for multicomponent mixtures using thermo.FlashVL backed by a chosen cubic equation of state (PR, SRK, PRSV, PR-Translated variants). Also provides a pure-Python Rachford-Rice solver for screening when only K-values are available.
Prerequisites
uvavailable on PATH (see theuvskill).- On first use, the script writes
LICENSE_NOTIFICATION.txtinto this
skill directory listing the upstream terms for the thermo and chemicals libraries; review them before any regulated or commercial use.
When to Use
- A flash split, K-values, or dew/bubble curve is needed for a defined hydrocarbon
or sour mixture.
- The user wants to evaluate phase behaviour at multiple T,P points.
- A quick Rachford-Rice solve with pre-computed K-values is needed for screening.
Don't use for
- Pure water / steam utility states — use
steam-tables-iapws. - Picking the right property method in the first place — use
equation-of-state-selection.
- Reactive systems (amine-CO2-H2S kinetics, ester hydrolysis, etc.) where the
rate-based reaction matters more than phase equilibrium alone.
- Polymer or electrolyte systems — cubic EOS are unsuitable.
Core Rules
- Always specify component identifiers in a form
chemicals.search_chemical
can resolve (IUPAC name, common name, or CAS number).
- Always declare which EOS is used; the default is PR but the right choice
depends on the system (see equation-of-state-selection).
- Binary interaction parameters (kij) default to zero. For sour-gas, polar,
or amine systems, pass realistic kijs (sources: Sandler, Whitson, vendor databases) — using zeros silently is a common error.
- Report the JSON result envelope; never paraphrase numerical values without
reference to the JSON file written by the script.
Utility Scripts
uv run scripts/flash.py tp --components propane,n-butane --zs 0.4,0.6 --T-K 300 --P-Pa 800000 --eos PR --output /tmp/flash.jsonuv run scripts/flash.py bubble --components propane,n-butane --zs 0.4,0.6 --T-K 300 --eos PR --output /tmp/bubble.jsonuv run scripts/flash.py dew --components propane,n-butane --zs 0.4,0.6 --T-K 320 --eos PR --output /tmp/dew.jsonuv run scripts/flash.py rr --Ks 4.2,0.6 --zs 0.4,0.6 --output /tmp/rr.jsonuv run scripts/flash.py envelope --components propane,n-butane --zs 0.5,0.5 --T-K-list 280,290,300,310,320 --P-Pa 800000 --eos PR --output /tmp/envelope.json
Procedure
- Identify components and resolve their CAS numbers via
chemicals.search_chemical (do this once, paste resolved names into the call).
- Choose the EOS family (PR for most hydrocarbon work; PRSV / translated
variants for sour or polar systems; SRK as a sanity check).
- Decide on kij values: zero for chemically similar hydrocarbons; ~0.05-0.08
for H2S in light hydrocarbon; ~0.10-0.25 for H2S/amine. Document the source.
- Run
flash tpfor a specified (T,P,zs); inspectvapor_fractionand
the phase classification.
- For phase envelope work, repeat at a list of T or P values.
- Validate the result: density vs lab data, dew/bubble vs operating data, or
trusted simulator. Adjust kij if needed.
Pitfalls
- Using PR (default) for systems containing H2S, CO2, or amines without
supplying non-zero kij values. Mixture properties (especially density and loading) will be wrong.
- Confusing PR with
PRMIXTranslatedPPJP— both are PR family, but the
translated/consistent versions give markedly different liquid densities (5-15% closer to experimental).
- Reporting K-values from an in-phase region (single-phase) as meaningful;
K-values are only physically defined when both phases exist.
- Passing zs that sum to something other than 1 without normalizing. The
script normalizes for you but logs a warning — don't ignore it.
- Using
flash tpwith a T that is above the mixture critical temperature
and expecting two phases; thermo may converge to a "vapor" with a phase classification that needs interpretation.
- Treating volumetric flow as molar flow when computing absolute mass rates
downstream; the JSON gives mole-basis K-values and compositions.
- Picking SRK because it is faster; the binary-parameter database for PR is
larger, so PR usually gives better results for hydrocarbon work.
- Forgetting that
PRMIXTranslatedPPJPneeds volume-translation constants
cs. The script defaults them to zero (a documented assumption); supply real values for production work.
- Calling Rachford-Rice with one phase or with all K > 1 or all K < 1; the
script returns the trivial single-phase answer with a regime flag rather than failing.
- Treating the dew/bubble pressure as exact at the second decimal place; the
underlying solver converges to a tolerance of about 1e-6 in mole fractions, which corresponds to wider uncertainty in pressure for near-azeotropic mixes.
Fallback Strategies
- If
thermo.FlashVLfails to converge (rare for hydrocarbon systems), drop
to Rachford-Rice with K-values from Antoine vapor pressures and a modified-Raoult assumption (flash rr). Document the assumption.
- If
chemicals.search_chemicalcannot resolve a component (e.g. exotic
amine or carbazole), supply explicit --Tcs, --Pcs, --omegas arrays using literature values.
- If the system contains water + hydrocarbon and the result is
obviously wrong (e.g. water dissolves completely into the hydrocarbon phase at low T), switch to an activity-coefficient model — but those are outside this skill; surface that to the user.
Verification
- Run the listed script with representative inputs and an
--outputfile 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/eos_choice.md— quick decision matrix for PR/SRK/PRSV/translated.references/kij_starting_points.md— sourced kij starting values for
H2S/CO2/N2 with light hydrocarbons.
- Caleb Bell,
thermodocumentation: https://thermo.readthedocs.io/ - Caleb Bell,
chemicalsdocumentation: https://chemicals.readthedocs.io/
Anti-Patterns
- Reporting flash results as exact without stating the EOS, kijs, and zs basis.
- Using flash output as a final design basis for a relief case or for safety
classification without independent validation.
- Hiding the difference between
PRandPRMIXTranslatedPPJPwhen reporting
liquid density.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: jskherman
- Source: jskherman/engg-skills
- License: Apache-2.0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.