{
  "capability_id": "physics.fluid.weir",
  "tool_id": "weir-discharge",
  "engine": "weir-discharge",
  "calculation_version": "1.0.0",
  "generated_at": "2026-09-17T02:45:35.817Z",
  "engine_build": "2026-09-17",
  "test_count": 15,
  "passed": 15,
  "failed": 0,
  "tests_summary": {
    "golden": {
      "total": 1,
      "passed": 1
    },
    "boundary": {
      "total": 9,
      "passed": 9
    },
    "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/weir-discharge",
  "api": "https://www.calculatorx.com/api/v1/calc/weir-discharge",
  "schema_input": "https://www.calculatorx.com/schemas/physics.fluid.weir.input.json",
  "schema_output": "https://www.calculatorx.com/schemas/physics.fluid.weir.output.json",
  "assumptions": [
    "Thin-plate weir; free nappe",
    "SI g=9.80665 unless given",
    "Rectangular: Q=(2/3) C_d L √(2g) H^{3/2}; not Francis contractions",
    "Triangular: Q=(8/15) C_d √(2g) tan(θ/2) H^{5/2}",
    "Not Manning, not Q=Av, not Darcy, not an orifice"
  ],
  "limitations": [
    "Thin-plate weir; free nappe; SI g=9.80665 unless given",
    "Rectangular: Q=(2/3) C_d L √(2g) H^{3/2}; not Francis contractions",
    "Triangular: Q=(8/15) C_d √(2g) tan(θ/2) H^{5/2}",
    "Not Manning, not Q=Av, not Darcy, not an orifice"
  ],
  "boundary_conditions": [
    "missing H or Q → MISSING_REQUIRED_INPUT",
    "rectangular missing L → MISSING_REQUIRED_INPUT",
    "H, Q, L, Cd, θ, or g ≤ 0 → VALUE_MUST_BE_POSITIVE",
    "H and Q together, or θ_deg and θ_rad → MIXED_INPUT_ENCODING",
    "C_d > 1 → VALUE_OUT_OF_RANGE",
    "Francis, Cipolletti, Manning, or orifice as mode → INVALID_MODE"
  ],
  "sources": [
    {
      "title": "ISO 1438 — Hydrometry — Open channel flow measurement using thin-plate weirs",
      "section": "Rectangular and triangular thin-plate weirs",
      "url": "https://www.iso.org/standard/41711.html",
      "supports": "Thin-plate weir discharge from head over a sharp crest",
      "kind": "standard"
    },
    {
      "title": "ISO 80000-4 — Mechanics",
      "section": "Volume flow rate",
      "url": "https://www.iso.org/standard/31895.html",
      "supports": "Q is volume flow; H is a length (head)",
      "kind": "standard"
    },
    {
      "title": "Chow, V.T. Open-Channel Hydraulics",
      "section": "Sharp-crested weirs",
      "supports": "Rectangular (2/3) C_d L √(2g) H^{3/2}; triangular (8/15) C_d √(2g) tan(θ/2) H^{5/2}",
      "kind": "reference"
    }
  ],
  "methods": [],
  "fingerprint": "sha256:89f4b29e1866ab5aebf1de5dc2f8ea3977fde29a6c9c321d2824d2b28b459b96",
  "tests": [
    {
      "id": "golden-weir-rect",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "L": 1,
        "H": 0.2
      },
      "expect": {
        "Q": 0.163727171653876,
        "H": 0.2,
        "Cd": 0.62,
        "L": 1,
        "mode": "rectangular",
        "model": "thin_plate_weir"
      },
      "expectWarning": null,
      "actual": {
        "mode": "rectangular",
        "Q": 0.163727171653876,
        "H": 0.2,
        "Cd": 0.62,
        "g": 9.80665,
        "L": 1,
        "model": "thin_plate_weir"
      },
      "tol": 1e-10
    },
    {
      "id": "boundary-weir-invert",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "L": 1,
        "Q": 0.163727171653876
      },
      "expect": {
        "H": 0.2,
        "model": "thin_plate_weir"
      },
      "expectWarning": null,
      "actual": {
        "mode": "rectangular",
        "Q": 0.163727171653876,
        "H": 0.20000000000000004,
        "Cd": 0.62,
        "g": 9.80665,
        "L": 1,
        "model": "thin_plate_weir"
      },
      "tol": 1e-10
    },
    {
      "id": "boundary-weir-tri",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "triangular",
        "H": 0.2
      },
      "expect": {
        "Q": 0.024506260531418852,
        "Cd": 0.58,
        "theta_deg": 90,
        "mode": "triangular",
        "model": "thin_plate_weir"
      },
      "expectWarning": null,
      "actual": {
        "mode": "triangular",
        "Q": 0.024506260531418852,
        "H": 0.2,
        "Cd": 0.58,
        "g": 9.80665,
        "theta_deg": 90,
        "model": "thin_plate_weir"
      },
      "tol": 1e-10
    },
    {
      "id": "boundary-weir-missing",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "L": 1
      },
      "expectError": "MISSING_REQUIRED_INPUT",
      "code": "MISSING_REQUIRED_INPUT",
      "error": "H is required"
    },
    {
      "id": "boundary-weir-h0",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "L": 1,
        "H": 0
      },
      "expectError": "VALUE_MUST_BE_POSITIVE",
      "code": "VALUE_MUST_BE_POSITIVE",
      "error": "H must be greater than zero"
    },
    {
      "id": "boundary-weir-mixed",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "L": 1,
        "H": 0.2,
        "Q": 0.163727171653876
      },
      "expectError": "MIXED_INPUT_ENCODING",
      "code": "MIXED_INPUT_ENCODING",
      "error": "Give H or Q, not both"
    },
    {
      "id": "boundary-weir-francis-cd",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "L": 1,
        "H": 0.2,
        "Cd": 3.33
      },
      "expectError": "VALUE_OUT_OF_RANGE",
      "code": "VALUE_OUT_OF_RANGE",
      "error": "Cd must be ≤ 1"
    },
    {
      "id": "boundary-weir-francis",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "L": 1,
        "H": 0.2,
        "mode": "francis"
      },
      "expectError": "INVALID_MODE",
      "code": "INVALID_MODE",
      "error": "mode must be rectangular|triangular. Not Francis, Cipolletti, Manning, or orifice"
    },
    {
      "id": "boundary-weir-orifice",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "L": 1,
        "H": 0.2,
        "mode": "orifice"
      },
      "expectError": "INVALID_MODE",
      "code": "INVALID_MODE",
      "error": "mode must be rectangular|triangular. Not Francis, Cipolletti, Manning, or orifice"
    },
    {
      "id": "boundary-weir-manning",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "L": 1,
        "H": 0.2,
        "mode": "manning"
      },
      "expectError": "INVALID_MODE",
      "code": "INVALID_MODE",
      "error": "mode must be rectangular|triangular. Not Francis, Cipolletti, Manning, or orifice"
    },
    {
      "id": "property-weir-q",
      "ok": true,
      "kind": "property",
      "detail": "rect Q=(2/3)Cd L √(2g) H^{3/2}",
      "expect": 0.163727171653876,
      "actual": 0.163727171653876
    },
    {
      "id": "property-weir-h",
      "ok": true,
      "kind": "property",
      "detail": "H round-trip",
      "expect": 0.2,
      "actual": 0.20000000000000004
    },
    {
      "id": "property-weir-tri",
      "ok": true,
      "kind": "property",
      "detail": "90° V-notch",
      "expect": 0.024506260531418852,
      "actual": 0.024506260531418852
    },
    {
      "id": "property-weir-cd",
      "ok": true,
      "kind": "property",
      "detail": "default Cd 0.62/0.58",
      "expect": 0.62,
      "actual": 0.62
    },
    {
      "id": "property-weir-model",
      "ok": true,
      "kind": "property",
      "detail": "thin_plate_weir",
      "expect": true,
      "actual": "thin_plate_weir"
    }
  ],
  "tier": "engine_tested",
  "verification": {
    "tests": {
      "passed": 15,
      "total": 15,
      "golden": 1,
      "boundary": 9,
      "property": 5
    },
    "contract_checks": {
      "passed": 3,
      "total": 3
    }
  },
  "evidence_core_generated_at": "2026-09-17T01:37:27.321Z",
  "rendered_at": "2026-09-17T02:45:35.817Z",
  "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": "2a4b8c2260cb328e0b5d7d09678ab65c431ca7e6f44cef407664bfeaad0fc564",
      "output_schema_sha256": "0fb770b1938aaa0ccc3fbc75ffcf04311171ef33a53871b941e2481fa2ac0a86",
      "evidence_sha256": "124356d93376a513d7eb776eab37b406b66fa7047d5421d25a6ffeb017464814",
      "evidence_core_sha256": "124356d93376a513d7eb776eab37b406b66fa7047d5421d25a6ffeb017464814",
      "capability_sha256": "35790e05c43581f4ecd1154cafaf9f40fbc6166e709f71ead9a025b87e9f9ca4",
      "engine_sha256": "a3e8effccaf4677aec4d1da78c13b5dc595ff97e52b074d5de5ab5cb5a87b094",
      "mcp_contract_sha256": "a942c221699a25eb2b10fc462c0b321092558cb5ffda32cf521d31ee83e3fe87"
    },
    "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"
  }
}
