Units¶
MINT stores everything in SI, internally, always. What you see is a display layer on top.
Three layers¶
YOU SEE psia, STB/day, °F ← per-field override
↑
YOUR PREFERENCE Field or Metric ← display system
↑
MINT STORES Pa, m³/s, K ← canonical, never varies
Why it is built this way¶
Unit bugs are the most common and most dangerous class of error in petroleum software, and they are usually invisible: a number that is 3.28× wrong still looks like a plausible number.
Two real examples caught in this codebase by this discipline:
- a survey parser that assumed feet while the API said metres - every metric survey came out 3.28× too shallow, and the trajectory still looked fine
- a pseudo-pressure conversion that divided where it should have multiplied - a factor of 1e6 on every gas rate
Because the core takes SI and returns SI with no exceptions, the conversion happens in exactly one place and is tested in exactly one place.
Switching¶
The units: Field / Metric toggle in the header switches everything at once. Individual fields can be overridden without changing the global setting - useful when your survey is in metres but everything else is in field units.
Provenance travels with the value, so a report always states the unit a number was entered in.