{
  "capability_id": "physics.fluid.hydraulic_diameter",
  "tool_id": "hydraulic-diameter",
  "engine": "hydraulic-diameter",
  "calculation_version": "1.0.0",
  "generated_at": "2026-09-17T06:35:12.145Z",
  "engine_build": "2026-09-17",
  "test_count": 15,
  "passed": 15,
  "failed": 0,
  "tests_summary": {
    "golden": {
      "total": 2,
      "passed": 2
    },
    "boundary": {
      "total": 8,
      "passed": 8
    },
    "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/hydraulic-diameter",
  "api": "https://www.calculatorx.com/api/v1/calc/hydraulic-diameter",
  "schema_input": "https://www.calculatorx.com/schemas/physics.fluid.hydraulic_diameter.input.json",
  "schema_output": "https://www.calculatorx.com/schemas/physics.fluid.hydraulic_diameter.output.json",
  "assumptions": [
    "D_h = 4 A / P_w; R = A / P_w = D_h / 4",
    "Full circular pipe: D_h = D; closed rectangular duct: D_h = 2ab/(a+b); annulus: D_h = D_o − D_i",
    "Not Q=Av, not Manning Q, not Reynolds, not Darcy, not a weir or orifice"
  ],
  "limitations": [
    "D_h = 4 A / P_w; R = A / P_w = D_h / 4",
    "Full circular pipe: D_h = D; closed rectangular duct: D_h = 2ab/(a+b); annulus: D_h = D_o − D_i",
    "Not Q=Av, not Manning Q, not Reynolds, not Darcy, not a weir or orifice"
  ],
  "boundary_conditions": [
    "missing A+Pw, R, circular D, rectangular a+b, or annular D_o+D_i → MISSING_REQUIRED_INPUT",
    "A, Pw, R, D, a, b, D_o, or D_i ≤ 0 → VALUE_MUST_BE_POSITIVE",
    "annulus D_i ≥ D_o → VALUE_OUT_OF_RANGE",
    "A+Pw+R, R+Dh, Q, v, n, f, C_d, or NPSH/pump fields → MIXED_INPUT_ENCODING",
    "manning, flow, reynolds, darcy, weir, orifice, pump, or NPSH as mode → INVALID_MODE"
  ],
  "sources": [
    {
      "title": "ISO 5167-1 — Measurement of fluid flow by means of pressure differential devices",
      "section": "Hydraulic diameter",
      "url": "https://www.iso.org/standard/17583.html",
      "supports": "D_h = 4A/P for non-circular conduits; annulus D_h = D_o − D_i",
      "kind": "standard"
    },
    {
      "title": "White, F.M. Fluid Mechanics",
      "section": "Noncircular ducts",
      "supports": "Equivalent diameter D_h=4A/P; rectangular duct 2ab/(a+b)",
      "kind": "reference"
    }
  ],
  "methods": [],
  "fingerprint": "sha256:7c0b6abb3feaef1d4ca77ef75fa3894e04cac58583096ad5793abb903ee8d253",
  "tests": [
    {
      "id": "golden-dh-section",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "A": 0.01,
        "Pw": 0.4
      },
      "expect": {
        "Dh": 0.1,
        "R": 0.025,
        "A": 0.01,
        "Pw": 0.4,
        "mode": "general",
        "model": "hydraulic_diameter"
      },
      "expectWarning": null,
      "actual": {
        "mode": "general",
        "Dh": 0.09999999999999999,
        "R": 0.024999999999999998,
        "A": 0.01,
        "Pw": 0.4,
        "model": "hydraulic_diameter"
      },
      "tol": 1e-12
    },
    {
      "id": "golden-dh-circular",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "circular",
        "D": 0.1
      },
      "expect": {
        "Dh": 0.1,
        "D": 0.1,
        "model": "hydraulic_diameter"
      },
      "expectWarning": null,
      "actual": {
        "mode": "circular",
        "Dh": 0.1,
        "R": 0.025,
        "A": 0.007853981633974483,
        "Pw": 0.3141592653589793,
        "model": "hydraulic_diameter",
        "D": 0.1
      },
      "tol": 1e-12
    },
    {
      "id": "boundary-dh-rect",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "rectangular",
        "a": 0.2,
        "b": 0.1
      },
      "expect": {
        "Dh": 0.13333333333333333,
        "a": 0.2,
        "b": 0.1,
        "model": "hydraulic_diameter"
      },
      "expectWarning": null,
      "actual": {
        "mode": "rectangular",
        "Dh": 0.13333333333333333,
        "R": 0.03333333333333333,
        "A": 0.020000000000000004,
        "Pw": 0.6000000000000001,
        "model": "hydraulic_diameter",
        "a": 0.2,
        "b": 0.1
      },
      "tol": 1e-12
    },
    {
      "id": "boundary-dh-annulus",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "annular",
        "D_o": 0.1,
        "D_i": 0.06
      },
      "expect": {
        "Dh": 0.04,
        "model": "hydraulic_diameter"
      },
      "expectWarning": null,
      "actual": {
        "mode": "annular",
        "Dh": 0.04000000000000001,
        "R": 0.010000000000000002,
        "A": 0.005026548245743671,
        "Pw": 0.5026548245743669,
        "model": "hydraulic_diameter",
        "D_o": 0.1,
        "D_i": 0.06
      },
      "tol": 1e-12
    },
    {
      "id": "boundary-dh-from-r",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "R": 0.025
      },
      "expect": {
        "Dh": 0.1,
        "R": 0.025,
        "model": "hydraulic_diameter"
      },
      "expectWarning": null,
      "actual": {
        "mode": "general",
        "Dh": 0.1,
        "R": 0.025,
        "model": "hydraulic_diameter"
      },
      "tol": 1e-12
    },
    {
      "id": "boundary-dh-missing",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "A": 0.01
      },
      "expectError": "MISSING_REQUIRED_INPUT",
      "code": "MISSING_REQUIRED_INPUT",
      "error": "Need A and Pw, or R, or A and Dh, or Pw and Dh"
    },
    {
      "id": "boundary-dh-a0",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "A": 0,
        "Pw": 0.4
      },
      "expectError": "VALUE_MUST_BE_POSITIVE",
      "code": "VALUE_MUST_BE_POSITIVE",
      "error": "A must be greater than zero"
    },
    {
      "id": "boundary-dh-mixed",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "A": 0.01,
        "Pw": 0.4,
        "R": 0.025
      },
      "expectError": "MIXED_INPUT_ENCODING",
      "code": "MIXED_INPUT_ENCODING",
      "error": "Give A+Pw, A+Dh, Pw+Dh, or R — not three encodings"
    },
    {
      "id": "boundary-dh-q",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "A": 0.01,
        "Pw": 0.4,
        "Q": 0.02
      },
      "expectError": "MIXED_INPUT_ENCODING",
      "code": "MIXED_INPUT_ENCODING",
      "error": "Hydraulic diameter does not take Q. That is Q=Av or Manning"
    },
    {
      "id": "boundary-dh-manning",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "A": 0.01,
        "Pw": 0.4,
        "mode": "manning"
      },
      "expectError": "INVALID_MODE",
      "code": "INVALID_MODE",
      "error": "mode must be general|circular|rectangular|annular. Not Q=Av, Manning, Reynolds, Darcy, weir, orifice, pump, or NPSH"
    },
    {
      "id": "property-dh-4ap",
      "ok": true,
      "kind": "property",
      "detail": "4A/P=0.1",
      "expect": 0.1,
      "actual": 0.09999999999999999
    },
    {
      "id": "property-dh-r",
      "ok": true,
      "kind": "property",
      "detail": "R=A/P",
      "expect": 0.025,
      "actual": 0.024999999999999998
    },
    {
      "id": "property-dh-circ",
      "ok": true,
      "kind": "property",
      "detail": "D_h=D",
      "expect": 0.1,
      "actual": 0.1
    },
    {
      "id": "property-dh-rect",
      "ok": true,
      "kind": "property",
      "detail": "2ab/(a+b)",
      "expect": 0.13333333333333333,
      "actual": 0.13333333333333333
    },
    {
      "id": "property-dh-from-r",
      "ok": true,
      "kind": "property",
      "detail": "D_h=4R",
      "expect": 0.1,
      "actual": 0.1
    }
  ],
  "tier": "engine_tested",
  "verification": {
    "tests": {
      "passed": 15,
      "total": 15,
      "golden": 2,
      "boundary": 8,
      "property": 5
    },
    "contract_checks": {
      "passed": 3,
      "total": 3
    }
  },
  "evidence_core_generated_at": "2026-09-17T04:08:59.124Z",
  "rendered_at": "2026-09-17T06:35:12.145Z",
  "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": "0f4da45d859137348ae4dff97662c30d93b356e4bdd6d15d787a1c905890b09c",
      "output_schema_sha256": "b9a5981e47461877ddac5c3cefe15429a50a835dbd1129ba4016a511616ede31",
      "evidence_sha256": "d46a88d39fd1bba0adae32a5e30c033b9177b8670f6f49d84412db693951a7e1",
      "evidence_core_sha256": "d46a88d39fd1bba0adae32a5e30c033b9177b8670f6f49d84412db693951a7e1",
      "capability_sha256": "da78e66e6f87ec1b666c8dd7110b41023e1c029646d4ac0fcf21e462ffe39e97",
      "engine_sha256": "577dd02827ddc989c9ec83548106b0de2da132cdaad4c2e72f4dc05cde6f3e07",
      "mcp_contract_sha256": "a0951a99ea7017485ae852239b46888380ab942a7571f6a90cc299bd18753be2"
    },
    "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"
  }
}
