Flowsheet units
Mixer, Splitter and FlashDrum are the stream units a flowsheet needs
around a column and between exchangers. Each is an Equipment with named
ports, so it connects into a Flowsheet like the column and the exchangers.
Example: flashing a benzene/toluene feed
A 50/50 benzene/toluene liquid at 25 C and 1 atm, 100 mol/s, is heated and flashed at 95 C. The drum liquid is split into two equal outlets.
from processpi.components import Benzene, Mixture, Toluene
from processpi.equipment import FlashDrum, Splitter
from processpi.integration.flowsheet import Flowsheet
from processpi.streams import MaterialStream
from processpi.units import MolarFlowRate, Pressure, Temperature
t, p = Temperature(25, "C"), Pressure(1, "atm")
feed = MaterialStream(
"feed",
component=Mixture({Benzene: 0.5, Toluene: 0.5}, temperature=t, pressure=p, phase="liquid"),
temperature=t, pressure=p, molar_flow=MolarFlowRate(100, "mol/s"), phase="liquid",
)
vapor, liquid = MaterialStream("vapor"), MaterialStream("liquid")
product, purge = MaterialStream("product"), MaterialStream("purge")
drum = FlashDrum("V-101", temperature=Temperature(95, "C")) # P: the feed's
split = Splitter("S-101", {"product": 0.5, "purge": 0.5})
fs = Flowsheet("Flash")
fs.connect(feed, drum, "in")
fs.connect(liquid, drum, "liquid", split, "in")
drum.connect_outlet("vapor", vapor)
split.connect_outlet("product", product)
split.connect_outlet("purge", purge)
fs.run()
drum.data key |
Value |
|---|---|
vapor_fraction |
0.4238 |
k_values |
Benzene 1.5472, Toluene 0.6262 |
vapor_composition |
Benzene 0.6280, Toluene 0.3720 |
liquid_composition |
Benzene 0.4059, Toluene 0.5941 |
duty_w |
2426.9 kW (heating from 25 C, then vaporising) |
The streams: vapour 3.5314 kg/s, drum liquid 4.9812 kg/s, each splitter outlet 2.4906 kg/s.
Mixer
Mixer(name, n_inlets=2, inlet_names=None, pressure=None): inlets in1,
in2, ... (or the names given), outlet out. Unconnected and zero-flow
inlets are skipped.
- Moles of every species are conserved exactly.
- Outlet temperature from the energy balance with ideal mixing (no heat of mixing): each inlet's heat capacity is integrated from its own temperature to the outlet temperature.
- Outlet pressure: the lowest inlet pressure, unless
pressureis given. - All inlets must be in the same single phase. If the mixed outlet would boil (or condense) at its state, a warning says a flash is needed.
Splitter
Splitter(name, fractions): inlet in; outlets out1, out2, ... for a
list, or named by the keys of a dict ({"reflux": 0.75, "distillate": 0.25}).
The fractions add up to 1. Every outlet has the inlet's temperature,
pressure, composition and phase.
FlashDrum
FlashDrum(name, temperature=None, pressure=None): inlet in, outlets
vapor and liquid. The drum temperature and pressure default to the
feed's.
- Equilibrium by Raoult's law, K = Psat(T) / P, as the distillation column uses. A component above its critical temperature goes to the vapour.
- The vapour fraction solves the Rachford-Rice equation, Perry's Chemical Engineers' Handbook, 8th ed., Eqs. (13-12) to (13-14), p. 13-15.
- A feed below its bubble point leaves as liquid only, one above its dew point as vapour only; the other outlet carries zero flow.
data["duty_w"]is the heat added, in W, to bring the feed to the drum's state (negative when heat is removed), with ideal mixing.