{
  "capability_id": "physics.fluid.sudden_contraction",
  "tool_id": "sudden-contraction",
  "engine": "sudden-contraction",
  "calculation_version": "1.0.0",
  "generated_at": "2026-09-17T12:57:09.949Z",
  "engine_build": "2026-09-17",
  "test_count": 18,
  "passed": 18,
  "failed": 0,
  "tests_summary": {
    "golden": {
      "total": 2,
      "passed": 2
    },
    "boundary": {
      "total": 11,
      "passed": 11
    },
    "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-contraction",
  "api": "https://www.calculatorx.com/api/v1/calc/sudden-contraction",
  "schema_input": "https://www.calculatorx.com/schemas/physics.fluid.sudden_contraction.input.json",
  "schema_output": "https://www.calculatorx.com/schemas/physics.fluid.sudden_contraction.output.json",
  "assumptions": [
    "Vena-contracta sudden contraction: h = (1/C_c − 1)² v2² / (2g); default C_c=0.62; K = (1/C_c − 1)² is reported, not an input",
    "Default g=9.80665 m/s²; default ρ=1000 kg/m³ for Δp = ρ K v2² / 2; incompressible; C_c in (0, 1)",
    "Not sudden expansion (v1−v2)², not minor-loss K given, not Darcy f, not orifice C_d, not Q=Av"
  ],
  "limitations": [
    "Vena-contracta sudden contraction: h = (1/C_c − 1)² v2² / (2g); default C_c=0.62; K is reported, not an input",
    "Default g=9.80665 m/s²; default ρ=1000 kg/m³ for Δp = ρ K v2² / 2; incompressible; C_c in (0, 1)",
    "Not sudden expansion (v1−v2)², not minor-loss K given, not Darcy f, not orifice C_d, not Q=Av"
  ],
  "boundary_conditions": [
    "missing v2, h, or C_c when required → MISSING_REQUIRED_INPUT",
    "v2 ≤ 0 or h ≤ 0 → VALUE_MUST_BE_POSITIVE",
    "C_c ≥ 1 → VALUE_OUT_OF_RANGE",
    "v1, K, f/Re, Q, C_d → MIXED_INPUT_ENCODING",
    "expansion, 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 contraction / vena contracta",
      "supports": "Loss from vena contracta to A2 is (v_c−v2)²/(2g) with v_c=v2/C_c; typical sharp-edged C_c≈0.62",
      "kind": "reference"
    }
  ],
  "methods": [],
  "fingerprint": "sha256:be3251cbdbad0ee793c810ba3b46f0a5481055b160e746c811ba2bd0cd0bbce3",
  "tests": [
    {
      "id": "golden-sc-h",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "v2": 1
      },
      "expect": {
        "h": 0.019152838339491794,
        "v2": 1,
        "C_c": 0.62,
        "K": 0.37565036420395437,
        "v_c": 1.6129032258064517,
        "dP": 187.8251821019772,
        "mode": "head",
        "model": "vena_contracta"
      },
      "expectWarning": null,
      "actual": {
        "mode": "head",
        "h": 0.019152838339491794,
        "v2": 1,
        "C_c": 0.62,
        "K": 0.37565036420395437,
        "v_c": 1.6129032258064517,
        "g": 9.80665,
        "rho": 1000,
        "dP": 187.8251821019772,
        "model": "vena_contracta"
      },
      "tol": 1e-12
    },
    {
      "id": "golden-sc-dP",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "pressure",
        "v2": 1,
        "C_c": 0.62
      },
      "expect": {
        "dP": 187.8251821019772,
        "model": "vena_contracta"
      },
      "expectWarning": null,
      "actual": {
        "mode": "pressure",
        "h": 0.019152838339491794,
        "v2": 1,
        "C_c": 0.62,
        "K": 0.37565036420395437,
        "v_c": 1.6129032258064517,
        "g": 9.80665,
        "rho": 1000,
        "dP": 187.8251821019772,
        "model": "vena_contracta"
      },
      "tol": 1e-12
    },
    {
      "id": "boundary-sc-v2",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "velocity",
        "C_c": 0.62,
        "h": 0.019152838339491794
      },
      "expect": {
        "v2": 1,
        "model": "vena_contracta"
      },
      "expectWarning": null,
      "actual": {
        "mode": "velocity",
        "h": 0.019152838339491794,
        "v2": 1.0000000000000002,
        "C_c": 0.62,
        "K": 0.37565036420395437,
        "v_c": 1.612903225806452,
        "g": 9.80665,
        "rho": 1000,
        "dP": 187.82518210197725,
        "model": "vena_contracta"
      },
      "tol": 1e-12
    },
    {
      "id": "boundary-sc-Cc",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "coefficient",
        "v2": 1,
        "h": 0.019152838339491794
      },
      "expect": {
        "C_c": 0.62,
        "model": "vena_contracta"
      },
      "expectWarning": null,
      "actual": {
        "mode": "coefficient",
        "h": 0.019152838339491794,
        "v2": 1,
        "C_c": 0.62,
        "K": 0.37565036420395437,
        "v_c": 1.6129032258064517,
        "g": 9.80665,
        "rho": 1000,
        "dP": 187.8251821019772,
        "model": "vena_contracta"
      },
      "tol": 1e-12
    },
    {
      "id": "boundary-sc-missing",
      "ok": true,
      "kind": "boundary",
      "inputs": {},
      "expectError": "MISSING_REQUIRED_INPUT",
      "code": "MISSING_REQUIRED_INPUT",
      "error": "v2 is required"
    },
    {
      "id": "boundary-sc-K",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "v2": 1,
        "K": 0.25
      },
      "expectError": "MIXED_INPUT_ENCODING",
      "code": "MIXED_INPUT_ENCODING",
      "error": "Sudden contraction does not take minor-loss K. That is /calc/physics/minor-loss. K=(1/C_c−1)² is reported"
    },
    {
      "id": "boundary-sc-v1",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "v2": 1,
        "v1": 2
      },
      "expectError": "MIXED_INPUT_ENCODING",
      "code": "MIXED_INPUT_ENCODING",
      "error": "Sudden contraction does not take v1. Borda–Carnot (v1−v2)² is /calc/physics/sudden-expansion"
    },
    {
      "id": "boundary-sc-Cd",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "v2": 1,
        "Cd": 0.61
      },
      "expectError": "MIXED_INPUT_ENCODING",
      "code": "MIXED_INPUT_ENCODING",
      "error": "Sudden contraction does not take orifice C_d or venturi D1/D2. C_c is the vena-contracta coefficient"
    },
    {
      "id": "boundary-sc-Q",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "v2": 1,
        "Q": 1
      },
      "expectError": "MIXED_INPUT_ENCODING",
      "code": "MIXED_INPUT_ENCODING",
      "error": "Sudden contraction does not take Q or A. That is /calc/physics/flow-rate. Give v2 and C_c"
    },
    {
      "id": "boundary-sc-f",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "v2": 1,
        "f": 0.02
      },
      "expectError": "MIXED_INPUT_ENCODING",
      "code": "MIXED_INPUT_ENCODING",
      "error": "Sudden contraction does not take Darcy f, L, D, or Colebrook Re/ε. That is /calc/physics/darcy-weisbach"
    },
    {
      "id": "boundary-sc-mode",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "v2": 1,
        "mode": "expansion"
      },
      "expectError": "INVALID_MODE",
      "code": "INVALID_MODE",
      "error": "mode must be head|pressure|velocity|coefficient. Not expansion, minor-loss, Darcy, orifice, or Q=Av"
    },
    {
      "id": "boundary-sc-zero",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "v2": 0
      },
      "expectError": "VALUE_MUST_BE_POSITIVE",
      "code": "VALUE_MUST_BE_POSITIVE",
      "error": "v2 must be greater than zero"
    },
    {
      "id": "boundary-sc-Cc1",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "v2": 1,
        "C_c": 1
      },
      "expectError": "VALUE_OUT_OF_RANGE",
      "code": "VALUE_OUT_OF_RANGE",
      "error": "C_c must be < 1 (vena contracta is smaller than A2)"
    },
    {
      "id": "property-sc-h",
      "ok": true,
      "kind": "property",
      "detail": "h=(1/C_c−1)² v2²/(2g)",
      "expect": 0.019152838339491794,
      "actual": 0.019152838339491794
    },
    {
      "id": "property-sc-K",
      "ok": true,
      "kind": "property",
      "detail": "K=(1/C_c−1)²",
      "expect": 0.37565036420395437,
      "actual": 0.37565036420395437
    },
    {
      "id": "property-sc-roundtrip-v2",
      "ok": true,
      "kind": "property",
      "detail": "v2 invert",
      "expect": 1,
      "actual": 1.0000000000000002
    },
    {
      "id": "property-sc-roundtrip-Cc",
      "ok": true,
      "kind": "property",
      "detail": "C_c invert",
      "expect": 0.62,
      "actual": 0.62
    },
    {
      "id": "property-sc-model",
      "ok": true,
      "kind": "property",
      "detail": "vena_contracta",
      "expect": true,
      "actual": "vena_contracta"
    }
  ],
  "tier": "engine_tested",
  "verification": {
    "tests": {
      "passed": 18,
      "total": 18,
      "golden": 2,
      "boundary": 11,
      "property": 5
    },
    "contract_checks": {
      "passed": 3,
      "total": 3
    }
  },
  "evidence_core_generated_at": "2026-09-17T10:42:29.836Z",
  "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": "c8e7d066fe9ad79411d7dd0eb1797f4712db8dfefacf2a586d0c84982fa4bab3",
      "output_schema_sha256": "b382e01ba9f7fd69ef970411279d86fce3fd94cb0e0d2a5999ca66d743cb1f7b",
      "evidence_sha256": "39dd047c8367f3b7b4fef55f87be9221a1ac073fee4a991bbb6fc788115294bf",
      "evidence_core_sha256": "39dd047c8367f3b7b4fef55f87be9221a1ac073fee4a991bbb6fc788115294bf",
      "capability_sha256": "1097ea57171d4c0cc986982f954a36d1471ba2a1da747d9a767bf545b7a279a1",
      "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"
  }
}
