# Hydrotreater

The hydrotreater uses exactly two input fluids and two output fluids. The second input fluid's pressure sets the pressure of its tank; other pressures are ignored. It runs one operation every two ticks, spending `power` HE per operation, and ignores `duration`. Among rows with the same first input fluid, the last by `order` applies.

## Fields

| Field | Meaning and default | Range |
| - | - | - |
| `type` | Selects the `hbm:hydrotreater` recipe format. | |
| `name` (Optional) | Internal lookup name; defaults to the last segment of the recipe resource path. | |
| `input_fluids` | Ordered fluid inputs with amount and pressure; defaults to an empty list. | |
| `input_fluids.type` | Registered fluid ID. | |
| `input_fluids.amount` | Amount in mB; use $[1, \mathrm{tank\ capacity}]$ for transfers because machine code casts to int. | `i64` |
| `input_fluids.pressure` (Optional) | Pressure level; default 0. | `i32` |
| `output_fluids` | Ordered fluid outputs with amount and pressure; defaults to an empty list. | |
| `output_fluids.type` | Registered fluid ID. | |
| `output_fluids.amount` | Amount in mB; use $[1, \mathrm{tank\ capacity}]$ for transfers because machine code casts to int. | `i64` |
| `output_fluids.pressure` (Optional) | Pressure level; default 0. | `i32` |
| `power` | HE demand; defaults to 0. | `i64` |
| `order` (Optional) | Sort position within the recipe table; lower values first, default 2147483647. | `i32` |

## Example

Source path: `data/hbm/recipe/hydrotreater/hydro.oil.json`

```json
{
  "type": "hbm:hydrotreater",
  "duration": 2,
  "input_fluids": [
    {
      "type": "hbm:oil",
      "amount": 100
    },
    {
      "type": "hbm:hydrogen",
      "amount": 5,
      "pressure": 1
    }
  ],
  "order": 0,
  "output_fluids": [
    {
      "type": "hbm:oil_ds",
      "amount": 90
    },
    {
      "type": "hbm:sourgas",
      "amount": 15
    }
  ],
  "power": 20000
}
```
