Getting Started

There are two ways to use Skarstrom. The web workspace needs nothing installed and is the quickest way in. The Python package runs the same engine from Python and the command line.

Both run the open-source Skarstrom engine, samaffleck/skarstrom (Apache-2.0).


1. The web workspace

The workspace runs at skarstrom.co.uk/workspace. The solver is compiled to WebAssembly and runs in your browser tab, so your decks and results stay on your machine. It needs Chrome or Edge 95, Firefox 100 or Safari 15.2, or a later version of one of them.

Create an account

  1. Go to skarstrom.co.uk and click Open the simulator.
  2. The sign-in page opens. If you are new, click Sign up under the form and create your account. Sign-up is self-serve: there is no waiting list and no approval step.
  3. After you sign in or sign up you land in the workspace with a blank deck. If you were already signed in, the same button takes you straight there. To start from an example, open the Examples menu.

The Sign in link at the top right of the site signs you in to your dashboard; once you are signed in it reads Dashboard.

An account is needed to open the workspace; the documentation is public.

Find your way around

The workspace has a menu bar along the top, the Navigator on the left, a central panel that shows whichever Navigator item you select, and editors that dock on the right when you open a layer, an adsorbent, a component or a cycle step. The Navigator items, from top to bottom, follow the order in which you build a model: System Information, Fluid Package, Adsorbents, Column Properties, Cycle Design, Global Variables, Solver, then the study tools Parametric Study, Optimisation and Parameterisation. A green tick or red cross next to each modelling item tells you whether its inputs are complete; hover it for the reason. The Interface Overview describes every panel, and Help → Interactive tutorial walks you through them in the app.

Run your first simulation

The Ward (2022) deck is a single breakthrough experiment: pure CO₂ is fed at 100 cm³/min into a column of activated carbon that starts full of air, for 3000 s.

  1. Click Solver in the Navigator, then Run in the toolbar at the top of the Solver panel. The Solver Log tab reports progress. This deck has one cycle of one step on 60 cells; it took 1.6 s when we ran the same WebAssembly module under Node.js 22 on a shared 4-core Linux machine, so expect a few seconds in a browser.

  2. When the status reads Completed, the Results plot docks on the right. Open the Plotter Options tab of the Solver panel and choose:

    • Plot type: Boundary conditions
    • Step: Feed, Stream: Feed Pressure Boundary Top (the column outlet)
    • Variable group: Component, Variable: Mole Fraction, component CarbonDioxide

    The curve is the outlet CO₂ mole fraction against time since the start of the step: zero while the bed adsorbs CO₂, then a sharp breakthrough. In our run the outlet reached 5 %, 50 % and 95 % CO₂ at 1169 s, 1182 s and 1190 s.

  3. Open the Experimental Data tab and tick Overlay experimental data on the breakthrough plot. The deck carries the measured outlet curve from the paper, which rises through 18 % at 1235 s and 60 % at 1267 s, so the model breaks through about 6 % early. The Validation page lists this comparison for all three flow rates, and the Ward 2022 walkthrough explains how the deck is built.

  4. Change Plot type to Column and X-axis to Position to see profiles along the bed, and drag the Time slider in Plotter Options to watch the CO₂ front and the temperature wave move through the column.

Export CSV and Export PNG above the plot save what is on screen.

Load another example, save your work

  • The Examples menu lists every bundled deck, grouped by paper. The Examples page says what each one is.
  • File → Save… saves the deck as a .json file (a save dialog in Chromium browsers, a download elsewhere) named after its Title, and File → Open… loads one. There is no autosave and nothing is stored on a server, so save before you close the tab. Results are not saved; run again after loading.
  • Edit → Undo / Redo step back through your edits.

Next steps

Work through a tutorial:


2. Python

The skarstrom Python package runs the same engine on the same decks, with a skarstrom command-line tool. It lives in the engine repository. It is not on PyPI yet (pip install skarstrom will work once it is published), so build it from a checkout of samaffleck/skarstrom. You need Python 3.9 or newer, CMake 3.15 or newer and a C++20 compiler:

git clone --recursive https://github.com/samaffleck/skarstrom.git
cd skarstrom
pip install .                      # builds the engine; takes several minutes the first time
skarstrom run Perez2019_A.json --cycles 3      # a shipped example deck
skarstrom params my_deck.json                  # the parameters you can set
import skarstrom

sim = skarstrom.Simulation("my_deck.json")     # a deck saved from the workspace
sim["step[Feed].time"] = 120.0                 # set a parameter by path
result = sim.run()
print(result.status, [(k.component, k.purity, k.recovery) for k in sim.kpis(cycle=-1)])
y = sim.series("mole_fraction", "CarbonDioxide", location="top")   # NumPy arrays

The Python & Command Line page covers parameters, results, isotherm fitting, the CLI and the example notebooks.

To use the engine on its own — the C++ library, its test suite and the bench_solver timing tool — build samaffleck/skarstrom; see Getting Started in the engine documentation. The Numerics page describes what the solver does with a deck.