{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "drillplan://aea/hydraulicsesd/3.0.0",
  "title": "HydraulicsEsd Agent's Raw Output",
  "type": "object",
  "description": "The 'HydraulicsESD' agent calculates the worst case ESD (equivalent static density) for a particular drilling run. The ESD is typically used to evaluate well control risks. The agent takes the maximum flowrate, maximum RPM, minimum ROP and minimum Fluid Density as inputs and outputs the bit depth based results.",
  "additionalProperties": false,
  "required": [
    "raw_outputs"
  ],
  "properties": {
    "raw_outputs": {
      "$ref": "#/definitions/ResultDtoOfEsdRawOutputDto"
    }
  },
  "definitions": {
    "ResultDtoOfEsdRawOutputDto": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "is_success",
        "messages",
        "value",
        "error_status"
      ],
      "properties": {
        "is_success": {
          "type": "boolean"
        },
        "messages": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "value": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/EsdRawOutputDto"
            }
          ]
        },
        "error_status": {
          "type": [
            "null",
            "string"
          ]
        }
      }
    },
    "EsdRawOutputDto": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "bit_depth_based_results",
        "casing_shoe_depth"
      ],
      "properties": {
        "bit_depth_based_results": {
          "type": "array",
          "description": "Bit depth based results.",
          "items": {
            "$ref": "#/definitions/BitDepthBasedResultsDto"
          }
        },
        "casing_shoe_depth": {
          "type": "number",
          "description": "The casing shoe depth (StandardDepthIndex,meter,m).",
          "format": "double"
        }
      }
    },
    "BitDepthBasedResultsDto": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "bit_depth",
        "ecd",
        "fracture_pressure",
        "esd",
        "pore_pressure",
        "mud_density",
        "mud_pv",
        "mud_yp",
        "max_flowrate",
        "max_rotation_per_minute",
        "min_rate_of_penetration",
        "static_back_pressure",
        "circulating_back_pressure"
      ],
      "properties": {
        "bit_depth": {
          "type": "number",
          "description": "The bit depth (StandardDepthIndex,meter,m).",
          "format": "double"
        },
        "ecd": {
          "type": "array",
          "description": "The equivalent circulating density values (MudDensity,kilogram per cubic meter,kg/m3) based on measure depth (StandardDepthIndex,meter,m).",
          "items": {
            "$ref": "#/definitions/MdBasedValueDto"
          }
        },
        "fracture_pressure": {
          "type": "array",
          "description": "The equivalent mud weight of fracture pressure values (MudDensity,kilogram per cubic meter,kg/m3) based on measure depth (StandardDepthIndex,meter,m).",
          "items": {
            "$ref": "#/definitions/MdBasedValueDto"
          }
        },
        "esd": {
          "type": "array",
          "description": "The equivalent static density values (MudDensity,kilogram per cubic meter,kg/m3) based on measure depth (StandardDepthIndex,meter,m).",
          "items": {
            "$ref": "#/definitions/MdBasedValueDto"
          }
        },
        "pore_pressure": {
          "type": "array",
          "description": "The equivalent mud weight of pore pressure values (MudDensity,kilogram per cubic meter,kg/m3) based on measure depth (StandardDepthIndex,meter,m).",
          "items": {
            "$ref": "#/definitions/MdBasedValueDto"
          }
        },
        "mud_density": {
          "type": "number",
          "description": "The mud density (MudDensity,kilogram per cubic meter,kg/m3).",
          "format": "double"
        },
        "mud_pv": {
          "type": "number",
          "description": "The mud plastic viscosity (DynamicViscosity,pascal-second,Pa·S).",
          "format": "double"
        },
        "mud_yp": {
          "type": "number",
          "description": "The mud yield point (ShearStress,pascal,Pa).",
          "format": "double"
        },
        "max_flowrate": {
          "type": "number",
          "description": "The max flow rate (MudFlowrate,cubic meter per second,m3/s).",
          "format": "double"
        },
        "max_rotation_per_minute": {
          "type": "number",
          "description": "The max rotation rate (RotarySpeed,radian per second,rad/s).",
          "format": "double"
        },
        "min_rate_of_penetration": {
          "type": "number",
          "description": "The min rate of penetration (DrillbitPenetrationRate,meter per second,m/s).",
          "format": "double"
        },
        "static_back_pressure": {
          "type": "number",
          "description": "Static surface annular back pressure (Pressure,pascal,Pa).",
          "format": "double"
        },
        "circulating_back_pressure": {
          "type": "number",
          "description": "Circulating surface annular back pressure (Pressure,pascal,Pa).",
          "format": "double"
        }
      }
    },
    "MdBasedValueDto": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "md",
        "value"
      ],
      "properties": {
        "md": {
          "type": "number",
          "description": "The measure depth (StandardDepthIndex,meter,m).",
          "format": "double"
        },
        "value": {
          "type": "number",
          "description": "The value based on the measured depth, unit is identified with the profile.",
          "format": "double"
        }
      }
    }
  }
}