mozithermoflash
v0.1.4
Published
A TypeScript VLE toolkit for flash and phase-equilibrium calculations on multi-component mixtures.
Maintainers
Readme
MoziThermoFlash
MoziThermoFlash is a TypeScript VLE toolkit for common flash and phase-equilibrium calculations on multi-component mixtures. It is designed to work with mozithermodb model sources and supports both class-based and wrapper-style APIs.
✨ Features
- ✅ Bubble-point pressure
- ✅ Dew-point pressure
- ✅ Bubble-point temperature
- ✅ Dew-point temperature
- ✅ Isothermal flash
- ✅ Flash feasibility check (
is_flashable) - ✅ Raoult and modified-Raoult workflows
- ✅ Optional activity-model hooks (NRTL/UNIQUAC runtime inputs)
📦 Installation
npm install mozithermoflash🧱 Core Idea
This package expects a model_source containing:
dataSourceequationSource
In this repo, those are created in example files like:
examples/model-source-1.tsexamples/model-source.2.ts
🚀 Usage Patterns
Two styles are used in this project:
VLEclass methods (fromsrc/docs/vle.ts)- Core wrapper functions (from
src/core/main.ts)
Class API (VLE)
bubble_pressure(...)dew_pressure(...)bubble_temperature(...)dew_temperature(...)flash_isothermal(...)is_flashable(...)
Wrapper API
calc_bubble_point_pressure(...)calc_dew_point_pressure(...)calc_bubble_point_temperature(...)calc_dew_point_temperature(...)calc_isothermal_flash(...)is_flashable(...)
🧪 Examples
Run examples with tsx:
npx tsx examples/bubble-point-pressure.ts
npx tsx examples/dew-point-pressure.ts
npx tsx examples/bubble-point-temperature.ts
npx tsx examples/dew-point-temperature.ts
npx tsx examples/flash-isothermal.tsOther useful example files:
examples/activity-factory.ts(activity model factory pattern)examples/matrix-model-source.ts(binary-mixture matrix datasource pattern)
🧠 Notes
- Inputs in examples are provided as
[value, unit]tuples (for temperature/pressure). - Component IDs in examples follow
Name-State(e.g.,benzene-l). - For modified-Raoult runs, activity parameters are passed via
kwargs(activity_inputs,activityFactory, or explicitactivity_coefficients).
📄 License
Licensed under the Apache-2.0 License. See LICENSE.
❓ FAQ
For questions, contact Sina Gilassi on LinkedIn.
