{
  "tool": "meng-civil.pipe_wall_barlow",
  "name": "Pipe wall thickness (Barlow) (CDU-ENG-CIV-900)",
  "answers": "What wall thickness contains a pressure in a pipe of a given diameter and material, and what pressure can a given pipe take?",
  "degree": {
    "id": "competency:meng-civil",
    "code": "CDU-ENG-CIV-900",
    "name": "Master of Engineering — Civil & Structural Engineering",
    "version": "1.0.0"
  },
  "reference": "Barlow: t = P·D/(2·S); allowable stress S = yield ÷ factor of safety",
  "endpoint": "/faculty/meng-civil/pipe_wall_barlow",
  "feeSt": 1,
  "inputSchema": {
    "type": "object",
    "required": [
      "pan",
      "outsideDiameterMm",
      "pressureKpa"
    ],
    "properties": {
      "pan": {
        "type": "string",
        "description": "The student PAN — the degree must be held in one of its five slots",
        "pattern": "^[0-9 ]{16,19}$"
      },
      "outsideDiameterMm": {
        "type": "number",
        "description": "Pipe outside diameter (mm)",
        "minimum": 1
      },
      "pressureKpa": {
        "type": "number",
        "description": "Design pressure (kPa)",
        "minimum": 0.1
      },
      "yieldStrengthMpa": {
        "type": "number",
        "description": "Material yield strength (copper 70, PVC 50, steel 240, HDPE 22) (MPa)",
        "minimum": 1,
        "default": 240
      },
      "factorOfSafety": {
        "type": "number",
        "description": "Factor of safety on yield",
        "minimum": 1,
        "maximum": 10,
        "default": 2
      },
      "wallThicknessMm": {
        "type": "number",
        "description": "Actual wall thickness, to check a pipe (mm)",
        "minimum": 0.1
      }
    },
    "additionalProperties": false
  },
  "outputSchema": {
    "type": "object",
    "required": [
      "requiredWallMm",
      "allowablePressureKpa",
      "wallOk"
    ],
    "properties": {
      "requiredWallMm": {
        "type": "number",
        "description": "Minimum wall thickness (mm)"
      },
      "allowablePressureKpa": {
        "type": "number",
        "description": "Allowable pressure for the given wall (when given) (kPa)"
      },
      "wallOk": {
        "type": "boolean",
        "description": "Given wall ≥ required (true when none given)"
      }
    },
    "additionalProperties": false
  },
  "example": {
    "outsideDiameterMm": 63,
    "pressureKpa": 1600,
    "yieldStrengthMpa": 22,
    "wallThicknessMm": 5.8
  }
}