MaximaLabs
Back to gallery

Methanol synthesis reactor duty (Python Script Mode, LHHW kinetics) — a PENG-ROBINSON process flowsheet

A CO/H₂ syngas feed enters a custom block written in real, sandboxed Python (flowsim/sandbox/) rather than the AST-restricted equation grammar — the case equation mode structurally can't express: a Langmuir-Hinshelwood-Hougen-Watson rate law (a forward kinetic term over a competitive-adsorption denominator, each term Arrhenius/ van't-Hoff temperature-dependent) evaluated inside a real Python loop over the adsorbing species, driving the exothermic reactor's temperature rise. Partial pressures are computed from the real inlet pressure (pinned via inputs) and representative mole fractions (script_params — composition itself can't be pinned into a script, only flow/T/P, so the fractions are illustrative constants, not read from the flowsheet's actual feed). The kinetic/adsorption/heat-of-reaction constants are likewise illustrative (chosen for a physically plausible rate and duty, not fit to a specific published dataset) — the point is the execution model, not a validated methanol-synthesis kinetic scheme.

119 views 2 forks

FEED
ƒ(x)
RX
OUT
What this showcases
  • Rigorous PENG-ROBINSON thermodynamics, solved by the same engine every simulation runs on.
  • 1 unit operations modeled: RX.
  • Focus areas: Python Script Mode, LHHW kinetics, Sandboxed Python, Custom block.
Specification
Thermodynamics
PENG-ROBINSON
Components
carbon_monoxide, h2
Unit operations
RX
Open in workspace

Opens in a new tab, loaded straight into the app — no setup.

Read the step-by-step guide
Python SDK

Reproduce this exact result from Python — the real client.get_example() → run_and_wait() path, not a mockup.

from flowsim.sdk import FlowSimClient

client = FlowSimClient()
example = client.get_example("lhhw-methanol-synthesis-kinetics")
sim = client.create_simulation(example["title"], example["flowsheet"])
result = client.run_and_wait(sim["id"])

print(result["status"])              # "converged"
streams = client.streams(sim["id"])

Related models

Ludwigshafen, Germany

Polymerization reactor comparison: CSTR cascade vs. tubular (PFR)

The same monomer feed, split 50/50 into two trains at equal total reactor volume: a 3-stage CSTR cascade (each stage blending its own new polymer with the MWD already carried by the stream from the stage before it) versus a single tubular (PFR) reactor. Both converge to a real, different Mn/Mw/PDI — the PFR reaches higher conversion at the same total volume, but its cumulative polydispersity is measurably broader than the cascade's, because chain length drifts continuously with conversion along the tube while each CSTR stage makes its own local production under one fixed monomer concentration. See the 'Polymerization Reactors' docs page for the full reasoning.

Amarillo, Texas, USA

Helium liquefaction (Linde-Hampson cycle)

A Joule-Thomson liquefaction loop: helium is compressed, aftercooled, precooled well below its ~40-51 K JT-inversion temperature, then throttled through a valve into a flash drum that draws off liquid helium while the cold vapor recycles back to the compressor suction — the same JT-cycle physics as the platform's LNG/refrigeration loops, run on a fluid whose inversion curve makes precooling mandatory before the throttle can cool it at all.

Brevik, Norway (Heidelberg Materials Norcem — first full-scale cement CCS)

Cement kiln calcination + CO2 liquefaction

Preheated limestone (CaCO₃) enters an indirectly-heated rotary kiln that calcines it toward CaO, releasing a CO₂-rich off-gas; the gas passes a knockout drum, then is compressed and cooled to liquefy the CO₂ for transport/storage.

Mont Belvieu NGL fractionation complex, Texas, USA

NGL fractionation: single-shell Petlyuk dividing-wall column

A natural-gas-liquids cut (ethane / propane / n-butane) split into three on-spec products by ONE thermally-coupled dividing-wall column instead of two columns in series. This uses the native Petlyuk unit op: a prefractionator whose reflux and boilup are supplied by the main column (the single condenser + single reboiler), solved by an outer Wegstein loop that converges the bidirectional vapor/liquid coupling to self-consistency — the coupling legacy sequential-modular solvers approximate with two connected columns whose recycle fails to converge.

Pekin, Illinois, USA

Ethanol–water distillation

An 8-stage column concentrating ethanol overhead toward the azeotrope (the headline demo).

Tray efficiency — real trays vs ideal stages

The same ethanol–water column solved with a Murphree vapor tray efficiency of 0.7 instead of ideal equilibrium stages. A real sieve/valve tray never reaches full vapor-liquid equilibrium — the vapor leaving it only partly approaches the equilibrium composition with the tray liquid, mixing in un-equilibrated vapor from the tray below: y = E·K·x + (1−E)·y_below (Murphree 1925). At E = 0.7 each of these 12 trays does 70% of an ideal stage's work, so the overhead ethanol is lower than an equilibrium column of the same tray count would predict — which is exactly why a real column needs more trays than a shortcut (ideal-stage) calculation says. Both HYSYS and Aspen RadFrac expose this per-tray efficiency; set murphree_efficiency back to 1.0 to recover the ideal-stage column. The efficiency auto-selects the component-flow Naphtali-Sandholm solver (the reduced-form solvers carry no explicit per-tray VLE row to apply an efficiency to).

Stop fighting legacy software. Build your first flowsheet in 60 seconds.