{
  "capability_id": "physics.fluid.critical_depth",
  "tool_id": "critical-depth",
  "engine": "critical-depth",
  "calculation_version": "1.0.0",
  "generated_at": "2026-09-17T08:49:50.941Z",
  "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/critical-depth",
  "api": "https://www.calculatorx.com/api/v1/calc/critical-depth",
  "schema_input": "https://www.calculatorx.com/schemas/physics.fluid.critical_depth.input.json",
  "schema_output": "https://www.calculatorx.com/schemas/physics.fluid.critical_depth.output.json",
  "assumptions": [
    "Rectangular critical depth: yc = (q²/g)^{1/3}; q = Q/b; default g=9.80665 m/s²",
    "Critical speed vc = √(g yc) is reported, not an input; Fr=1 is the definition, not a Froude wrap",
    "Not a Froude wrap, not specific energy E, not a hydraulic jump, not Manning, not Q=Av"
  ],
  "limitations": [
    "Rectangular critical depth: yc = (q²/g)^{1/3}; q = Q/b; default g=9.80665 m/s²",
    "Critical speed vc = √(g yc) is reported, not an input; Fr=1 is the definition, not a Froude wrap",
    "Not a Froude wrap, not specific energy E, not a hydraulic jump, not Manning, not Q=Av"
  ],
  "boundary_conditions": [
    "missing q or yc when required → MISSING_REQUIRED_INPUT",
    "q, yc, Q, b, or g ≤ 0 → VALUE_MUST_BE_POSITIVE",
    "Fr/L, E/y, y1/y2, n, A, v → MIXED_INPUT_ENCODING",
    "froude, energy, or jump as mode → INVALID_MODE"
  ],
  "sources": [
    {
      "title": "ISO 80000-4 — Mechanics",
      "section": "Length, speed, acceleration",
      "supports": "yc is a length; q is discharge per width; g is acceleration",
      "kind": "standard"
    },
    {
      "title": "Chow, V.T. Open-Channel Hydraulics",
      "section": "Critical flow",
      "supports": "yc = (q²/g)^{1/3} for a rectangular channel at Fr=1",
      "kind": "reference"
    }
  ],
  "methods": [],
  "fingerprint": "sha256:649c7fa8bd29869eca9c3e854991a768943aa7b9146bc63b206422d3ee53e7e1",
  "tests": [
    {
      "id": "golden-cd-yc",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "q": 1
      },
      "expect": {
        "yc": 0.46718953723930495,
        "q": 1,
        "mode": "depth",
        "model": "critical_depth"
      },
      "expectWarning": null,
      "actual": {
        "mode": "depth",
        "yc": 0.46718953723930495,
        "q": 1,
        "g": 9.80665,
        "vc": 2.140458893641228,
        "model": "critical_depth"
      },
      "tol": 1e-12
    },
    {
      "id": "golden-cd-q",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "unit_discharge",
        "yc": 0.46718953723930495
      },
      "expect": {
        "q": 1,
        "model": "critical_depth"
      },
      "expectWarning": null,
      "actual": {
        "mode": "unit_discharge",
        "yc": 0.46718953723930495,
        "q": 0.9999999999999999,
        "g": 9.80665,
        "vc": 2.140458893641228,
        "model": "critical_depth"
      },
      "tol": 1e-12
    },
    {
      "id": "boundary-cd-Qb",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "Q": 2,
        "b": 2
      },
      "expect": {
        "yc": 0.46718953723930495,
        "q": 1,
        "model": "critical_depth"
      },
      "expectWarning": null,
      "actual": {
        "mode": "depth",
        "yc": 0.46718953723930495,
        "q": 1,
        "g": 9.80665,
        "vc": 2.140458893641228,
        "model": "critical_depth",
        "Q": 2,
        "b": 2
      },
      "tol": 1e-12
    },
    {
      "id": "boundary-cd-missing",
      "ok": true,
      "kind": "boundary",
      "inputs": {},
      "expectError": "MISSING_REQUIRED_INPUT",
      "code": "MISSING_REQUIRED_INPUT",
      "error": "q or Q and b is required"
    },
    {
      "id": "boundary-cd-Fr",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "q": 1,
        "Fr": 1
      },
      "expectError": "MIXED_INPUT_ENCODING",
      "code": "MIXED_INPUT_ENCODING",
      "error": "Critical depth does not take Froude Fr or L. That is /calc/physics/froude-number"
    },
    {
      "id": "boundary-cd-E",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "q": 1,
        "E": 1.2
      },
      "expectError": "MIXED_INPUT_ENCODING",
      "code": "MIXED_INPUT_ENCODING",
      "error": "Critical depth is not specific energy. Use yc, not E or y. That is /calc/physics/specific-energy"
    },
    {
      "id": "boundary-cd-y1",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "q": 1,
        "y1": 1
      },
      "expectError": "MIXED_INPUT_ENCODING",
      "code": "MIXED_INPUT_ENCODING",
      "error": "Critical depth is not a hydraulic jump. That is /calc/physics/hydraulic-jump"
    },
    {
      "id": "boundary-cd-n",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "q": 1,
        "n": 0.013
      },
      "expectError": "MIXED_INPUT_ENCODING",
      "code": "MIXED_INPUT_ENCODING",
      "error": "Critical depth does not take Manning n or Chezy C/R/S"
    },
    {
      "id": "boundary-cd-A",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "q": 1,
        "A": 1
      },
      "expectError": "MIXED_INPUT_ENCODING",
      "code": "MIXED_INPUT_ENCODING",
      "error": "Critical depth does not take Q=Av area A. Use q or Q+b"
    },
    {
      "id": "boundary-cd-v",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "q": 1,
        "v": 2
      },
      "expectError": "MIXED_INPUT_ENCODING",
      "code": "MIXED_INPUT_ENCODING",
      "error": "Critical depth reports vc. Do not send v. That is /calc/physics/froude-number or /calc/physics/specific-energy"
    },
    {
      "id": "boundary-cd-froude",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "q": 1,
        "mode": "froude"
      },
      "expectError": "INVALID_MODE",
      "code": "INVALID_MODE",
      "error": "mode must be depth|unit_discharge. Not Froude, specific energy, hydraulic jump, Manning, or Q=Av"
    },
    {
      "id": "boundary-cd-zero",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "q": 0
      },
      "expectError": "VALUE_MUST_BE_POSITIVE",
      "code": "VALUE_MUST_BE_POSITIVE",
      "error": "q must be greater than zero"
    },
    {
      "id": "property-cd-yc",
      "ok": true,
      "kind": "property",
      "detail": "yc=(q²/g)^{1/3}",
      "expect": 0.46718953723930495,
      "actual": 0.46718953723930495
    },
    {
      "id": "property-cd-roundtrip-q",
      "ok": true,
      "kind": "property",
      "detail": "q invert",
      "expect": 1,
      "actual": 0.9999999999999999
    },
    {
      "id": "property-cd-Qb",
      "ok": true,
      "kind": "property",
      "detail": "Q/b",
      "expect": 0.46718953723930495,
      "actual": 0.46718953723930495
    },
    {
      "id": "property-cd-vc",
      "ok": true,
      "kind": "property",
      "detail": "vc=√(g yc)",
      "expect": 2.140458893641228,
      "actual": 2.140458893641228
    },
    {
      "id": "property-cd-model",
      "ok": true,
      "kind": "property",
      "detail": "critical_depth",
      "expect": true,
      "actual": "critical_depth"
    }
  ],
  "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-17T08:40:57.187Z",
  "rendered_at": "2026-09-17T08:49:50.941Z",
  "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": "d49a2eacfe2366fc685869d86c01f1c37d7dd297fd06351f4d8e2465063279d7",
      "output_schema_sha256": "abecc9666596c2b02a611a9636356763de9935f68c5547102e1c88f40ad8703e",
      "evidence_sha256": "57b8ecf47d8a1fc2d265dc15b70a3bbb35e5787c9482ea99a7a1b587cdba3c7e",
      "evidence_core_sha256": "57b8ecf47d8a1fc2d265dc15b70a3bbb35e5787c9482ea99a7a1b587cdba3c7e",
      "capability_sha256": "9ea7570241c39dcf1c34b8d010f17f4106df6e2cfcbb82c24236dc113275992f",
      "engine_sha256": "0c0851fab70abbeebfe07916fc4e23f4718babe41882681bdfec8e4f0768b97f",
      "mcp_contract_sha256": "e444fb05e9379f4f2492792d89493686e8dd71c0a104ae00acbe73364b370c5c"
    },
    "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"
  }
}
