TutorialVersion 0.4.1
Build and inspect an ideal Water/Ethanol flash
Use a structured BioSTEAM spec with explicit ideal thermodynamics and compare the phase split with the public contract test.
1. Build the structured flash
json
{
"id": "ideal_flash_probe",
"thermo": ["Water", "Ethanol"],
"thermo_model": "ideal",
"streams": [{
"id": "feed",
"flows": {"Water": 50, "Ethanol": 50},
"units": "kmol/hr",
"T": 363.15,
"P": 101325
}],
"units": [{
"type": "Flash",
"id": "F1",
"ins": ["feed"],
"outs": ["vapor", "liquid"],
"params": {"T": 363.15, "P": 101325}
}],
"attach_tea": false
}Pass this object to build_system_from_spec. Explicit thermo_model = ideal installs ideal activity and fugacity coefficients for a transparent Raoult-law benchmark.
2. Inspect VLE
text
get_vle_results(result_id=..., stream_id="feed", pressure_Pa=100000)The public contract test requires Water/Ethanol components, a 0.5 Water liquid mole fraction at the bubble calculation basis, and a bubble temperature between 350 and 370 K.
3. Check the flash phase split
text
get_stream_results(result_id=..., stream_id="vapor")
get_stream_results(result_id=..., stream_id="liquid")| Quantity | Qualified value |
|---|---|
| Vapor fraction β | 0.7219168857 |
| Water mole fraction in vapor | 0.4450775696 |
| Water mole fraction in liquid | 0.6425812206 |
These values are frozen software-contract values from the public 0.4.1 test suite. They verify the ideal-thermo wrapper path, not the fidelity of ideal thermodynamics for a real Water/Ethanol separation.
4. Dispose the stored result
text
dispose_result(result_id=...)