{
  "schemaVersion": 1,
  "slug": "flow-rate-calculator",
  "category": "conversion",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "abd22d5d359ca3590002aab8105d74e85712d003aaa2728b33854fb040def095",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/flow-rate-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "Q = x × kf ÷ kt",
    "vars": [
      [
        "x",
        "entered flow value"
      ],
      [
        "kf",
        "source-unit factor to L/min"
      ],
      [
        "kt",
        "target-unit factor to L/min"
      ],
      [
        "Q",
        "converted flow"
      ]
    ],
    "note": "All factors convert to L/min. Uses US gallons: 1 US gal = 3.785411784 L and 1 day = 1,440 min, so 1 gpd = 0.0026287583 L/min. Negative flow inputs are rejected."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-04",
    "sources": [
      {
        "name": "NIST SP 811 — Conversion factors by quantity",
        "url": "https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors/nist-guide-si-appendix-b9"
      }
    ],
    "basis": "Convert volumetric flow via cubic metres per second.",
    "limitations": "Only the displayed unit definitions are converted; rounding and measurement uncertainty are separate.",
    "implementationHash": "abd22d5d359ca3590002aab8105d74e85712d003aaa2728b33854fb040def095",
    "domain": "conversion"
  },
  "contract": {
    "compute": "const units={\"lps\":\"L/s\",\"lpm\":\"L/min\",\"lph\":\"L/h\",\"m3h\":\"m³/h\",\"m3s\":\"m³/s\",\"gpm\":\"US gal/min\",\"gpd\":\"US gal/d\"}, factors={\"lps\":60,\"lpm\":1,\"lph\":0.016666666666666666,\"m3h\":16.666666666666668,\"m3s\":60000,\"gpm\":3.785411784,\"gpd\":0.0026287581833333335}; if(!Number.isFinite(value)||value<0||value>1000000000000||!Object.prototype.hasOwnProperty.call(units,from)||!Object.prototype.hasOwnProperty.call(units,to))return {\"result\":null,\"litresPerMin\":null,\"gpm\":null,\"m3h\":null,\"__error\":\"inputError\"}; const out=(function(){if(value<0)return {result:null,litresPerMin:null,gpm:null,m3h:null,__error:'inputError'}; const F={lps:60,lpm:1,lph:1/60,m3h:16.666666666666668,m3s:60000,gpm:3.785411784,gpd:3.785411784/1440}; const lpm=value*F[from]; return { result: lpm/F[to], litresPerMin: lpm, gpm: lpm/3.785411784, m3h: lpm/16.666666666666668 };})(); if(out.__error)return {...{\"result\":null,\"litresPerMin\":null,\"gpm\":null,\"m3h\":null},...out}; out.__resultUnit=units[to]; out.__unitRatio=factors[to]/factors[from]; return out;",
    "inputs": [
      {
        "name": "value",
        "type": "number",
        "default": 1,
        "min": 0,
        "max": 1000000000000,
        "step": 0.0001,
        "requiredValue": true,
        "strictRange": true
      },
      {
        "name": "from",
        "type": "select",
        "default": "lpm",
        "options": [
          {
            "value": "lpm"
          },
          {
            "value": "lps"
          },
          {
            "value": "lph"
          },
          {
            "value": "m3h"
          },
          {
            "value": "m3s"
          },
          {
            "value": "gpm"
          },
          {
            "value": "gpd"
          }
        ]
      },
      {
        "name": "to",
        "type": "select",
        "default": "gpm",
        "options": [
          {
            "value": "gpm"
          },
          {
            "value": "lps"
          },
          {
            "value": "lpm"
          },
          {
            "value": "lph"
          },
          {
            "value": "m3h"
          },
          {
            "value": "m3s"
          },
          {
            "value": "gpd"
          }
        ]
      },
      {
        "name": "precision",
        "type": "select",
        "default": 4,
        "options": [
          {
            "value": 0
          },
          {
            "value": 2
          },
          {
            "value": 4
          },
          {
            "value": 6
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "result",
        "precision": 4,
        "unit": "",
        "precisionField": "precision",
        "unitField": "__resultUnit",
        "trimTrailingZeros": true,
        "notation": "auto"
      },
      {
        "name": "litresPerMin",
        "precision": 4,
        "unit": "L/min",
        "showWhen": {
          "to": [
            "lps",
            "lph",
            "m3h",
            "m3s",
            "gpm",
            "gpd"
          ]
        },
        "notation": "auto"
      },
      {
        "name": "gpm",
        "precision": 4,
        "unit": "gpm",
        "notation": "auto",
        "showWhen": {
          "to": [
            "lps",
            "lpm",
            "lph",
            "m3h",
            "m3s",
            "gpd"
          ]
        }
      },
      {
        "name": "m3h",
        "precision": 6,
        "unit": "m³/h",
        "showWhen": {
          "to": [
            "lps",
            "lpm",
            "lph",
            "m3s",
            "gpm",
            "gpd"
          ]
        },
        "notation": "auto"
      }
    ],
    "interpret": null
  }
}
