{
  "capability_id": "physics.fluid.sudden_expansion",
  "tool_id": "sudden-expansion",
  "engine": "sudden-expansion",
  "calculation_version": "1.0.0",
  "generated_at": "2026-09-17T12:57:09.949Z",
  "engine_build": "2026-09-17",
  "test_count": 17,
  "passed": 17,
  "failed": 0,
  "tests_summary": {
    "golden": {
      "total": 2,
      "passed": 2
    },
    "boundary": {
      "total": 10,
      "passed": 10
    },
    "property": {
      "total": 5,
      "passed": 5
    }
  },
  "engine_tested": true,
  "expert_reviewed": false,
  "internally_reviewed": false,
  "review_kind": null,
  "source_checked": true,
  "reviewed_by": null,
  "reviewer_role": null,
  "last_reviewed": null,
  "expert_review": {
    "status": "optional_not_performed",
    "reviewer": null,
    "scope": [
      "formula",
      "input semantics",
      "assumptions",
      "limitations",
      "sources",
      "tests"
    ],
    "note": "Domain expert review is optional under CVP (CVP-EXP-01). Absence does not block CVP Verified. See Review policy for supplemental domain assurance."
  },
  "internal_review": {
    "status": "not_applicable",
    "reviewer": null
  },
  "page": "https://www.calculatorx.com/calc/physics/sudden-expansion",
  "api": "https://www.calculatorx.com/api/v1/calc/sudden-expansion",
  "schema_input": "https://www.calculatorx.com/schemas/physics.fluid.sudden_expansion.input.json",
  "schema_output": "https://www.calculatorx.com/schemas/physics.fluid.sudden_expansion.output.json",
  "assumptions": [
    "Borda–Carnot sudden expansion: h = (v1 − v2)² / (2g); K = (1 − v2/v1)² is reported, not an input",
    "Default g=9.80665 m/s²; default ρ=1000 kg/m³ for Δp = ρ (v1−v2)² / 2; incompressible; A2 > A1",
    "Not minor-loss K given, not Darcy f, not orifice C_d, not Q=Av, not sudden contraction"
  ],
  "limitations": [
    "Borda–Carnot sudden expansion: h = (v1 − v2)² / (2g); K = (1 − v2/v1)² is reported, not an input",
    "Default g=9.80665 m/s²; default ρ=1000 kg/m³ for Δp = ρ (v1−v2)² / 2; incompressible; A2 > A1",
    "Not minor-loss K given, not Darcy f, not orifice C_d, not Q=Av, not sudden contraction"
  ],
  "boundary_conditions": [
    "missing v1, v2, h, or A1 when required → MISSING_REQUIRED_INPUT",
    "v1 ≤ 0, h ≤ 0, or A1 ≤ 0 → VALUE_MUST_BE_POSITIVE",
    "v2 ≥ v1 → VALUE_OUT_OF_RANGE",
    "K, f/Re, Q, C_d → MIXED_INPUT_ENCODING",
    "minor, darcy, or orifice as mode → INVALID_MODE"
  ],
  "sources": [
    {
      "title": "ISO 80000-4 — Mechanics",
      "section": "Length, speed, pressure",
      "url": "https://www.iso.org/standard/31895.html",
      "supports": "h is a head; v is a speed; Δp is a pressure",
      "kind": "standard"
    },
    {
      "title": "Borda–Carnot equation",
      "section": "Sudden enlargement",
      "supports": "h=(v1−v2)²/(2g) for incompressible sudden expansion; K=(1−A1/A2)²",
      "kind": "reference"
    }
  ],
  "methods": [],
  "fingerprint": "sha256:ed9626814e473ec68773b087522fb135943bb1420a37dfc0299249f5584764ae",
  "tests": [
    {
      "id": "golden-se-h",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "v1": 2,
        "v2": 1
      },
      "expect": {
        "h": 0.050985810648896415,
        "v1": 2,
        "v2": 1,
        "K": 0.25,
        "dP": 500,
        "mode": "head",
        "model": "borda_carnot"
      },
      "expectWarning": null,
      "actual": {
        "mode": "head",
        "h": 0.050985810648896415,
        "v1": 2,
        "v2": 1,
        "K": 0.25,
        "g": 9.80665,
        "rho": 1000,
        "dP": 500,
        "model": "borda_carnot"
      },
      "tol": 1e-12
    },
    {
      "id": "golden-se-dP",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "pressure",
        "v1": 2,
        "v2": 1
      },
      "expect": {
        "dP": 500,
        "model": "borda_carnot"
      },
      "expectWarning": null,
      "actual": {
        "mode": "pressure",
        "h": 0.050985810648896415,
        "v1": 2,
        "v2": 1,
        "K": 0.25,
        "g": 9.80665,
        "rho": 1000,
        "dP": 500,
        "model": "borda_carnot"
      },
      "tol": 1e-12
    },
    {
      "id": "boundary-se-v2",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "velocity",
        "v1": 2,
        "h": 0.050985810648896415
      },
      "expect": {
        "v2": 1,
        "model": "borda_carnot"
      },
      "expectWarning": null,
      "actual": {
        "mode": "velocity",
        "h": 0.050985810648896415,
        "v1": 2,
        "v2": 1,
        "K": 0.25,
        "g": 9.80665,
        "rho": 1000,
        "dP": 500,
        "model": "borda_carnot"
      },
      "tol": 1e-12
    },
    {
      "id": "boundary-se-missing",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "v1": 2
      },
      "expectError": "MISSING_REQUIRED_INPUT",
      "code": "MISSING_REQUIRED_INPUT",
      "error": "v2 is required"
    },
    {
      "id": "boundary-se-K",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "v1": 2,
        "v2": 1,
        "K": 0.25
      },
      "expectError": "MIXED_INPUT_ENCODING",
      "code": "MIXED_INPUT_ENCODING",
      "error": "Sudden expansion does not take minor-loss K. That is /calc/physics/minor-loss. K=(1−v2/v1)² is reported"
    },
    {
      "id": "boundary-se-f",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "v1": 2,
        "v2": 1,
        "f": 0.02
      },
      "expectError": "MIXED_INPUT_ENCODING",
      "code": "MIXED_INPUT_ENCODING",
      "error": "Sudden expansion does not take Darcy f, L, D, or Colebrook Re/ε. That is /calc/physics/darcy-weisbach"
    },
    {
      "id": "boundary-se-Q",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "v1": 2,
        "v2": 1,
        "Q": 1
      },
      "expectError": "MIXED_INPUT_ENCODING",
      "code": "MIXED_INPUT_ENCODING",
      "error": "Sudden expansion does not take Q or A. That is /calc/physics/flow-rate. Give v1 and v2, or A1 on the A2 tab"
    },
    {
      "id": "boundary-se-Cd",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "v1": 2,
        "v2": 1,
        "Cd": 0.61
      },
      "expectError": "MIXED_INPUT_ENCODING",
      "code": "MIXED_INPUT_ENCODING",
      "error": "Sudden expansion does not take orifice C_d or venturi D1/D2"
    },
    {
      "id": "boundary-se-mode",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "v1": 2,
        "v2": 1,
        "mode": "minor"
      },
      "expectError": "INVALID_MODE",
      "code": "INVALID_MODE",
      "error": "mode must be head|pressure|velocity|area. Not minor-loss, Darcy, orifice, or Q=Av"
    },
    {
      "id": "boundary-se-zero",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "v1": 0,
        "v2": 1
      },
      "expectError": "VALUE_MUST_BE_POSITIVE",
      "code": "VALUE_MUST_BE_POSITIVE",
      "error": "v1 must be greater than zero"
    },
    {
      "id": "boundary-se-contract",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "v1": 1,
        "v2": 2
      },
      "expectError": "VALUE_OUT_OF_RANGE",
      "code": "VALUE_OUT_OF_RANGE",
      "error": "Sudden expansion needs v1 > v2. Contraction is not this page"
    },
    {
      "id": "boundary-se-A2",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "area",
        "A1": 1,
        "v1": 2,
        "h": 0.050985810648896415
      },
      "expect": {
        "A2": 2,
        "model": "borda_carnot"
      },
      "expectWarning": null,
      "actual": {
        "mode": "area",
        "h": 0.050985810648896415,
        "v1": 2,
        "v2": 1,
        "K": 0.25,
        "g": 9.80665,
        "rho": 1000,
        "dP": 500,
        "model": "borda_carnot",
        "A1": 1,
        "A2": 2
      },
      "tol": 1e-12
    },
    {
      "id": "property-se-h",
      "ok": true,
      "kind": "property",
      "detail": "h=(v1−v2)²/(2g)",
      "expect": 0.050985810648896415,
      "actual": 0.050985810648896415
    },
    {
      "id": "property-se-K",
      "ok": true,
      "kind": "property",
      "detail": "K=0.25",
      "expect": 0.25,
      "actual": 0.25
    },
    {
      "id": "property-se-roundtrip-v2",
      "ok": true,
      "kind": "property",
      "detail": "v2 invert",
      "expect": 1,
      "actual": 1
    },
    {
      "id": "property-se-dP",
      "ok": true,
      "kind": "property",
      "detail": "Δp=500",
      "expect": 500,
      "actual": 500
    },
    {
      "id": "property-se-model",
      "ok": true,
      "kind": "property",
      "detail": "borda_carnot",
      "expect": true,
      "actual": "borda_carnot"
    }
  ],
  "tier": "engine_tested",
  "verification": {
    "tests": {
      "passed": 17,
      "total": 17,
      "golden": 2,
      "boundary": 10,
      "property": 5
    },
    "contract_checks": {
      "passed": 3,
      "total": 3
    }
  },
  "evidence_core_generated_at": "2026-09-17T10:27:24.934Z",
  "rendered_at": "2026-09-17T12:57:09.949Z",
  "release_integrity": {
    "status": "verified",
    "scope": "workspace",
    "production_attestation_required": true,
    "calculation_version": "1.0.0",
    "artifacts": {
      "engine": "1.0.0",
      "page": "1.0.0",
      "capability": "1.0.0",
      "evidence": "1.0.0",
      "input_schema": "1.0.0",
      "output_schema": "1.0.0",
      "mcp_contract": "1.0.0"
    },
    "digests": {
      "input_schema_sha256": "6b4add58c2c638c72023661506e208ca320a2665b10653cfa4bef0ef7649e818",
      "output_schema_sha256": "2b412c3601a14f099631871122ccefdfbe139c14612db66c6edae1af4d8dbe07",
      "evidence_sha256": "8bd3dbdbb0a41ff936daa3e2a3301b4f783ac54f34986f201cceef9575efed40",
      "evidence_core_sha256": "8bd3dbdbb0a41ff936daa3e2a3301b4f783ac54f34986f201cceef9575efed40",
      "capability_sha256": "a77b19037301136adadb457b67df110a43cc50ab319c2ac3eecc00fb2193310b",
      "engine_sha256": "3a274e9526e8ef09a42dd9a5a2173db0d5ed2458a9b92192df103930b4e43523",
      "mcp_contract_sha256": "c77a372e41c0e20baf484d40ec69bc5e915f0921b6c896f8723c29434c676171"
    },
    "contract_checks": {
      "total": 3,
      "passed": 3,
      "failed": 0,
      "items": [
        {
          "id": "release-artifacts-aligned",
          "status": "pass",
          "detail": "1.0.0"
        },
        {
          "id": "schema-valid-input-executes",
          "status": "pass"
        },
        {
          "id": "engine-success-output-validates-schema",
          "status": "pass"
        }
      ]
    },
    "report": "https://www.calculatorx.com/.well-known/calculatorx-release-integrity.json"
  }
}
