# Heat Exchanger LMTD API
> Heat-exchanger LMTD and effectiveness-NTU maths as an API, computed locally and deterministically. The lmtd endpoint computes the log mean temperature difference, LMTD = (ΔT1 − ΔT2)/ln(ΔT1/ΔT2), the true average driving temperature of a heat exchanger, from the hot and cold stream inlet and outlet temperatures for either a counterflow or a parallel-flow arrangement, and flags a temperature cross. The duty endpoint applies Q = U·A·LMTD·F — the heat duty equals the overall heat-transfer coefficient times the area times the LMTD times an optional correction factor — and solves for whichever of the duty, the coefficient, the area or the LMTD you leave out, taking the LMTD directly or from the four temperatures. The effectiveness endpoint uses the effectiveness-NTU method: from the hot and cold heat-capacity rates (given directly or as mass flow times specific heat) and the number of transfer units NTU = U·A/Cmin, it returns the capacity ratio, the effectiveness for the arrangement, and — given the inlet temperatures — the maximum and actual heat duty and the outlet temperatures. Everything is computed locally and deterministically, so it is instant and private. Ideal for process, chemical and mechanical engineering tools, HVAC, refrigeration and thermal-design apps, and engineering education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is two-stream heat-exchanger analysis; for the sensible heat of a single stream Q = m·c·ΔT use a specific-heat API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/lmtd-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 20,000 calls/Mo, 5 req/s
- **Pro** ($24/Mo) — 120,000 calls/Mo, 15 req/s
- **Mega** ($74/Mo) — 637,000 calls/Mo, 40 req/s

## Endpoints

### Heat Exchanger

#### `GET /v1/duty` — Heat duty Q = U·A·LMTD

**Parameters:**
- `overall_heat_transfer_coefficient` (query, optional, string) — U (W/m²K) Example: `500`
- `area` (query, optional, string) — Area A (m²) Example: `10`
- `lmtd` (query, optional, string) — LMTD (or give temperatures) Example: `69.52`
- `heat_duty` (query, optional, string) — Or heat duty Q (W) to solve another
- `hot_inlet` (query, optional, string) — Hot inlet (with the other temps for LMTD)
- `hot_outlet` (query, optional, string) — Hot outlet
- `cold_inlet` (query, optional, string) — Cold inlet
- `cold_outlet` (query, optional, string) — Cold outlet
- `correction_factor` (query, optional, string) — F (default 1)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/lmtd-api/v1/duty?overall_heat_transfer_coefficient=500&area=10&lmtd=69.52"
```

**Response:**
```json
{
    "data": {
        "lmtd": 69.52,
        "area_m2": 10,
        "formula": "Q = U·A·LMTD·F.",
        "heat_duty_w": 347600,
        "heat_duty_kw": 347.6,
        "correction_factor": 1,
        "overall_heat_transfer_coefficient_w_m2k": 500
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:49.101Z",
        "request_id": "02eca498-6e5c-40e7-a6ff-ff6821211bd6"
    },
    "status": "ok",
    "message": "Heat duty Q = U·A·LMTD",
    "success": true
}
```

#### `GET /v1/effectiveness` — Effectiveness-NTU method

**Parameters:**
- `c_hot` (query, optional, string) — Hot heat-capacity rate (W/K) Example: `2000`
- `c_cold` (query, optional, string) — Cold heat-capacity rate (W/K) Example: `3000`
- `mass_flow_hot` (query, optional, string) — Or hot mass flow (kg/s)
- `cp_hot` (query, optional, string) — And hot specific heat (J/kg·K)
- `ua` (query, optional, string) — U·A (W/K) Example: `5000`
- `ntu` (query, optional, string) — Or NTU directly
- `arrangement` (query, optional, string) — counterflow | parallel Example: `counterflow`
- `hot_inlet` (query, optional, string) — Hot inlet temperature for duty Example: `150`
- `cold_inlet` (query, optional, string) — Cold inlet temperature for duty Example: `30`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/lmtd-api/v1/effectiveness?c_hot=2000&c_cold=3000&ua=5000&arrangement=counterflow&hot_inlet=150&cold_inlet=30"
```

**Response:**
```json
{
    "data": {
        "ntu": 2.5,
        "c_hot": 2000,
        "c_max": 3000,
        "c_min": 2000,
        "c_cold": 3000,
        "formula": "ε = (1−e^(−NTU(1−Cr)))/(1−Cr·e^(−NTU(1−Cr))); ε = NTU/(1+NTU) when Cr=1.",
        "q_max_w": 240000,
        "hot_inlet": 150,
        "cold_inlet": 30,
        "hot_outlet": 54.475172,
        "arrangement": "counterflow",
        "cold_outlet": 93.683218,
        "heat_duty_w": 191049.6552,
        "heat_duty_kw": 191.049655,
        "effectiveness": 0.79604023,
        "capacity_ratio": 0.666667
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:49.239Z",
        "request_id": "65ce47f2-7172-43db-a1bc-5b3d2a9c8052"
    },
    "status": "ok",
    "message": "Effectiveness-NTU",
    "success": true
}
```

#### `GET /v1/lmtd` — Log mean temperature difference

**Parameters:**
- `hot_inlet` (query, required, string) — Hot stream inlet temperature Example: `150`
- `hot_outlet` (query, required, string) — Hot stream outlet temperature Example: `90`
- `cold_inlet` (query, required, string) — Cold stream inlet temperature Example: `30`
- `cold_outlet` (query, required, string) — Cold stream outlet temperature Example: `70`
- `arrangement` (query, optional, string) — counterflow | parallel (default counterflow) Example: `counterflow`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/lmtd-api/v1/lmtd?hot_inlet=150&hot_outlet=90&cold_inlet=30&cold_outlet=70&arrangement=counterflow"
```

**Response:**
```json
{
    "data": {
        "lmtd": 69.52119,
        "formula": "LMTD = (ΔT1 − ΔT2)/ln(ΔT1/ΔT2).",
        "delta_t1": 80,
        "delta_t2": 60,
        "hot_inlet": 150,
        "cold_inlet": 30,
        "hot_outlet": 90,
        "arrangement": "counterflow",
        "cold_outlet": 70
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:49.343Z",
        "request_id": "75186ad4-5068-412c-a6d6-ec068a6a877f"
    },
    "status": "ok",
    "message": "Log mean temperature difference",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/lmtd-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "api": "lmtd",
        "note": "Heat-exchanger LMTD & effectiveness-NTU — computed locally and deterministically, no key, no third-party service.",
        "endpoints": [
            "/v1/lmtd",
            "/v1/duty",
            "/v1/effectiveness",
            "/v1/meta"
        ],
        "arrangements": [
            "counterflow",
            "parallel"
        ]
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:49.421Z",
        "request_id": "8df37242-d57a-4c3a-8a2b-8b9a67cb2f3b"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/lmtd-api
OpenAPI spec: https://www.oanor.com/api/lmtd-api/openapi.json
