Anvil
Engineering computation framework

From equations to engineering tools.

Write physics as plain Python functions, wire them into solvable systems, and get results with automatic unit tracking, from a quick calculation to a coupled multi-physics study.

One command
$ python start_anvil.py
# provisions, launches,
# opens the workbench.
# no setup, no npm.
Specification
Core
numpy · scipy
Python
3.10 +
Relations
166
Domains
33
License
MIT
Three primitives

Learn them once; they scale from a one-liner to a coupled system.

A small core you can hold in your head.

Q

Quantity

A value with units. Dimensions track automatically through every operation: 100+ units, offset temperatures, no silent unit errors.

Relation

Relation

A physics function turned into a reusable, inspectable component. 166 built in across 33 domains, or register your own.

System

System

Wire relations into a solvable graph. Anvil detects coupling and picks the solver: forward, Gauss-Seidel, or Newton.


In practice

Pre-built systems, parametric sweeps, and sensitivity analysis, exportable to CSV or JSON.

Load a system, customize, solve.

rocket_nozzle.pypython
import anvil, numpy as np
from anvil import Q, System

# call a built-in relation directly
r = anvil.R.isentropic_ratios(M=2.0, gamma=1.4)
# {'T0_T': 1.8, 'P0_P': 7.824, 'rho0_rho': 4.347}

# load a pre-built system, set inputs, solve
nozzle = anvil.S.rocket_nozzle.copy()
nozzle.set(P0=10e6, T0=3200)
nozzle.solve_forward().summary()

# sweep in parallel, then rank sensitivities
sweep = nozzle.sweep("P0", np.linspace(5e6, 20e6, 8), parallel=4)
nozzle.sensitivity(outputs=["thrust", "Isp"]).summary()

Everything is plain Python. A relation is an ordinary function; a system is a graph of them.

Anvil orders the computation, tracks units through every step, and switches to an iterative solver when it detects coupling, without you configuring anything.

What's inside

The core needs only NumPy and SciPy. Everything heavier is an optional extra.

Batteries included, dependencies not.

Physics library

166 relations

Aero, propulsion, structures, heat transfer, orbital, thermo, controls, materials, signal, physics, chemistry.
Solvers

Forward to Newton

Coupled systems, ODE/BVP/PDE (RK45, BDF, Radau, Crank-Nicolson), global optimizers.
Studies

Sweeps & sensitivity

Parallel parametric sweeps, normalized sensitivity, formatted tables, CSV/JSON export.
Workbench

Web canvas

Calculator and node-graph editor, live solver residuals, canvases saved as runnable Python.
Adapters

Real tools, wrapped

XFOIL, SU2, OpenFOAM, FEniCSx, NASTRAN, OpenMDAO, Cantera, CoolProp, and gmsh, as native relations.
Registry

Per-project store

Isolated SQLite registry per project; promote your relations to global when ready.
A standing rule

Real physics only. No mock results.

Every adapter runs the actual tool. If a solver or library is not installed, Anvil raises a clear install-hint error instead of returning a plausible-looking approximation. Run anvil doctor to see what is available on your machine. When Anvil gives you a number, it came from real computation.