vle_flash
Vapour-liquid equilibrium of an ideal mixture (Raoult's law, Antoine vapour pressures given as inputs per component): bubble and dew pressure at a temperature, bubble and dew temperature at a pressure, isothermal flash by Rachford-Rice at both, relative volatility; P-x-y and T-x-y csv for a binary.
- Field
- Chemistry
- Version
- 0.1.0
- Runs as
- Compiled (Rust)
- Typical run
- 0.05 s
Compiled from source: run sh packs/install.sh once before admitting it.
Known answers it must pass
r0001pure component, log10 Antoine in kPa and K (A=4, B=600, C=0) at 100 kPa: closed form T = B/(A - log10 P) = 300 K exactly, bubble = dew (rel 10⁻⁹: bisection to neighbouring floats)passed
bubble_temperature_K300 ± 3 × 10⁻⁷300lockedunder 0.01 % of the tolerance useddew_temperature_K300 ± 3 × 10⁻⁷300lockedunder 0.01 % of the tolerance usedboiling_range_K0 ± 10⁻⁹0lockedunder 0.01 % of the tolerance usedpure_boiling_temperature_K.0= 300, within 1.000000 × 10⁻⁹ relativereading not recorded on this pager0002pure component, log10 Antoine in mmHg and degC (A=7, B=1500, C=200) at 101.325 kPa = 760 mmHg (exact by definition): closed form T = B/(A - log10 760) - C + 273.15 = 437.299579924097 K (rel 10⁻⁹)passed
bubble_temperature_K437.3 ± 4.4 × 10⁻⁷437.3lockedunder 0.01 % of the tolerance useddew_temperature_K437.3 ± 4.4 × 10⁻⁷437.3lockedunder 0.01 % of the tolerance usedboiling_range_K0 ± 10⁻⁹0lockedunder 0.01 % of the tolerance usedr0003binary at 300 K with Psat = 100 and 10 kPa by construction (10^(4-600/300), 10^(4-900/300)), z = [0.4, 0.6]: Raoult P_bubble = 46 kPa, y₁ = 40/46 = 20/23; P_dew = 1/(0.4/100 + 0.6/10) = 15.625 kPa, x₁ = 0.0625; α = 10 (closed forms, rel 10⁻⁹)passed
psat_kPa.0= 100, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagepsat_kPa.1= 10, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagebubble_pressure_kPa46 ± 4.6 × 10⁻⁸46lockedunder 0.01 % of the tolerance usedy_at_bubble_pressure.0= 0.869565, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedew_pressure_kPa15.625 ± 1.6 × 10⁻⁸15.625lockedunder 0.01 % of the tolerance usedx_at_dew_pressure.0= 0.0625, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagerelative_volatility.0= 10, within 1.000000 × 10⁻⁹ relativereading not recorded on this pager0004binary flash at 300 K, 25 kPa (K = 4 and 0.4): lever-rule closed form x₁ = (1 - K₂)/(K₁ - K₂) = 1/6, y₁ = 2/3, b = (z₁ - x₁)/(y₁ - x₁) = 7/15; z = (1 - b) x + b y (rel 10⁻⁹; balance abs 10⁻¹²)passed
phase= two-phasetwo-phaselockedexact matchvapor_fraction0.466667 ± 4.7 × 10⁻¹⁰0.466667lockedunder 0.01 % of the tolerance usedx.0= 0.166667, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagey.0= 0.666667, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagek_values.0= 4, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagematerial_balance_residual0 ± 10⁻¹²5.55112 × 10⁻¹⁷lockedunder 0.01 % of the tolerance usedr0005binary flash at its own bubble pressure (300 K, 46 kPa from the closed form above): vapour fraction 0, incipient vapour y₁ = 20/23 (abs 10⁻⁹ on b, rel 10⁻⁹ on y₁)passed
vapor_fraction0 ± 10⁻⁹0lockedunder 0.01 % of the tolerance usedy.0= 0.869565, within 1.000000 × 10⁻⁹ relativereading not recorded on this pager0006binary flash at its own dew pressure (300 K, 15.625 kPa from the closed form above): vapour fraction 1, incipient liquid x₁ = 0.0625 (abs 10⁻⁹ on b, rel 10⁻⁹ on x₁)passed
vapor_fraction1 ± 10⁻⁹1lockedunder 0.01 % of the tolerance usedx.0= 0.0625, within 1.000000 × 10⁻⁹ relativereading not recorded on this pager0007binary at 50 kPa with equal B (constant α = 10^(A₁-A₂) = 10), z = [0.5, 0.5]: closed forms T_bubble = B/log10((x₁ 10^A₁ + x₂ 10^A₂)/P) = 600/log10(110), T_dew = -B/log10(P (y₁ 10^-A₁ + y₂ 10^-A₂)) = -600/log10(0.0275), y₁ = 10/11, x₁ = 1/11 (rel 10⁻⁹)passed
bubble_temperature_K293.917 ± 2.9 × 10⁻⁷293.917lockedunder 0.01 % of the tolerance useddew_temperature_K384.451 ± 3.8 × 10⁻⁷384.451lockedunder 0.01 % of the tolerance usedy_at_bubble_temperature.0= 0.909091, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagex_at_dew_temperature.0= 0.090909, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagerelative_volatility_at_bubble.0= 10, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagerelative_volatility_at_dew.0= 10, within 1.000000 × 10⁻⁹ relativereading not recorded on this pager0008ternary Rachford-Rice, exact by construction: Psat = 100, 10, 1 kPa at 300 K, P = 10 kPa (K = 10, 1, 0.1); x = (0.05, 0.45, 0.5), y = K x = (0.5, 0.45, 0.05), b = 0.25 give z = (1-b) x + b y = (0.1625, 0.45, 0.3875); RR is monotonic so b is unique (rel 10⁻⁹)passed
phase= two-phasetwo-phaselockedexact matchvapor_fraction0.25 ± 2.5 × 10⁻¹⁰0.25lockedunder 0.01 % of the tolerance usedx.0= 0.05, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagex.2= 0.5, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagey.0= 0.5, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagey.2= 0.05, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagematerial_balance_residual0 ± 10⁻¹²4.16334 × 10⁻¹⁷lockedunder 0.01 % of the tolerance used
Each line is one reading the kernel checked. The bright band is the tolerance; the needle is the value the instrument actually returned when it was admitted. A needle near the centre line used little of its tolerance.
Inputs
| Name | Unit | Default | Meaning |
|---|---|---|---|
components | One object per component: {name, A, B, C, T_min, T_max}, with log P = A - B / (T + C) in the convention set by antoine_log, antoine_pressure_unit and antoine_temperature_unit. T_min and T_max (optional) are the validity range of the fit, in the Antoine temperature unit. Coefficients are the caller's data: nothing is tabulated in the instrument. | ||
z | 1 | Overall mole fractions, one per component in the same order, summing to 1 (within 10⁻⁶, then normalised). May be left out for a single component. | |
temperature_K | K | Temperature. Alone: bubble and dew pressure. With pressure_kPa: also the isothermal flash. | |
pressure_kPa | kPa | Absolute pressure (1 atm = 101.325 kPa). Alone: bubble and dew temperature. With temperature_K: also the isothermal flash. | |
antoine_log | log10 | log10 for log10(P) = A - B/(T + C), ln for ln(P) = A - B/(T + C). | |
antoine_pressure_unit | mmHg | Pressure unit the coefficients were fitted in. mmHg is taken as 1/760 atm (the torr; the conventional mmHg differs by 1.4 × 10⁻⁷ relative). | |
antoine_temperature_unit | C | Temperature unit the coefficients were fitted in: C for degrees Celsius, K for kelvin. | |
reference_component | 1 | Position (1-based) of the component relative volatilities are taken against: alpha_i = Psat_i / Psat_ref. Default: the last component. | |
curve_points | 1 | 41 | Points on the binary P-x-y and T-x-y curves. |
Readings
| Name | Unit | Meaning |
|---|---|---|
mode | at temperature, at pressure, or flash at T and P | |
names | component names, in input order | |
n_components | 1 | |
z | 1 | |
psat_kPa | kPa | pure vapour pressures at temperature_K |
bubble_pressure_kPa | kPa | sum x_i Psat_i, with x = z |
y_at_bubble_pressure | 1 | |
dew_pressure_kPa | kPa | 1 / sum (y_i / Psat_i), with y = z |
x_at_dew_pressure | 1 | |
relative_volatility | 1 | Psat_i / Psat_ref at relative_volatility_at_K |
relative_volatility_at_K | K | |
bubble_temperature_K | K | |
y_at_bubble_temperature | 1 | |
dew_temperature_K | K | |
x_at_dew_temperature | 1 | |
boiling_range_K | K | dew minus bubble temperature |
pure_boiling_temperature_K | K | |
relative_volatility_at_bubble | 1 | |
relative_volatility_at_dew | 1 | |
k_values | 1 | K_i = Psat_i(T) / P |
phase | two-phase, bubble point, dew point, subcooled liquid, superheated vapour, or saturated (pure component on its boiling line: vapour fraction null) | |
vapor_fraction | 1 | Rachford-Rice vapour fraction b (molar) |
x | 1 | liquid mole fractions; null for a superheated vapour |
y | 1 | vapour mole fractions; null for a subcooled liquid |
material_balance_residual | 1 | max_i |z_i - (1 - b) x_i - b y_i| |
sum_x | 1 | |
sum_y | 1 | |
components | per component: z, psat_kPa, boiling_temperature_K, relative_volatility, k_value, x, y | |
antoine_in_range | true when every computed temperature is inside the given Antoine ranges; null when no range was given | |
warnings | temperatures outside a given Antoine range | |
files | components.csv; pxy.csv (binary, at T); txy.csv (binary, at P) |
Try the call
Change a value and the command updates. Nothing runs here; paste it into your terminal or give it to your agent.