MINT — The System Guide¶
What is built, how it works, and why it works that way.
This is the source for the mkdocs tutorial site and the reference for pitching MINT. Screenshot placeholders are marked ![...] — drop Cloudinary URLs in.
Version 0.1 · 6 Aug 2026 · 498 tests passing
1. What MINT is, in one paragraph¶
MINT models the performance of an oil or gas well. You describe the fluid, the reservoir's ability to deliver into the wellbore, and the pipe the fluid has to climb — and MINT tells you what the well will actually produce, at what pressure, and what is limiting it. It then tunes itself against your measured well tests until it reproduces reality, and only then predicts. It is the direct equivalent of Petroleum Experts' PROSPER, built to run in a browser and as an installed desktop console.
2. The four questions MINT answers¶
Every screen exists to answer one of these.
| Question | Module | Screen |
|---|---|---|
| What is this fluid going to do as pressure drops? | PVT | Fluid |
| How much can the rock deliver into the well? | IPR (inflow) | Inflow |
| What pressure is needed to lift it to surface? | VLP (outflow) | Gradient, VLP family |
| Where do those two balance — what does the well actually make? | Nodal | System |
| Does the model match reality? | Matching | Matching |
| What happens if something changes? | Sensitivity | Sensitivity |
3. How the physics fits together¶
PVT ──────────────┐
(fluid properties │ feeds both sides
at every pressure │
and temperature) │
▼
IPR ─────────► NODAL SOLVE ◄─────── VLP
(what the rock (where they (what the pipe
can deliver) balance) demands)
│
▼
OPERATING POINT
rate + bottomhole pressure
The nodal solve is the heart. The IPR curve falls as rate rises — draw more and the reservoir pressure at the sandface drops. The VLP curve is U-shaped: at low rate the liquid holds up and the column gets heavy; at high rate friction takes over. Where they cross is what the well produces.
System-plot screenshot refresh is pending the Phase 10 browser capture.
Why the U matters. A U-shaped VLP can cross the IPR twice. The right-hand crossing is stable; the left-hand one is not — the well heads and slugs there. MINT finds every crossing, classifies each by stability, and reports the stable one with a warning about the unstable region.
This is a real differentiator. The legacy DB app compared the two curves by table row index — the two tables were built on different axes, so the "operating point" was never the intersection. Petex market their PE5 correlation specifically on avoiding this class of instability.
4. PVT — the fluid¶
What it does. Given pressure and temperature, it returns everything downstream needs: how much gas is dissolved in the oil (Rs), how much the oil has swollen (Bo), densities, viscosities, gas compressibility (z), surface tension, and whether free gas exists yet.
How it works. Petroleum engineers use correlations — equations fitted to laboratory data from real oil fields. MINT ships six families for the core properties:
| Correlation | Fitted to |
|---|---|
| Standing (1947) | 105 data points, 22 Californian crudes |
| Glaso (1980) | 45 samples, mostly North Sea |
| Vasquez-Beggs (1980) | 600+ lab analyses, split at 30° API |
| Petrosky-Farshad (1993) | 81 analyses, Gulf of Mexico |
| Al-Marhoun (1988) | 160 points, 69 Middle East samples |
| Lasater (1958) | 158 points, physically-based rather than regression |
Plus four dead-oil viscosity correlations, two saturated, one undersaturated, three compressibility, and a full formation-water suite.
⭐ What is different about ours¶
1. Correlations are reversible attributes, not a gate. PROSPER front-loads fluid type and correlation choice into a modal Options dialog, and changing it later invalidates every downstream screen. In MINT, with_correlations(bo="glaso") returns a copy. Change your mind freely.
2. Every correlation carries its published envelope. Standing was fitted to 16.5–63.8° API. Use it on 12° API oil and MINT tells you — naming the variable:
🔴 API 12.3° is below Standing's 16.5–63.8° range
Nobody in this market surfaces this at the point of use. Cheap to build, impossible for a 30-year-old codebase to retrofit, and a senior engineer notices it in a demo.
3. Run every correlation at once — the spread IS the uncertainty. Same fluid, same conditions, six bubble-point correlations:
standing 2463 psia
vasquez_beggs 2758
lasater 2791
al_marhoun 2833
glaso 2854
petrosky_farshad 6348 ← extrapolating outside its Gulf of Mexico envelope
Five cluster within 16%. One is 2.5× the others because it was fitted to a different kind of oil. That spread is a real uncertainty estimate, and an engineer who can see it makes a better decision than one handed a single confident number.
4. Measured data beats correlated data. If you have a lab report, use it. PVTTable takes a full pressure-indexed lab table; PropertyOverrides pins a single measured value. Anything not measured falls back to the correlation.
PVT-inspector screenshot refresh is pending the Phase 10 browser capture.
5. IPR — what the rock can deliver¶
What it does. Returns bottomhole pressure as a function of rate. Draw harder, pressure falls.
14 models. Eight for oil, six for gas, each gas model in two formulations.
Oil: Productivity Index · Vogel · Composite · Fetkovich · Jones · Darcy (pseudo-steady, steady, transient) · Joshi and Babu-Odeh horizontals
Gas: Back Pressure (Rawlins-Schellhardt) · Forchheimer · Darcy gas · Modified Isochronal — each in pressure-squared and pseudo-pressure form
Why two gas formulations. The pressure-squared form is only valid below ~2000 psia; the pressure form only above ~3000. Pseudo-pressure is valid everywhere, and it is what PROSPER's own gas IPR uses. MINT tabulates
m(p) = 2∫p/(μz)dpfrom the fluid and interpolates both directions.
Skin — and why we keep it decomposed¶
Skin is the extra pressure drop right at the sandface. Most tools give you one number. MINT breaks it into its physical causes:
damage +2.00
perforation +0.50 ← Karakas-Tariq
partial penetration +5.26 ← Brons-Marting
deviation -3.16 ← Cinco-Ley (negative: deviation HELPS)
─────────────────────────────
TOTAL +4.60
dominant mechanism : partial penetration
A lumped skin of +4.6 is a number. That breakdown is a workover plan. It says don't acidise — your problem is that you only perforated half the interval.
6. VLP — what the pipe demands¶
What it does. Marches down the wellbore in depth steps, computing pressure at each one. At every step it looks up fluid properties at that step's own pressure and temperature — and since those properties depend on the pressure we are solving for, each step iterates until it converges.
Seven correlations:
| Use it for | |
|---|---|
| Hagedorn-Brown | The oil workhorse — bubble and slug flow at moderate to high rate |
| Beggs-Brill (+Payne) | All inclinations. First method to account for deviation on holdup |
| Duns-Ros | Mist flow, high GOR, condensate — where H-B should not be used |
| Orkiszewski | Often matches well; its published 10 ft/s discontinuity is smoothed |
| Gray | Gas wells carrying condensate. Running an oil correlation on a wet gas well is a common, expensive mistake |
| Fancher-Brown | Quality control. No-slip, so it gives the lowest physically possible pressure — measured data below it means bad PVT or bad field data, not a bad correlation |
| Poettmann-Carpenter | 🟢 Validated to 0.1% against Guo Example 4.2 |
Every gradient is split by mechanism — gravity, friction, acceleration. That split is the diagnostic:
98% gravity → the column is heavy. Consider gas lift. 60% friction → the tubing is too small. Consider a larger string.
Gradient-plot screenshot refresh is pending the Phase 10 browser capture.
Depth runs downward. The Y axis is inverted, because that is how a wellbore is drawn. That single chart feature decided our charting library — most React chart libraries cannot do it at all.
Wellbore geometry¶
- Deviation surveys by minimum curvature — what a directional driller's report actually uses. Tangential methods under-predict TVD by >40% through a build section.
- No point limit. PROSPER caps surveys at 20 stations and applies "a filter algorithm" to anything longer, silently discarding data you supplied. MINT stores every station — a test runs 500 and asserts all 500 survive.
- Tapered strings with overlap detection, and 21 API tubing/casing sizes.
- Paste straight from Excel.
7. Matching — the one that matters¶
They will not ask how many correlations you have. They will ask whether it matches their well.
What it does. Takes your measured well tests and tunes the model until it reproduces them.
How it works. Two multipliers, deliberately:
| Multiplier | Carries | If it is far from 1.0 |
|---|---|---|
| Gravity (α) | holdup error | the PVT or holdup correlation is wrong |
| Friction (β) | wall-shear error | the roughness or geometry is wrong |
Two parameters, not five. More would fit better and mean less.
[PASS] 3 points · max 0.32% · mean 0.21% · bias -0.00% · tol 5.0%
gravity ×1.079, friction ×1.100
2024-03-11 2180 vs 2184 +0.18% OK
2024-07-22 2190 vs 2183 -0.32% OK
2025-01-15 2260 vs 2263 +0.13% OK
Matching screenshot refresh is pending the Phase 10 browser capture.
⭐ Three things that are ours¶
1. Bias is reported separately from scatter. Both can give a 10% mean-absolute error, but they are completely different problems:
- High bias, low scatter → the model is systematically off. That is a physics problem — wrong correlation, wrong PVT.
- Low bias, high scatter → the tests disagree with each other. That is a data problem — bad separator, unstable well.
The card literally says which: "systematic — check the physics" or "no systematic offset."
2. Residuals are minimised in relative terms. Matching a 3000 psi bottomhole pressure and a 300 psi wellhead pressure in one fit would otherwise let the big number own the answer entirely.
3. A multiplier pinned at its bound raises a warning. If the regression pushes gravity to its 1.4 limit and stops, tuning cannot reach your data — and MINT says so rather than quietly reporting a bad match. Check the inputs before widening the bound.
The 5% band is the documented industry tolerance: it "covers inaccuracies introduced by flow correlation performance or input data such as PI, SBHP or PVT." Configurable.
8. ⭐ Sensitivity — where we did something genuinely new¶
What it does. Vary anything, see what changes.
The problem with how everyone else does it¶
PROSPER has literally two separate menu items: "VLP Curves – 3 Variables" and "VLP Curves – 4 Variables." The arity is baked into the menu. Want to vary five things? You cannot. And the sensitivity runs through a four-screen wizard you must complete before you find out it takes twenty minutes.
What MINT does instead¶
1. Any variable, any arity, one object. A sensitivity is just a list of variables with a list of values each. Five variables is the same code path as two.
2. ⭐ The cost is visible before you commit.
3 × 3 = 9 runs · est. 3.1 s
That badge updates live as you edit the matrix. Nobody makes you guess. Add a fourth value to a variable and watch it become 3 × 4 × 3 = 36 runs · est. 12.6 s — then decide.
3. Three designs, because a full factorial explodes.
| Design | 3 variables × 4 values each | Use when |
|---|---|---|
| Full factorial | 64 runs — every combination | few variables, you want the whole surface |
| One at a time | 10 runs — vary one, hold the rest at base | many variables, you want individual effects |
| Latin hypercube | N runs — samples spanning the space evenly | many variables, you want coverage on a budget |
4. ⭐ A dead case does not kill the run. Sweep the wellhead pressure high enough and the well stops flowing. That is not an error — that is the sensitivity doing its job. The row reads "will not flow" and every other case still counts.
sensitivity/run -> 9 rows, 3 failed
tornado: [('Wellhead pressure', 432.0), ('Reservoir pressure', 195.5)]
Three of nine cases will not flow at high wellhead pressure. That is a finding, not a failure — it tells you exactly where this well needs artificial lift.
5. Tornado ranks the drivers. Which input moves the answer most, sorted. In the run above, wellhead pressure swings the rate by 432 STB/day against reservoir pressure's 195 — so choke management matters more than reservoir depletion on this well, right now.
Sensitivity screenshot refresh is pending the Phase 10 browser capture.
The pitch line: "Vary anything, any number of things, see the cost before you run it, and a case that won't flow tells you something instead of breaking."
9. Scenarios — how the data model works¶
Organisation → Field → Well → Scenario
Production data hangs off the WELL. Analyses hang off the SCENARIO.
That one sentence is the whole design. Branch a scenario and you copy the model — the fluid, the inflow, the geometry — while the production history and well tests stay shared.
Verified: 365 days of production, two scenarios, still 365 rows.
Why this matters commercially. PROSPER is one file per well. That single fact causes everything else it cannot do: no case comparison, no bulk operations, no collaboration, no history — and an entire cottage industry of OpenServer-plus-VBA scripts that exist purely to read a directory of
.OUTfiles into a table.
What it gives you:
- A dropdown next to the well name. Not "Save As."
- Compare shows only the inputs that differ — {skin: (2.0, -1.0)} rather than a wall of identical numbers.
- Git-style history — every save recorded with author and message. r3 badge shows the revision.
- An audit log: who changed what, when.
Scenario screenshot refresh is pending the Phase 10 browser capture.
10. Units — the invisible feature¶
Every physical value in MINT carries its unit explicitly. There is no implicit unit system anywhere.
LAYER 3 per-field override because reality is mixed
LAYER 2 display system Field / SI, switchable, no recompute
LAYER 1 canonical store SI. Always. Never store display units.
Why it matters here specifically: West African operators genuinely run mixed units — field units for production, SI for facilities, metric depth from drilling contractors. A tool that forces one system gets rejected in the first demo.
The solver never sees a unit. Conversion happens exactly twice: on input, and on display.
11. Validation — the thing nobody else publishes¶
MINT ships a public validation report. Every correlation, its status, and the evidence.
| Level | Meaning | Count |
|---|---|---|
| 🟢 VALIDATED | Reproduces a published worked example | 7 |
| 🔵 DIAGNOSED | Deviates, and the cause is isolated with evidence | 1 |
| 🟡 BEHAVIOUR | Physically correct, no published reference checked yet | 48 |
Highlights: - Vogel IPR — qmax 978 stb/day exact, all 7 published curve points - Fetkovich — all 7 points, AOF 900 exact, and the multi-rate fitter recovers the published C and n from raw test data - Poettmann-Carpenter — BHP 1701 vs 1699 psia (0.1%), and 14 of 14 printed intermediates within 2%
And what we do not claim: ±15% on multiphase pressure drop is state of the art. Published studies put single-correlation error between 12.7% and 57.5% depending on the fluid. Anyone claiming better across a broad dataset is overfitting. Saying this openly builds credibility rather than costing it.
No number in MINT was ever tuned against PROSPER or whitson output. Validation is against published worked examples and field data only.
12. How to pitch it¶
Lead with this: "It matches your well, and it shows you its working."
Three proof points, in order:
- Load their well test data and match it. Residuals under 5%, on screen, in front of them. Nothing else in the pitch matters as much.
- Show the skin decomposition. "Your problem isn't damage, it's that you only perforated half the interval — and your deviation is already giving you 3 skin units back." That is a conversation no calculator can have.
- Show the correlation spread. "Five correlations agree within 16% here. Petrosky-Farshad is 2.5× out because it was fitted to Gulf of Mexico crude, and we tell you that instead of hiding it."
If they ask about PROSPER: we export to it. We are not asking them to throw anything away.
If they ask how many correlations: the honest answer is 7 VLP and 14 IPR today, growing. Then move straight back to "but the question is whether it matches your well — shall we try yours?"
13. What is not built yet¶
Being straight about this is part of the pitch, not a weakness in it.
| Status | |
|---|---|
| Artificial lift — gas lift, ESP | 🔴 in progress (Sowah) |
| Flow assurance — erosion, liquid loading | 🔴 in progress (Sowah) |
| Report builder / PDF | 🔴 next |
| Desktop installer | 🔴 after the report builder |
| Equation of State (condensate) | 🔴 deferred — black oil is complete |
| AI layer | 🔴 after the API stabilises |
| Surface network | ❌ separate product |
| Transient multiphase | ❌ permanently out of scope |
14. Reference¶
| Doc | Covers |
|---|---|
PROGRESS.md |
Internal live status, updated every session |
| Validation | Every correlation and its evidence |
docs/BUILD-BIBLE.md |
Internal full build plan |
docs/12-DECISIONS.md |
Internal decisions and rationale |