agentleFS
jskhermanjskherman/engg-skills/skills/pipe-flow-pressure-drop/SKILL.md

pipe-flow-pressure-drop

Skill7 starsChanged 6 months agoApache-2.0View on GitHub

Estimate single-phase incompressible pipe pressure drop, Reynolds number, Darcy friction factor, and head loss for steady pipe flow, with optional minor-loss and elevation terms. Use when sizing a pump line, checking line size, or screening pressure drop in pipes. Don't use for two-phase flow (use two-phase-flow), compressible / choked flow, or detailed fittings/valves pressure-drop selection without sourced K factors.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run the script. The output reports Re.

    line 61
  2. Distinctive:

    Add fitting / valve K-factor losses separately if needed.

    line 63
  3. Distinctive:

    If the pressure drop is large, iterate to a larger diameter and rerun.

    line 64
  4. Very specific:

    If fluids is missing, the script falls back to Haaland explicitly and flags the substitution in the JSON output.

    line 84
  5. Distinctive:

    If the calculated Re is borderline transitional, the script attaches a warning so downstream design margins can be increased.

    line 86
  6. Very specific:

    Run the listed script with representative inputs and an --output file when a deterministic calculation is available.

    line 91
  7. Distinctive:

    Check result magnitudes against the stated assumptions, references, and a hand calculation or known operating range before reporting them.

    line 93

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Single-Phase Pipe Pressure Drop

Overview

Computes Darcy-Weisbach pressure drop with the Clamond friction factor (via fluids) as primary, and the Haaland explicit form as fallback when fluids is unavailable or fails. Outputs include Re, friction factor f, velocity, head loss, and pressure drop.

Prerequisites

  1. uv available.

When to Use

  • Sizing a pump suction or discharge line.
  • Checking line size given a design flow.
  • Screening pressure drop across a long straight run before adding fittings.

Don't use for

  • Two-phase flow (two-phase-flow).
  • Compressible / choked gas flow.
  • Pressure drop across fittings, valves, expansions, contractions (those need K factors).
  • Non-Newtonian fluids.

Utility Scripts

  • uv run scripts/pipe_pressure_drop.py --length-m 100 --diameter-m 0.05 --flow-m3-s 0.002 --density-kg-m3 998 --viscosity-pa-s 0.001 --roughness-m 1.5e-6 --output /tmp/pdrop.json

Procedure

  1. Get fluid density and viscosity at the operating temperature.
  2. Pick the pipe inside diameter (after accounting for wall thickness and schedule).
  3. Pick the pipe absolute roughness (commercial steel ~ 45 μm, drawn tubing ~ 1.5 μm, PE ~ 0.0015 mm).
  4. Run the script. The output reports Re; check that the flow is in the regime you expect.
  5. Add fitting / valve K-factor losses separately if needed.
  6. If the pressure drop is large, iterate to a larger diameter and rerun.

Pitfalls

  • Using nominal pipe diameter instead of the inside diameter for a given schedule.
  • Using roughness too low (e.g. ε = 0 for smooth pipe) for commercial steel.
  • Forgetting elevation change when the outlet elevation differs; pass --elevation-m explicitly.
  • Treating the result as the total dP across a system unless you supplied representative minor-loss K values and elevation change.
  • Using water properties for a hydrocarbon line.
  • Mixing kinematic and dynamic viscosity.
  • Reporting head loss in meters of water when the fluid is something else.
  • Using the formula in the transitional regime (2300 < Re < 4000) without acknowledging the uncertainty band.

Fallback Strategies

  • If fluids is missing, the script falls back to Haaland explicitly and flags the substitution in the JSON output.
  • If the calculated Re is borderline transitional, the script attaches a warning so downstream design margins can be increased.

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/limitations.md — full assumption list.
  • Crane TP-410 (procure separately) for fittings / valve K-factors.

Anti-Patterns

  • Designing a pipe with an estimated dP and zero margin.
  • Reporting Δp in psi without naming whether it is gauge or absolute (it is a Δ, but the reader still needs to know the basis).
  • Using this skill for the long-run flare line where two-phase or compressible effects matter.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.