Ethanol dehydration: reactor + separator written as one custom block — a PENG-ROBINSON process flowsheet
Bio-ethanol to ethylene (C₂H₅OH → C₂H₄ + H₂O), the route behind bio-based polyethylene, modeled as a single user-written custom block with two named inlets and two named outlets. The ethanol vapour feed and a dilution-water feed enter on the feed and water ports; the block's own equations convert 80% of the ethanol (xi = 0.8 * (feed.n_ethanol + water.n_ethanol)), send the ethylene and 10% of the water overhead on gas, and the condensed water with the unreacted ethanol out on liquid — a reactor and its quench separator in one model, which no fixed unit op is. Each outlet is flashed through Peng-Robinson at the temperature the model sets (330 K), and the block reports its mass balance: one mole of ethanol makes two moles of product, so moles are not conserved, but mass is, to round-off (46.07 = 28.05 + 18.02 g/mol). Edit the stoichiometry so it makes twice the ethylene and the block warns that the model creates mass. Notes: the 80% conversion and the 10%/5% overhead splits are stated by the model, not computed from kinetics or vapour-liquid equilibrium — this is a custom model a user writes when they have their own correlation, and it is exactly as good as that correlation.
43 views 0 forks
- Rigorous PENG-ROBINSON thermodynamics, solved by the same engine every simulation runs on.
- 1 unit operations modeled: Dehyd.
- Focus areas: Custom block, Named ports, Custom equations, Ethanol to ethylene.
- Thermodynamics
- PENG-ROBINSON
- Components
- ethanol, ethylene, water
- Unit operations
- Dehyd
Opens in a new tab, loaded straight into the app — no setup.
Read the step-by-step guideReproduce 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("custom-block-ethanol-dehydration")
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
Distributed pipeline cool-down (indexed equation model)
A hot gas cools along a buried pipeline — modeled as a custom unit op whose internals are a distributed 1-D indexed equation system, the gPROMS-style array + indexed-equation modeling capability solved by the sandboxed equation engine. Twenty axial segments compute the full temperature profile T[0..20] (the inlet drives the boundary T[0]; each segment loses heat toward the ground temperature); the outlet temperature is the end of that profile. Demonstrates writing a distributed model as one indexed template rather than 20 hand-written equations.
Methanol synthesis reactor duty (Python Script Mode, LHHW kinetics)
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.
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.
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.
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.
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.