Open source · Differentiable · Julia
Set up a capture process in a few lines, from a published case or from its parts. Simulate it in seconds, and let exact gradients steer purity, recovery and energy to the best operating point.
Today's units are fixed beds of adsorbent, for pressure and vacuum swing adsorption. The framework is built for more.
The four-step VSA of Haghpanah et al. (2013), from Mocca's library to an optimised design.
Read a process from the library, or build it from its gas, adsorbent, column, flowsheet and cycle, in Julia or a JSON file.
using Mocca, Mocca.Units
process = read_process(
"haghpanah_2013_four_stage_vsa")
process[:P_L] = 0.05barRun the cycle to its steady state and measure it, with plots, stream tables and spreadsheets.
result = cyclic_steady_state(process)
perf = performance(result)Every result is differentiable. Adjoint gradients with respect to any setting drive a gradient-based optimiser.
add_variable!(process, :P_L,
("evacuation", :to))
optimise!(process;
maximise = :recovery,
at_least = (purity = 0.9,))The first run of a session compiles for a few minutes; after that a simulation takes seconds.
Each kind of unit is its own module on a shared core. The flowsheet, the solvers, the performance measures and the gradients work the same for every unit, so a new kind of unit gets all of them.
Packed columns cycled through pressure and vacuum swing steps: PSA, VSA, equalisation, several beds, layered adsorbents.
Sorbent that flows through adsorption and regeneration sections and back, such as moving-bed temperature swing adsorption.
Adsorbent wheels that turn through adsorption and regeneration sectors.
Membrane modules that let CO₂ through faster than N₂, alone or in stages.
Gas–liquid contactors for solvent-based capture, with packing or trays.
A new unit implements a small set of functions: its ports, its balances and how it exchanges streams with its neighbours. See Extending Mocca.
The library holds fixed-bed adsorption processes so far. Read any of them with read_process, change a setting and run it. Bars show each bed's steps over one cycle, to scale. How Mocca's results compare with the papers
One bed, dry flue gas. The reference case of these docs.
The beds pass gas to each other through their tops instead of sending it to the vacuum pump.
Water builds up over hundreds of cycles; Newton's method still finds the steady state.
A silica gel bed takes out the water before the zeolite bed captures the CO₂.
| For every process | |
|---|---|
| Flowsheets | Any number of units, connected to feeds, products and each other through valves, flow controllers and streams. |
| Design | Adjoint gradients of purity, recovery, energy and productivity with respect to step durations, pressures, flow rates and model parameters; gradient-based optimisation with bounds and constraints. |
| Operation | Cycles of steps run in sequence or side by side in several units, solved to their cyclic steady state by Newton's method, with GMRES and grid sequencing on fine grids. |
| Results | Stream tables, profiles and histories as CSV files in engineering units (bara, °C, mol%, kg/h). Results and plots |
| Fixed-bed adsorption unit | |
| Bed | One-dimensional, axially dispersed plug flow through a packed column, Darcy's law for the pressure drop, a linear driving force for mass transfer, and an energy balance with the column wall (or an adiabatic or isothermal bed). Model equations |
| Isotherms | Multicomponent dual-site and single-site Langmuir, with a library of published adsorbents (zeolite 13X, silica gel). |
| Steps | Pressurisation (with feed or light product), adsorption, blowdown, evacuation, purge, pressure equalisation and idle. |
| Not yet | Temperature swing (heated or cooled steps), the inertial (Ergun) term of the pressure drop, other isotherm models (add your own with register_isotherm!). |
Each example is a script you can download and run, or open as a notebook.
Your own gas, adsorbent, column and cycle, from scratch.
BasicsA single adsorption step, and what the heat of adsorption does to it.
FlowsheetsTwo beds working in turn, and what the equalisation is worth.
LiteratureThe processes of Krishnamurthy et al. (2014), against the paper.
DesignHow each setting moves purity and recovery, checked against finite differences.
DesignGradient-based optimisation of a cyclic process.