Skip to content

Commit

Permalink
version and docum
Browse files Browse the repository at this point in the history
  • Loading branch information
fedebenelli committed Dec 4, 2024
1 parent e84f2f8 commit 41d6961
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 63 deletions.
2 changes: 1 addition & 1 deletion fpm.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "yaeos"
version = "2.0.0"
version = "2.1.0"
license = "MPL"
author = "Federico E. Benelli"
maintainer = "federico.benelli@mi.unc.edu.ar"
Expand Down
81 changes: 23 additions & 58 deletions python/docs/source/tutorial/more_calculations.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion python/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project('yaeos', 'c',
version : '1.5.0',
version : '2.1.0',
license: 'MPL',
meson_version: '>=0.64.0',
default_options : ['warning_level=2'],
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ name = "yaeos"
description = "Thermodynamic modelling with Equation of State"
readme = "README.md"
dependencies = ["numpy"]
version = "2.0.0"
version = "2.1.0"
requires-python = ">=3.10"


Expand Down
2 changes: 1 addition & 1 deletion python/yaeos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
relevant constants, procedures and objects to have better access to them.
"""

__version__ = "1.5.0"
__version__ = "2.1.0"

from yaeos.lib import yaeos_c
from yaeos.models.excess_gibbs import NRTL, UNIFACVLE, UNIQUAC
Expand Down
61 changes: 60 additions & 1 deletion python/yaeos/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1082,10 +1082,69 @@ def phase_envelope_pt(

return res

def stability_analysis(self, z, pressure, temperature):
"""Perform stability analysis.
Find all the possible minima values that the :math:`tm` function,
defined by Michelsen and Møllerup.
Parameters
----------
z : array_like
Global mole fractions
pressure : float
Pressure [bar]
temperature : float
Temperature [K]
Returns
-------
dict
Stability analysis result dictionary with keys:
- w_min:
value of the test phase that minimizes
the :math:`tm` function
- tm_min:
minimum value of the :math:`tm` function
- all_mins_w:
all values of :math:`w` that minimize the
:math:`tm` function
"""
(w_min, tm_min, all_mins_w) = yaeos_c.stability_zpt(
id=self.id, z=z, p=pressure, t=temperature
)

return {"w_min": w_min, "tm_min": tm_min, "all_mins_w": all_mins_w}

def stability_tm(self, z, w, pressure, temperature):
"""Calculate the :math:`tm` function.
Calculate the :math:`tm` function, defined by Michelsen and Møllerup.
If this value is negative, it means that the feed with composition `z`
is unstable.
Parameters
----------
z : array_like
Global mole fractions
w : array_like
Test Phase mole fractions
pressure : float
Pressure [bar]
temperature : float
Temperature [K]
Returns
-------
float
Value of the :math:`tm` function
"""
return yaeos_c.tm(id=self.id, z=z, w=w, p=pressure, t=temperature)

def critical_point(self, z, max_iters=100) -> dict:
"""Critical point calculation.
Calculate the critical point of a mixture. At a given composition
Calculate the critical point of a mixture. At a given composition.
Parameters
----------
Expand Down

0 comments on commit 41d6961

Please sign in to comment.