Listed from the MCP registry; nobody on Odel publishes it.

MCP server: One MCP server.

Ventsim

@agenticeramMCP server · External

Read, check and what-if Ventsim mine ventilation models (.vsm files)

Scientific computingv0.14.0MITPython
Freeno charge per call

Runs on your machine from its package; the steps are below.

What it does

  1. Reads
  2. Writes
  3. High impact

At most: creates or changes data: records, files, settings.

What it costs

Free

Odel charges nothing per call. The publisher may charge for its own service.

Runs locally over stdio

This server isn't hosted — your MCP client launches it from a package registry. Use one of the commands below, or drop the config into your client (e.g. Claude Desktop).

PyPIventsim-mcpv0.14.0

Run

uvx ventsim-mcp

MCP client config

{
  "mcpServers": {
    "ventsim": {
      "command": "uvx",
      "args": [
        "ventsim-mcp"
      ]
    }
  }
}
README18 min read

ventsim-mcp

agenticeram/ventsim-mcp MCP server

An MCP server that lets AI assistants read and inspect Ventsim mine ventilation models (.vsm files).

It works on the model file itself, so Ventsim does not need to be running. It reads the geometry, fans and the results Ventsim saved in the file, and has its own experimental airflow, temperature and gas solvers for what-if questions; confirm important results in Ventsim.

Unofficial. Not affiliated with or endorsed by Howden / Chasm Consulting. "Ventsim" is their trademark. The .vsm format is undocumented; it was read from files saved by Ventsim DESIGN 6 and may change between versions.

Tools

ToolWhat it does
model_summaryTitle, Ventsim version, airway and fan counts, total length, depth range
list_airwaysFilter by name/notes or minimum velocity, sort by any field (airflow, length, pressure...)
get_airwayEvery column of one airway
list_fansFan airways with fan model name, duty airflow, fan pressure, power
velocity_checkAirways above a maximum (or below a minimum) air velocity
fan_duty_checkWhere each fan runs on its curve: airflow per fan, stall margin, flags fans in or near the stall region or off the curve
fan_summaryFans by model with total Fan Power as stored in the file (kW)
compare_modelsDiff two saved versions: added/removed airways, airflow and pressure changes
check_flow_balanceAirflow mass balance at every junction (finds un-simulated or broken networks)
what_ifExperimental: re-solve the network after scaling airway resistance, switching fans off or changing fan speed, report airflow changes
size_regulatorExperimental: resistance, pressure drop and approximate opening area of a regulator that brings one airway to a target airflow
trace_airflowMain airflow path through an airway from intake to exhaust, with length and frictional pressure along it
simulate_airflowExperimental: solve the airflow from the model inputs alone (no saved results needed), with optional changes
simulate_heatExperimental: dry- and wet-bulb temperature and humidity after airflow changes or with extra heat and moisture sources (diesel, fire, coolers); rock_temp adds the change of rock-to-air heat with airflow and air temperature
hvac_layoutRead-only: rooms and doors of an HVAC model and the room each door opens into (airflow in HVAC models is not solved)
contaminant_spreadExperimental: steady-state gas / smoke concentration downstream of release points
escape_routesWalking distance from every airway to the surface and to the nearest refuge (Ventsim's own rule), optionally with airways blocked
recirculation_checkClosed loops in the airflow (fan recirculation and other circulating air)
contaminant_arrivalTime for smoke or gas to reach each airway from release points
diesel_exhaustExperimental: diesel particulate (DPM) concentration and air per kW of diesel
compliance_checkAirways outside velocity, diesel air, wet-bulb and escape-distance limits (your limits)
fan_selectFans from the model's fan library that meet a duty, with speed, efficiency, power and stall margin
energy_reportFan energy and yearly cost, and the airways where the air power is lost
calibrate_airflowExperimental: fit airway resistances to measured airflows (survey calibration)
list_stagesStages in the model; most analysis tools take stage= to study another one
write_resultsExperimental: write a copy with this server's airflow and temperatures in it
render_networkDraw the network to SVG (plan or section), coloured by any field, fans marked, paths highlighted
export_csvAirways to CSV, any columns
edit_airwaysExperimental: write a copy with changed Notes / Group / Branch Name, fan speed or fan on/off, airway size, length or friction factor (resistance follows), parallel airways (Pathways), an airway closed, or a fixed airflow (Fixed Flow: m3/s, or off)
add_airwaysExperimental: write a copy with new airways (copied from an existing one, joined to the network where the ends meet)
model_checkVentsim warnings and errors found from the file: loose ends, duplicates, blocked fans, fans or stoppings in series, conflicting fixed flows
optimize_fans_toolExperimental: search fan speeds for the lowest estimated fan power that keeps named airways at their required airflow and creates no new velocity violations (min_flow, or strict)
shortest_pathExperimental: shortest route between two airways by distance, resistance or hops (Ventsim's Shortest Path)
sensitivityExperimental: Monte Carlo on resistances; mean, deviation and confidence of each airway's flow (Ventsim's Sensitivity)
goal_seekExperimental: fan speed that gives a target airflow in one airway (Ventsim's Goal Seek, fan speed)
radon_steadyExperimental: steady-state radon (Bq/m3, pCi/l) from surface exhalation and point sources
fan_upgrade_npvExperimental: NPV and simple payback of changing a fan's power (generic DCF, not Ventsim's costing model)
export_dxfExperimental: airways as DXF LINEs for CAD (needs the optional ezdxf package)
fix_modelWrite a copy with the safe fixes: duplicates merged with Pathways, loose ends closed, blocked fans off

list_airways takes units="imperial" (cfm, fpm, ft, in. w.g., hp).

All values are in the SI units Ventsim stores internally (m, m3/s, Pa, kW).

Install

pip install ventsim-mcp
# or the latest code: pip install git+https://github.com/agenticeram/ventsim-mcp

Claude Desktop / Claude Code config:

json
{ "mcpServers": { "ventsim": { "command": "ventsim-mcp" } } }

Then ask, for example: "Open C:\models\mine.vsm and list the 10 airways with the highest velocity."

File format notes

A .vsm is a gzip-compressed, CRLF-separated, tab-delimited text file. The airway table starts at a header line beginning MAIN<TAB>Unique No, which names all ~288 columns; the parser uses those names, never fixed positions. Reading and writing is byte-exact when nothing is edited. A .txt export of the same file (uncompressed) is read too. The CSV/NBC/XLSX exports are headerless or derived dumps of the same tables and are not supported; use the .vsm/.txt.

What-if solver (experimental)

what_if solves node pressures for the airways of the simulated stage, balancing mass flow (air expands as it warms) with dP = R*Q|Q| - Ps(Q) - NVP on every airway. What it reads from the file:

  • Stage: Stage is a bit mask and an airway that differs between stages is stored once per stage, on top of each other. The stage whose saved airflow balances is used.
  • Junctions: airway ends closer than 5 cm are one node.
  • Resistance: the effective value from the saved pressure drop (includes fittings, dampers, orifices); scaling in what_if multiplies it. Closed airways carry no air.
  • Fans: density-corrected curves, static or total pressure as the saved results show, speed by the affinity laws, curve calibrated through the saved duty point. A fan whose saved pressure drop is resistance only is treated as stopped.
  • Boundaries: portals and dead ends are held at the pressure that reproduces the saved flow.
  • Unitemised pressure terms: natural ventilation pressure, velocity-pressure changes and Ventsim's own convergence residual per airway are frozen at their saved values.

Because these inputs come from the saved state, re-solving an unchanged model reproduces Ventsim's airflow almost exactly. That checks the network was read correctly (stages, junctions, closed airways, fans); it is not an accuracy figure for changes (total absolute flow error / total flow, python bench/fit.py <folder>):

Ventsim DESIGN 6 exampleAirways solvedError
diamondmine1,0570.06 %
Tutorial21840.04 %
InclinedHeatMine8100.02 %
the other 17 examples (CoalMine 3,403 airways, Blue_sky, Fire, HVAC, ...)< 0.01 %

Accuracy for changes. Fire and Fire2 are the same network with two airway resistances changed (x2.26 and x1.41; 25 more differ only in the last digits). Predicting Fire2 from Fire plus those changes (python bench/predict.py Fire.vsm Fire2.vsm) gives an airflow error of 0.03 % of total flow; it reproduces 96.7 % of the airflow change Ventsim computed. This is the only such pair among the shipped examples, so treat it as one data point.

compressible=True (what_if, simulate_airflow, optimize_fans_tool) follows Ventsim's Compressible Airflows setting: each airway's density comes from its absolute pressure (saved p air In/out, shifted by the solved pressure change), mass flow is balanced at the junctions, and resistance and fan pressure scale with density. A file saved incompressible (one density) gets densities from pressure, temperature and moisture; a file saved compressible keeps its densities, scaled with pressure. Checked against Ventsim 6.0.5: a Tutorial2 copy saved incompressible, re-simulated compressible in Ventsim, is predicted by simulate_airflow(compressible=True) within 0.5 % mean (1.0 % worst airway); without it 4.2 % mean (6.9 % worst).

Heat and fire effects are not re-evaluated after a change. Treat results as an estimate and confirm in Ventsim.

Simulation from inputs (experimental)

simulate_airflow does not use any saved result: resistance (Resistance Total), fan curves at their speed and count, fixed-flow airways, fixed-pressure airways (only when Ventsim's flag for it is set), closed airways, ends open to surface and dead ends (read from Ventsim's branch flags). Air is incompressible unless compressible=True, natural ventilation is ignored, unless use_saved_heat=True borrows both from the saved results. Compared with the airflow Ventsim saved (python bench/simulate.py <folder>):

Ventsim DESIGN 6 examplesError, coldWith saved heat
CoalMine2, Heat Strategies, Tutorial1, RealMine, DemoMine0.0 - 0.2 %same
Tutorial2, DevSolids, RealMine 20.2 - 1.2 %same
CoalMine, diamondmine, without_ducting, Natural Ventilation Effects2 - 4 %1.3 - 3.5 %
Fire, Fire2, InclinedHeatMine (heat-driven)6 - 28 %0.6 - 2 %
Blue_sky8.5 %5.4 %
HVACDemo, A, B (building ducts with room outlets)not supported

The remaining differences come from what the file does not spell out: heat and natural ventilation, how Ventsim applies total-pressure fan curves, leakage on ducts.

Heat and gas (experimental)

simulate_heat carries the dry-bulb temperature along the airflow, fully mixed at junctions. Each airway keeps the sensible heat Ventsim saved for it (rock, diesel, fans, other sources); the auto-compression part of it is split off and follows the new mass flow. Extra sources (kW, negative for cooling) can be added; a stopped fan's power is taken out and a speed change scales it with speed cubed. Changes are reported against the unchanged model, and baseline_fit says how well that matches Ventsim.

Moisture is carried the same way: each airway adds the water Ventsim saved as evaporating there (latent heat / 2450 kJ/kg), mixed by mass at junctions, and the wet bulb follows from dry bulb, moisture and pressure (standard psychrometrics; Ventsim's saved latent heat and wet bulbs agree with it to 0.4 % in the heat examples).

Re-running an unchanged model with its saved airflow (python bench/heat.py <folder>) is a reproduction check, not an accuracy figure for changes, because the heat comes from the same saved results. Outlet temperature, airways above 0.5 kg/s, mass-flow weighted mean / 95th percentile / worst single airway of |error|:

Ventsim DESIGN 6 exampleAirwaysDry bulbWet bulb
Heat Strategies300.03 / 0.05 / 0.05 K0.01 / 0.02 / 0.02 K
diamondmine7610.17 / 0.31 / 2.9 K0.04 / 0.11 / 0.9 K
Natural Ventilation Effects1860.18 / 0.47 / 0.6 K0.05 / 0.14 / 0.2 K
InclinedHeatMine7310.18 / 0.65 / 14 K0.08 / 0.80 / 8 K
Blue_sky5060.33 / 0.55 / 6.4 K0.10 / 0.33 / 3.3 K
CoalMine1,9890.36 / 1.6 / 8.8 K0.41 / 1.1 / 7.3 K
Fire, Fire2 (fire airways)1471.1 / 2.7 / 11.5 K3.3 / 7.4 / 11 K

There is no independent check yet: Fire2's saved temperatures are the same as Fire's, so the pair used for airflow says nothing about heat. Moisture (latent heat, wet-bulb) and the change of rock heat with air temperature are not modelled; treat temperatures after large changes as an estimate.

Heat loads stay as saved: rock heat is not computed from rock properties (Ventsim takes the virgin rock temperature and rock age from global climate settings for most airways, and where those live in the file is not known yet).

contaminant_spread gives the steady-state concentration of a gas released in airways (m3/s of pure gas): c_out = c_in + G/Q, mixed by airflow at junctions, recirculation included. It is checked against exact hand calculations in the tests only: the mine examples hold time-dependent contaminant results, and the one steady result (dust in HVACDemoB) is in an HVAC model, which is not supported. Reading the model's own source inputs (include_file_sources=True, Base Injection x Base Concentration) is an unverified interpretation of Ventsim's fields and is off by default.

contaminant_arrival gives the first arrival of smoke or gas carried at the mean air velocity, the rule behind Ventsim's Spread Time: it matches all 131 airways of Tutorial1 to within 0.1 % (python bench/spread.py <folder>). InclinedHeatMine's saved spread times are 1 - 4 % faster than its saved airflow allows, so they look like results of an earlier run; HVACDemoB is an HVAC model.

diesel_exhaust mixes diesel particulate from the engines in the model (kW x an emission factor you give, g/kWh) along the airflow. Ventsim's own saved DPM values do not follow a steady mixing model (they look time-dependent), so this tool is not checked against Ventsim.

Escape routes and recirculation

escape_routes reproduces Ventsim's distancetosurface and distancetorefuge exactly: shortest walk along airways from the middle of each airway to a surface connection or to the middle of a refuge airway (Branch Flags2 bit 5); resistances marked impassable in the model's resistance table (stoppings, roof falls) cannot be walked. All 3,262 airways of the two examples that hold these results match (python bench/escape.py <folder>). recirculation_check finds the strongly connected parts of the directed airflow. Its fan loop in Fire2 is exactly the seven airways Ventsim marks as recirculation; it also reports loops without fans (and large circulating groups in Blue_sky and RealMine) that Ventsim does not mark, so read those as "air goes round here", not as Ventsim's recirculation.

Design tools

  • fan_select reads the fan library in the model (static and total pressure, efficiency, power per curve point) and finds the speed at which each fan meets a duty. Checked on the running fans of the examples (python bench/fan_select.py <folder>): for 99 of 103 fans with a library curve (for the other 4 no speed from 20 to 250 % fits), the fan's own curve meets its saved duty, at a speed within 1.3 points of the saved Fan Speed (6 points where only a total-pressure curve is given).
  • energy_report uses the saved fan power (Ventsim's Fan Power = airflow x fan total pressure / efficiency) and splits the air power over the airways.
  • compliance_check limits default to common practice values (0.25 - 6 m/s, 20 m/s in shafts, 0.06 m3/s per diesel kW, 28 C wet bulb); they are not any particular regulation, so pass the values that apply to you.
  • calibrate_airflow fits resistance factors to measured airflows by least squares on the what_if solver. Using Fire2's airflow in the 27 airways whose stored resistance differs from Fire as "measurements" on Fire (python bench/calibrate.py Fire.vsm Fire2.vsm) brings the whole network to within 0.002 % of Fire2's airflow in 8 s. The resistances themselves are not recovered: the two airways that really changed (x2.26 and x1.41) come out as x1.52 and x1.08, the rest of the change lands on airways in series with them, which the measurements cannot tell apart. Treat the factors as one fit, not as measured values.
  • write_results writes airflow, end pressures, airway pressure drop, fan pressure and temperatures into a copy (what_if solver by default). The other tools read such a copy consistently: what_if on a written copy reproduces it with 0.00 % error on Fire and CoalMine. The changes themselves (resistance factor, Fan Off, Fan Speed) go into the inputs too, so re-simulating the copy keeps them. Heat terms and gases are left as they were. See "Checked in Ventsim" below for copies re-simulated in Ventsim itself.
  • compliance_check takes the wet bulb Ventsim saved.
  • Stages: simulate_airflow(stage=...) solves another stage from its inputs and escape_routes(stage=...) checks its escape routes; the other tools use the saved results, which belong to the saved stage.
  • Closing an airway (edit_airways, field Closed) writes it the way Ventsim stores closed airways in the examples: resistance type 1, resistance 1000.

Leakage: in these examples leakage paths are ordinary high-resistance airways, already in the network solve; nothing else is needed for them.

Editing geometry (experimental)

edit_airways accepts Width, Height, Length and kFactor. Area and perimeter follow the airway shape (rectangle, round; other profiles are scaled) and Resistance Total is scaled with the Atkinson relation R ~ k * P * L / A^3, so shock and density factors Ventsim folded into it are kept in proportion. A new friction factor is stored as a custom value and a new length as a custom resistance, because Ventsim recomputes AUTO resistances from the end coordinates and the friction preset (see "Checked in Ventsim"). add_airways copies an existing airway to new end points; it does not copy fans, fixed flows or pressures, heat or gas sources. A new end joins the network where it meets an existing airway end (not at a surface connection, which it would close); an end that meets nothing is a dead end unless listed in open_ends. An airway whose two ends meet the same junctions as an existing one is refused: Ventsim rejects it as a duplicate. For twin drives set Pathways (Ventsim's Parallel Airways) on the existing airway instead; resistance is scaled by (old/new)^2. Run simulate_airflow on the copy for the new airflow.

Model checks (Ventsim warnings)

model_check lists the Ventsim warnings and errors (manual, Appendix E) that can be found from the file before opening it: loose ends without a surface or closed-end setting (no entry / no exit), duplicate airways, zero-length airways, a running fan or fixed flow whose air has no path once closed airways are taken out (operating fan blocked / fix stopped), fans in series, stoppings in series, and conflicting fixed flows on one path. fix_model writes a copy with the safe fixes: duplicates merged into one airway with Pathways and the parallel resistance, air-less loose ends marked Closed End, blocked fans turned off. edit_airways reports issues its edits create (closing an airway that is the only path of a fan, for example).

Checked against Ventsim 6.0.5: the copy with an airway drawn on top of another gives Ventsim's "2 duplicate airway" and model_check reports the same pair; closing the intake of Tutorial2 gives Ventsim's "operating fan blocked" and model_check reports that fan. On the 20 shipped examples it reports no errors; warnings only in HVACDemoB (loose duct ends) and RealMine (stoppings in series). Loose ends that carried air in the saved results are not reported: Ventsim treated those as open. Warnings that need a simulation (stalled or reversed fans, recirculation, density, heat) come from fan_duty_check and recirculation_check.

Fan speed search (experimental)

optimize_fans_tool tries fan speeds on a grid (one fan: every step; several: each fan on the grid if the grid is small, else a common speed factor). A speed set is feasible when the named airways keep their required airflow (min_flow, m³/s) and no airway is pushed outside the velocity limits that the saved state did not already break. Power is computed from the fan curve at the new speed (affinity laws: pressure ∝ speed², flow ∝ speed), divided by the saved efficiency. Limits:

  • Airflow is the what_if solution; pass compressible=True for models Ventsim runs with Compressible Airflows (see below).
  • The search refuses fan airways with a fixed flow, and models where the fan speed does not change the solved airflow at all (Tutorial2's surface fan: the flow stays 115.8 m³/s at 50 % to 100 % speed; not explained yet).
  • Without min_flow or strict it refuses to run: the lowest speed would always win.
  • Checked in Ventsim 6.0.5 on Fire with fan 6 at 75 % (the search's choice): airflow within 0.32 % of our prediction (sum of absolute differences / total). Fan power per fan: fan 6 13.96 kW (Ventsim 13.98), fan 745 28.12 (28.02), fan 781 9.46 (9.48). Saved state (fans at 80, 75, 75 %): 54.31 kW against Ventsim's 54.25 kW.

Checked in Ventsim

Copies written by this server were opened and re-simulated (airflow) in Ventsim DESIGN 6.0.5. What that showed about writing inputs Ventsim keeps:

  • Ventsim recomputes an AUTO resistance (resistance type 0) from airway size, friction preset and the length between the end coordinates every time it simulates. A resistance factor written into such an airway was dropped, and so was a length that differs from the coordinates. Resistance changes (write_results) and length changes (edit_airways) are now written as a custom resistance (type -1), and friction factors as a custom value (kFactor type -1), which Ventsim keeps. Width and height are kept as written.
  • Closing the intake of Tutorial2 stops all airflow in Ventsim as here, and Ventsim reports "operating fan blocked" (now found by model_check).
  • Ventsim puts fans whose airway equation uses total pressure on the curve's total-pressure column; what_if now does the same instead of scaling the static curve (Fire, fan at 90 %: 10.7 % -> 9.5 % of total airflow). The remaining Fire gap is not isolated yet: that copy also carried temperatures written by write_results, which Ventsim uses for density and natural ventilation while what_if keeps those frozen.
  • Ventsim re-simulating Fire unchanged reproduces its saved file within 0.28 %.

Copies with the persistent inputs (custom resistance, friction factor, length, Pathways, merged duplicates, fan speed, Fire without written temperatures) are prepared but not yet re-simulated in Ventsim.

Limits

  • Fire dynamics and dispersion in time-dependent contaminant spread stay in Ventsim.
  • Rock heat: the response to airflow and air temperature (simulate_heat with rock_temp) uses standard correlations (Dittus-Boelter air film, transient rock conduction with age, floor of 1 year), not Ventsim's own rock model, and ignores wet-rock latent heat. Unchanged models are reproduced exactly. Not yet checked against a Ventsim re-run.
  • HVAC: rooms and doors are read (hvac_layout), but building HVAC airflow is not solved.
  • Fan curve pressure at the duty point differs from Ventsim's saved value by about 0.7 % (median); Ventsim applies a correction the file does not hold. Fan airflow is exact.
  • Building HVAC examples (HVACDemo, A, B) are not solved: their ducts connect through room objects the airway table does not hold (hvac_layout reads them).
  • Fixed flows are read from the Branch Flags bit (16 or 4) with QuantityFix. Older files without Branch Flags fall back to matching QuantityFix to the saved flow. Some airways carry a QuantityFix equal to their saved flow without the bit; they now follow the solver (fixed in this version: the Tutorial2 surface fan was frozen at its saved flow).
  • Tested on the 20 example models shipped with Ventsim DESIGN 6 (up to 6,700 airways). Other versions untested.

Contributing

Issues and pull requests are welcome; see CONTRIBUTING.md. Open tasks, grouped by milestone, are in ROADMAP.md. Questions and ideas go to Discussions.

Development

pip install -e ".[test]"
pytest

MIT licence.

Similar modules

Browse Scientific computing