/reaktoro-pse_old

Primary LanguagePythonOtherNOASSERTION

reaktoro-pse introduction

Overview

This is a package for configuring Reaktoro as a gray box model in Pyomo, IDAES-PSE, and WaterTAP modeling libraries. This package is not meant to replace or act as a higher level API for Reaktoro - it is only meant to enable setting up Reaktoro equilibrium problems as blocks on Pyomo models and automate transferring Reaktoro data into Pyomo variables.

Prerequisites

The user must familiarize thyself with Reaktoro options and usage, especially when selecting Reaktoro provided databases, database files, and activity models for aqueous, solid, and gas phases. This package does not automatically select any of these options, and will use ideal models by default.

By default the package will use:

Inputs and outputs of the Reaktoro blocks

The Reaktoro blocks built by this package are designed to solve an equilibrium problem using user provided apparent species or true species, temperature, pressure, and pH, which are broken down to base elements and equilibrated within Reaktoro to provide exact speciation and equilibrium state. Using this state the block can return various information supported by Reaktoro:

Note: Only Reaktoro properties that return a single floating point or real value are supported, as they will be directly matched to a Pyomo Var. Reaktoro functions that return arrays or strings are not supported.

Solvers

To-date, this has only been tested with cyipopt - other solvers have not been tested.

Requesting new features or issues

Please include a minimal example using Reaktoro for your specific feature or issue request if possible. Please also include full traceback for errors the occur.

Compatibility

Reaktoro-pse depends on the following packages and/or versions:

  • Python 3.9 through 3.12
  • Reaktoro 2.12
  • CyIpopt 1.4.1
  • Pyomo>=6.8.0
  • idaes-pse>=2.5.0
  • watertap>=1.0.0 - (required for watertap-cyipopt wrapper only)

Getting started (for contributors)

Prerequisites

  • A Conda distribution compatible with conda-forge, e.g. Miniforge
  • Git (needed by setuptools_scm to set the version dynamically during installation of the Python package distribution)

Installation

git clone https://github.com/watertap-org/reaktoro-pse.git
cd reaktoro-pse
conda create --yes -c conda-forge --name reaktoro-pse-dev python=3.11 reaktoro=2.12.1 cyipopt=1.4.1
conda activate reaktoro-pse-dev
pip install -r requirements-dev.txt

Running tests

conda activate reaktoro-pse-dev
pytest --pyargs reaktoro_pse --verbose

Before committing

black .