Skip to main content

PyMemSim is a Python package for modelling of membrane-based separation systems.

Project description

🧪 PyMemSim

PyMemSim

PyPI Downloads PyPI Python Version License

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 HFM interface and create_hfm_module(...) factory.
  • Gas-phase and liquid-phase HFM modeling.
  • physical and scale modeling 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_ivp for IVP and scipy.integrate.solve_bvp via solver_bvp for 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.py
  • examples/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 with solver_bvp and 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymemsim-0.1.1.tar.gz (62.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymemsim-0.1.1-py3-none-any.whl (71.8 kB view details)

Uploaded Python 3

File details

Details for the file pymemsim-0.1.1.tar.gz.

File metadata

  • Download URL: pymemsim-0.1.1.tar.gz
  • Upload date:
  • Size: 62.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for pymemsim-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c787209ce5d3fafa0b64321b98959c6583f3a78840a335ebbb32fe71196fb7ba
MD5 3b6e3e72d842b7dc235ce5c51944bfb7
BLAKE2b-256 cc1dee80c50ab649acc409a29a88b42b3d76072f3ea3fff756ef9295af673193

See more details on using hashes here.

File details

Details for the file pymemsim-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pymemsim-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 71.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for pymemsim-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7b473b5160ec739790b7fbff4e731f4feb34f8f2cdefb1072e480e6dd02a9f76
MD5 1623c4a0f1c8a87c50aba9ad44ce2be2
BLAKE2b-256 eaa5925d5eac140f7c7803ffcec6032d6ee89651f01212e0358956ee507c14c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page