Skip to content

Commit

Permalink
refactor doc
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoMVale committed Mar 9, 2024
1 parent 26a6974 commit 4bbae99
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions src/polykin/thermo/acm/nrtl.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class NRTL(ActivityCoefficientModel):
r"""[NRTL](https://en.wikipedia.org/wiki/Non-random_two-liquid_model)
activity coefficient model.
This ACM model is based on the following molar excess Gibbs energy
This model is based on the following molar excess Gibbs energy
expression:
$$ \frac{g^{E}}{RT} =
Expand All @@ -36,32 +36,37 @@ class NRTL(ActivityCoefficientModel):
$\tau_{ii}=0$, and $\alpha_{ij}=\alpha_{ji}$.
In this particular implementation, the model parameters are allowed to
depend on temperature according to the following empirical relationships
depend on temperature according to the following empirical relationship
(as used in Aspen Plus):
\begin{aligned}
\tau_{ij} &= a_{ij} + b_{ij}/T + e_{ij} \ln{T} + f_{ij} T \\
\alpha_{ij} &= c_{ij} + d_{ij}(T - 273.15)
\end{aligned}
**References**
* Renon, H. and Prausnitz, J.M. (1968), Local compositions in thermodynamic
excess functions for liquid mixtures. AIChE J., 14: 135-144.
Parameters
----------
N : int
Number of components.
a : FloatSquareMatrix | None
Matrix (N,N) of parameters, by default 0.
Matrix (NxN) of parameters, by default 0.
b : FloatSquareMatrix | None
Matrix (N,N) of parameters, by default 0.
Matrix (NxN) of parameters, by default 0.
c : FloatSquareMatrix | None
Matrix (N,N) of parameters, by default 0.3. Only the upper triangle
Matrix (NxN) of parameters, by default 0.3. Only the upper triangle
must be supplied.
d : FloatSquareMatrix | None
Matrix (N,N) of parameters, by default 0. Only the upper triangle
Matrix (NxN) of parameters, by default 0. Only the upper triangle
must be supplied.
e : FloatSquareMatrix | None
Matrix (N,N) of parameters, by default 0.
Matrix (NxN) of parameters, by default 0.
f : FloatSquareMatrix | None
Matrix (N,N) of parameters, by default 0.
Matrix (NxN) of parameters, by default 0.
"""

Expand Down Expand Up @@ -166,12 +171,6 @@ def tau(self, T: float) -> FloatSquareMatrix:
def gE(self, T: float, x: FloatVector) -> float:
r"""Molar excess Gibbs energy, $g^{E}$.
$$ \frac{g^{E}}{RT} =
\sum_i x_i \frac{\displaystyle\sum_j x_j \tau_{ji} G_{ji}}
{\displaystyle\sum_j x_j G_{ji}} $$
where $G_{ij}=\exp(-\alpha_{ij} \tau_{ij})$.
Parameters
----------
x : FloatVector
Expand Down Expand Up @@ -222,7 +221,14 @@ def NRTL_gamma(x: FloatVector,
{\left ({\tau_{ij}-\frac{\displaystyle\sum_{k}{x_{k}\tau_{kj}G_{kj}}}
{\displaystyle\sum_{k}{x_{k}G_{kj}}}}\right )} $$
where $G_{ij}=\exp(-\alpha_{ij} \tau_{ij})$.
where $\tau_{ij}$ are the dimensionless interaction parameters,
$\alpha_{ij}$ are the non-randomness parameters, and
$G_{ij}=\exp(-\alpha_{ij} \tau_{ij})$.
**References**
* Renon, H. and Prausnitz, J.M. (1968), Local compositions in thermodynamic
excess functions for liquid mixtures. AIChE J., 14: 135-144.
Parameters
----------
Expand Down

0 comments on commit 4bbae99

Please sign in to comment.