🧪 PyMemSim
PyMemSim is a Python package for membrane-process simulation, with a current focus on hollow-fiber membrane (HFM) models.
⚙️ Package Functionalities
Current capabilities include:
- Hollow-fiber membrane simulation through the
HFMinterface andcreate_hfm_module(...)factory. - Gas-phase and liquid-phase HFM modeling.
physicalandscalemodeling modes.- Isothermal and non-isothermal simulation setup.
- Dual-side inlet specification (feed/permeate flows, temperatures, pressures).
- Constant-pressure operation for feed and permeate sides.
- Component-wise transport coefficients for gas and liquid systems.
- Solver-based simulation (
scipy.integrate.solve_ivpfor IVP andscipy.integrate.solve_bvpviasolver_bvpfor BVP) with configurable solver options.
📦 Installation
Install from PyPI:
pip install PyMemSim
Quick version check:
import pymemsim as pms
print(pms.__version__)
🚀 Usage Examples
For a complete end-to-end setup (thermo source, options, model inputs, module creation, and simulation), see:
examples/hfm/gas-hfm-exp-1.pyexamples/hfm/gas-hfm-exp-2.py
You can also review:
examples/hfm/liquid-hfm-exp-1.py
🔄 Co-current vs Counter-current (Gas HFM)
The gas HFM examples show how to switch the membrane flow arrangement through:
HollowFiberMembraneOptions(..., flow_pattern="co-current")HollowFiberMembraneOptions(..., flow_pattern="counter-current")
Reference examples:
examples/hfm/gas-hfm-exp-1.py: co-current case (flow_pattern_to_run = "co-current"), solved with IVP-style solver options (Radau,rtol,atol).examples/hfm/gas-hfm-exp-2.py: counter-current case (flow_pattern_to_run = "counter-current"), solved withsolver_bvpand BVP-style options (mesh_points,tol,bc_tol,max_nodes).
You can run either arrangement in both files by changing flow_pattern_to_run to "co-current" or "counter-current".
🛠️ Development Status
PyMemSim is under active development. APIs, model options, and behaviors may change in future releases.
📄 License
This project is licensed under the Apache-2.0 License. You are free to use, modify, and distribute this software in your own applications or projects. However, if you choose to use this app in another app or software, please ensure that my name, Sina Gilassi, remains credited as the original author. This includes retaining any references to the original repository or documentation where applicable. By doing so, you help acknowledge the effort and time invested in creating this project.
❓ FAQ
For any question, contact me on LinkedIn
Metadata
Release files for pymemsim 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pymemsim-0.5.0.tar.gz | 81.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pymemsim-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 171.8 kB
Release files / pymemsim-0.5.0.tar.gz
| Download URL | pymemsim-0.5.0.tar.gz |
|---|---|
| Size | 81.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
93264c0b739e261eeff0560bab5130608af62948ee90ee9f1b1d28569256ad3a
|
|
BLAKE2b-256 checksum How to use checksums |
68f7fbb1e86587331a48e509a661bd76f7f64a7f6b1289817df16458b9af8a64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.8
|
Release files / pymemsim-0.5.0-py3-none-any.whl
| Download URL | pymemsim-0.5.0-py3-none-any.whl |
|---|---|
| Size | 90.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aad097190b1d6a4d6614cd59fd9692eb9d76139916a158a590c110ef29de43f8
|
|
BLAKE2b-256 checksum How to use checksums |
75673fa700845e74c0621572759eb18bd022132b00a4ded99d03f555b7dea348
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.8
|