{
  "schemaVersion": 1,
  "slug": "pool-volume-calculator",
  "category": "household",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "21158e86a3c2c525eaa867c4f91f5f80f6213573162778b32e242fa78436682c",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/pool-volume-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": "V = L × W × d × k; d = (d_s + d_p) ÷ 2; gal = V × 7.48052",
    "vars": [
      [
        "V",
        "Volume (ft³)"
      ],
      [
        "L",
        "Length (ft)"
      ],
      [
        "W",
        "Width (ft)"
      ],
      [
        "d",
        "Average depth (ft)"
      ],
      [
        "k",
        "Shape factor"
      ],
      [
        "d_s, d_p",
        "Shallow-end and deep-end depths (ft)"
      ]
    ],
    "note": "Uses selected shape and average depth; kidney pools use a 0.72 approximation. Turnover hours = estimated gallons / entered pump flow (gallons per minute) / 60. The pump flow is user-supplied and actual pool contours vary."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "Pentair — Salt chlorinator manual and operating salt range",
        "url": "https://www.pentair.com/en-us/products/residential/pool-spa-equipment/pool-water-treatment/intellichlor.html"
      }
    ],
    "referenceRole": "input",
    "implementationHash": "21158e86a3c2c525eaa867c4f91f5f80f6213573162778b32e242fa78436682c",
    "basis": "V = L × W × d × k; d = (d_s + d_p) ÷ 2; gal = V × 7.48052",
    "limitations": "Use the cited guidance and your own measurements, bills or product specifications to choose inputs. Sample defaults are not current local data."
  },
  "contract": {
    "compute": "if(deep<=shallow)return{avgDepth:null,volumeCuFt:null,gallons:null,litres:null,turnoverHours:null,__error:'inputError'};const avgDepth=(shallow+deep)/2;let cu;if(shape==='round')cu=Math.PI*Math.pow(length/2,2)*avgDepth;else if(shape==='oval')cu=Math.PI*(length/2)*(width/2)*avgDepth;else if(shape==='kidney')cu=length*width*avgDepth*0.72;else cu=length*width*avgDepth;const gallons=cu*7.48052;return{avgDepth,volumeCuFt:cu,gallons,litres:gallons*3.785411784,turnoverHours:gallons/pumpFlowGpm/60};",
    "inputs": [
      {
        "name": "shape",
        "type": "select",
        "default": "rectangle",
        "options": [
          {
            "value": "rectangle"
          },
          {
            "value": "round"
          },
          {
            "value": "oval"
          },
          {
            "value": "kidney"
          }
        ]
      },
      {
        "name": "length",
        "type": "number",
        "default": 30,
        "min": 1,
        "max": 300,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "width",
        "type": "number",
        "default": 15,
        "min": 1,
        "max": 300,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "shallow",
        "type": "number",
        "default": 3,
        "min": 0.5,
        "max": 12,
        "step": 0.1,
        "slider": true
      },
      {
        "name": "deep",
        "type": "number",
        "default": 6,
        "min": 0.5,
        "max": 20,
        "step": 0.1,
        "slider": true
      },
      {
        "name": "pumpFlowGpm",
        "type": "number",
        "default": 85,
        "min": 1,
        "max": 1000,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "gallons",
        "precision": 0,
        "unit": "gal"
      },
      {
        "name": "litres",
        "precision": 0,
        "unit": "L"
      },
      {
        "name": "avgDepth",
        "precision": 2,
        "unit": "ft"
      },
      {
        "name": "volumeCuFt",
        "precision": 0,
        "unit": "cu ft"
      },
      {
        "name": "turnoverHours",
        "precision": 1,
        "unit": "h"
      }
    ],
    "interpret": null
  }
}
