chepta
v0.4.0
Published
Chemical process simulation built for AI chat artifacts, starting with phase equilibria.
Maintainers
Readme
CHEPTA
Chemical Engineering Process Tools for Agents. Formerly Fugacity: the project was renamed in version 0.3.0.
Open chemical process simulation built for AI chats which aims to grow for support of AI Process Design. Ask your assistant (ChatGPT, Claude, Gemini or another) for a phase diagram, and it opens a live interface that calculates right in the chat, in your browser. CHEPTA started with vapour-liquid equilibria, simple flowsheets and will grow through volunteer contributions, one tested layer at a time, toward a more complex tool, which engineers can use to take faster decisions.
Try the workbench now: https://fairedose.github.io/CHEPTA/ (runs in your browser, nothing to install).

Status: early (v0.4.0). 174 components, activity models and cubic equations of state, pure-component properties, steam tables and P-h, T-s and h-s charts, the flash unit, heat exchangers (pre-sizing and rating), and flowsheets with pumps, valves, compressors, expanders and energy streams, in a workbench with files that can be exported or saved. Results are real model predictions. They are calculated with published thermodynamic models and parameters; the workbench shows the source and quality tier of each one. As with any simulator, check them against measured data before you use them for design.
Where it's going (roadmap): today phase equilibria, properties, flash, streams, unit operations -> next : reaction engineering, distillation and more complex flowsheets, growing towards models of all the common units, with bridges to spreadsheets, reports and other simulators → then cost engineering (equipment sizing, capital and operating cost, cost per kg of product) → and the big ambition, agentic process design: AI agents read the open literature, build flowsheets for several process routes, simulate and cost them, and tell you which route is best and why, with every number traced to its source for an engineer to check.
Try it in your chat (30 seconds)
Paste one of these into your assistant (the last two need one that can open web links).
Load the workbench (the assistant opens no link; the workbench opens empty and you choose the components):
Read https://fairedose.github.io/CHEPTA/use.md and open the CHEPTA workbench as an artefact in this chat.
Load it with your components:
Read https://fairedose.github.io/CHEPTA/use.md and follow it. Load the CHEPTA workbench with methanol, acetone and chloroform at 1 atm.
Ask for a property value:
Read https://fairedose.github.io/CHEPTA/use.md and follow it. What are the density and viscosity of liquid water at 80 °C and 1 bar? Give the source of each value.
(CHEPTA answers 971.8 kg/m³ and 0.354 mPa·s, from IAPWS-IF97 and the IAPWS viscosity release.) For the first, the assistant writes a few lines that load CHEPTA, and the workbench opens live in the chat (tested in Claude artifacts; other chats: compatibility). To have it always at hand, install the CHEPTA skill once: the steps for Claude, ChatGPT, Claude Code and Codex, and one line for the custom instructions of other assistants, are at https://fairedose.github.io/CHEPTA/install. The skill itself is https://fairedose.github.io/CHEPTA/skill.zip. Then just ask, for example "Open the CHEPTA workbench with ethanol and water".
What it does today
| | | |---|---| | Components | liquids, gases and few solids: around 174 compounds which can grow fast | | Pure-component properties | vapour pressure, liquid density, heat capacity (liquid and ideal gas), heat of vaporization, viscosity and thermal conductivity (liquid and vapour), surface tension, enthalpy; each with its source, range and fit deviation | | Water and steam | IAPWS-IF97 (all regions), IAPWS viscosity (2008) and thermal conductivity (2011) | | Binary parameters | NRTL/UNIQUAC for > 200 pairs, each labelled fitted to data or databank; Peng–Robinson and SRK k_ij for >120 pairs; Henry constants for 10 gases in water | | Models | NRTL, UNIQUAC, ideal (with acetic acid dimerization); Peng–Robinson, SRK | | Calculations | bubble temperature and pressure, T-x-y, P-x-y, ternary grids, residue curves, azeotropes, liquid phase-split check, with every model (activity models and PR/SRK); flash (T-P, P-H, P-VF, T-VF, heat duty) with vapour, liquid, two liquids, or vapour + two liquids (NRTL, UNIQUAC); with PR/SRK bubble and dew points with a stability test; gas solubility in water | | Interface | Workbench with a ribbon. Try it :) |
A full ternary map (861 bubble points plus ten residue curves) takes well under a second in the browser. If a pair has no parameters yet, the interface says which one. Looks Amazing, try it! :)
In any web page:
<div id="app"></div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chepta.js"></script>
<script>
CHEPTA.app("#app", { start: "ternary", components: ["methanol", "acetone", "chloroform"] });
// or a single view: CHEPTA.mount("#app", { components: ["water", "acetic acid", "ethylene glycol"] });
</script>From code (K, kPa, mole fractions):
const s = CHEPTA.system({ components: ["water", "acetic acid"], model: "UNIQUAC" });
s.bubbleT([0.5, 0.5], 101.325); // { T: 376.36, y: [0.645, 0.355], gamma: [1.306, 1.164] }
s.dewT([0.5, 0.5], 101.325); // { T: 378.91, x: [0.333, 0.667], gamma, ... }
// activity model for the liquid, Peng-Robinson or SRK for the vapour
CHEPTA.system({ components: ["ethanol", "water"], model: "NRTL", vapour: "PR" }).bubbleT([0.5, 0.5], 1500);
// mixture enthalpy, J/mol, reference ideal gas at 298.15 K
CHEPTA.system({ components: ["ethanol", "water"], model: "NRTL" }).enthalpy("liquid", 350, 101.325, [0.5, 0.5]);
// flash: { z, T, P }, { z, P, H }, { z, P, VF } or { z, T, VF }; feed conditions add the heat duty
CHEPTA.system({ components: ["ethanol", "water"], model: "NRTL" })
.flash({ z: [0.4, 0.6], T: 355, P: 101.325 }, { feed: { T: 298.15, P: 101.325 } });
// { T, P, VF: 0.479, H_J_mol, phases: [{ type, fraction, composition, h_J_mol }, ...], duty_J_mol: 24582, warnings, sources }
// two liquids: water + ethyl acetate boil at their three-phase point, 343.76 K (NRTL)
CHEPTA.system({ components: ["water", "ethyl acetate"], model: "NRTL" }).flash({ z: [0.5, 0.5], P: 101.325, VF: 0.2 });
// phases: vapour 0.2, liquid "Ethyl acetate-rich" 0.450, liquid "Water-rich" 0.350
s.azeotropes(101.325); // [{ x, T, type }]
// errors carry a code: BAD_INPUT, OUT_OF_RANGE, MISSING_DATA, NO_CONVERGENCE, PHASE_SPLIT, NOT_AVAILABLE
try { s.bubbleT([0.5, 0.5, 0], 101.325); } catch (e) { e.code; } // "BAD_INPUT"
CHEPTA.pure("water").tsat(101.325); // 373.1243 K (IAPWS-IF97)
CHEPTA.pure("benzene").props(298.15, 101.325); // { phase, rho_kg_m3, cp_J_molK, h_J_mol, mu_Pa_s, k_W_mK, sources, notes }
CHEPTA.steam(573.15, 1000); // { region: 2, h_kJ_kg: 3051.7, v_m3_kg: 0.25798, ... }
// your own data (tier "user"), for this call only: a record the databank lacks, your own components and pairs
const mine = { properties: { "lactic acid": { liquidDensity: { equation: "DIPPR100", coefficients: { A: 0, B: 0 },
units: "kg/m3", Tmin_K: 290, Tmax_K: 360, source: { name: "own measurement" } } } } }; // your numbers here
CHEPTA.pure("lactic acid", { userData: mine }).property("liquidDensity", 300);
CHEPTA.userDataDoc(mine, { title: "Our lab data" }); // a My data file; a project keeps its own copy as "user_data"
const g = CHEPTA.system({ components: ["methane", "ethane"], model: "PR" });
g.bubbleP([0.3, 0.7], 200); // { P: 1618.1, y: [0.862, 0.138], stability, warnings }
CHEPTA.gasSolubility("oxygen", 298.15, 21.2); // mole fraction in water, 4.86e-6Property explorer in a page:
<script>
CHEPTA.mountProperties("#app", { component: "water", property: "enthalpy", pressures_kPa: [100, 1000] });
</script>More in examples/ and ai/instructions/use-chepta.md.
Contribute
You bring the engineering judgement, your AI assistant does the typing; you don't need to program. Two ways:
- Talk to your assistant, then submit a form: a proposal, data, or a bug.
- Join as a contributor (anyone can) and let your coding agent open pull requests.
Start with CONTRIBUTING.md. The rules are in AGENTS.md: only sources anyone can read for free, every number cited and checked by a person, every change reviewed by someone other than its author.
More
- docs/README.md: every document by topic, with one page each for the thermodynamic models, the equilibrium algorithms and the flowsheet
- docs/DECISIONS.md: what has been decided and what is pending
- ARCHITECTURE.md: the layers from data to flowsheet and the data quality tiers
- ROADMAP.md: what comes next
- GOVERNANCE.md and SECURITY.md: how decisions are made and how the project is protected
How we know the numbers are right
Every model is checked automatically on each change (npm test):
| Check | Result |
|---|---|
| JavaScript engine vs. an independent Python implementation, 446 bubble points in 3 ternaries and 9 binaries | agree to 1e-7 K |
| 10 binary azeotropes at 1 atm vs. handbook values | NRTL within 0.4 K and 0.02 in x; UNIQUAC within 1 K and 0.05 |
| Methanol + acetone + chloroform ternary saddle azeotrope | NRTL 57.1 °C vs. 57.5 °C |
| Acetic acid + ethylene glycol vs. Schmid et al. (2007), P-x at 363.15 K | AAD 1.2 % (NRTL), 0.9 % (UNIQUAC) |
| Water + ethylene glycol vs. T-x-y data at 760 mmHg | AAD 3.0 K (NRTL), 2.6 K (UNIQUAC), within the data scatter |
| Pure-component boiling points at 1 atm | within 0.2 K |
| Steam tables vs. the IAPWS verification tables (IF97, viscosity, thermal conductivity) | all values within 1e-8 relative or to the printed digits |
| Property correlations vs. their sources (CoolProp, ChemSep, NIST WebBook) | within 1 % (thermodynamic) and 3 % (transport); liquid cp and heats of vaporization vs. measured NIST data within about 2 % (worst: ethyl acetate liquid cp, +2.0 %) |
| Peng–Robinson and SRK vs. the thermo library and an independent Python implementation | Z, ln φ, bubble and dew points to about 1e-9 |
| Peng–Robinson vs. nitrogen + methane data (Janisch 2007, ThermoML Archive) | average deviation 1.9 % in P |
| Henry constants vs. the IAPWS G7-04 check table | 18 of 18 values reproduced |
On every pull request an engineering report compares about 320 results with independent references (CoolProp, NIST, handbook azeotropes) and posts the table as a comment, so reviewers judge engineering results, not code.
The source of every parameter is recorded next to it in
src/data/ and shown under every diagram; licenses in
src/data/LICENSES.md.
Known limits: the shaded two-liquid region of the diagrams is the spinodal only, so the real two-liquid region is wider (the flash finds the real one); two liquids with Peng–Robinson or SRK are not calculated yet; the UNIQUAC databank set is less accurate than NRTL for some systems (acetone + chloroform + methanol); no ternary VLE data exist yet to check water + acetic acid + ethylene glycol; acetic acid and alcohols or glycols slowly esterify, which the model does not include. Cubic equations of state give poor liquid densities and underestimate the residual enthalpy of polar vapours (methanol, acetone) by 27–45 %; most pairs have no k_ij yet (treated as 0, with a warning). Liquid properties are at saturation (pressure effect neglected); acetic acid liquid enthalpy is not given until association is included.
License
Code: MIT. Data: under the license of its source, see src/data/LICENSES.md.
The repository therefore carries two licences on purpose: the MIT license (LICENSE) for CHEPTA's own code, and the licences of the redistributed data, chiefly the Artistic License 2.0 of the ChemSep databank, whose text must travel with the data it covers (src/data/LICENSES.md).
Your files and results are yours. Project files, flowsheets, exports (CSV, Excel) and the numbers and diagrams you make with CHEPTA belong to the people who make them. The MIT license covers the CHEPTA software, not what you create with it: CHEPTA claims no rights in your inputs or results and puts no conditions on their use, commercial use included. Exports may repeat a few values from CHEPTA's data (for example molar masses); their sources are listed in src/data/LICENSES.md.
