---
title: "Estimate steady-state thermal behaviour of a rectangular enclosure (server rack, electronics housing, equipment cabinet) using a lumped-parameter energy balance with natural-convection and radiation correlations, or forced-flow air energy balance. Accepts enclosure dimensions, heat source positions and wattages, and airflow configuration. Returns temperature extremes, estimated hotspot location, airflow velocity summary, and overall thermal resistance. Runs instantly in-worker; a full CFD container backend is planned for mesh-level detail."
method: POST
path: "/api/thermal_enclosure"
tags: ["homelab"]
---

# Estimate steady-state thermal behaviour of a rectangular enclosure (server rack, electronics housing, equipment cabinet) using a lumped-parameter energy balance with natural-convection and radiation correlations, or forced-flow air energy balance. Accepts enclosure dimensions, heat source positions and wattages, and airflow configuration. Returns temperature extremes, estimated hotspot location, airflow velocity summary, and overall thermal resistance. Runs instantly in-worker; a full CFD container backend is planned for mesh-level detail.

`POST /api/thermal_enclosure`

## Request

- Base URL: `https://calc.engineer`
- URL: `https://calc.engineer/api/thermal_enclosure`
- Auth: none declared

## Request body

- object
  - `length_m` number, required: Enclosure length (X) in metres
  - `width_m` number, required: Enclosure width (Y) in metres
  - `height_m` number, required: Enclosure height (Z) in metres
  - `heat_sources` object[], required: Heat sources inside the enclosure
    - `x_m` number, required: X position in metres from enclosure origin
    - `y_m` number, required: Y position in metres
    - `z_m` number, required: Z position in metres
    - `watts` number, required: Heat dissipation in watts
    - `label` string: Optional label (e.g. 'CPU', 'PSU')
  - `flow_type` 'natural_convection' | 'forced', required: Airflow type
  - `inlet_velocity_ms` number: Inlet air velocity in m/s (required for forced flow)
  - `inlet_position` 'front_bottom' | 'front_center' | 'side_bottom': Inlet location
  - `outlet_position` 'rear_top' | 'rear_center' | 'top_rear': Outlet location
  - `ambient_temp_c` number: Ambient air temperature in Celsius
  - `mesh_density` 'coarse' | 'medium' | 'fine': Mesh density — coarse (~50K cells), medium (~200K), fine (~500K)

## Response `200`

Computed result for thermal_enclosure

- object
  - `result` object, required
    - `max_temp_c` number, required: Maximum temperature in the enclosure (°C)
    - `min_temp_c` number, required: Minimum temperature (°C)
    - `avg_temp_c` number, required: Volume-averaged temperature (°C)
    - `hotspot_location` object, required
      - `x_m` number, required: X coordinate of hotspot in metres
      - `y_m` number, required: Y coordinate of hotspot in metres
      - `z_m` number, required: Z coordinate of hotspot in metres
    - `max_velocity_ms` number, required: Peak airflow velocity (m/s)
    - `avg_velocity_ms` number, required: Average airflow velocity (m/s)
    - `thermal_resistance_cw` number, required: Overall thermal resistance (°C/W)
    - `total_heat_w` number, required: Total heat load (W)
    - `mesh_cells` number, required: Number of mesh cells used
    - `solver` string, required: OpenFOAM solver used
    - `iterations` number, required: Number of solver iterations to convergence
    - `runtime_ms` number, required: Simulation wall-clock time in milliseconds
    - `warnings` string[], required: Any solver warnings
  - `tool` string, required
  - `version` string, required
  - `computed_at` string, date-time, required
  - `chain` object, required
    - `feeds` unknown[]
      - unknown
    - `accepts_from` unknown[]
      - unknown

## Other responses

- `400`: Validation error or invalid JSON
- `404`: Tool not found

---

[API](https://skmtc.dev/calc/apis/calc-engineer-api.md) · [All operations](https://skmtc.dev/calc/apis/calc-engineer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/calc/apis/calc-engineer-api/revisions/8830480ec488?raw)
