{ "cells": [ { "cell_type": "markdown", "id": "7a29d335", "metadata": {}, "source": [ "# NRTL\n", "\n", "The Non-Random-Two-Liquid model presented by Renon and Prausnitz.\n", "This model uses local compositions to represent the excess Gibbs energy.\n", "\n", "$$\n", " G^E = nRT \\cdot \\sum_i x_i \\frac{\\sum_j x_j \\tau_{ji} G_{ji}}{\\sum_j x_j G_{ji}}\n", "$$\n", "\n", "with:\n", "\n", "$$\\tau_{ij} = A_{ij} + \\frac{B_{ij}}{T}$$\n", "\n", "$$G_{ij} = exp(-C\\tau_{ij})$$\n", "\n", "Where $A_{ij}, B_{ij}, \\text{ and } C$ are fittable parameters." ] }, { "cell_type": "code", "execution_count": 4, "id": "3922ec11", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([ 0.08590952, -0.94469266, 0.1460286 ])" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import yaeos\n", "\n", "\n", "aij = [\n", " [0.0, -0.801, -0.351],\n", " [-0.523, 0.0, 0.214],\n", " [0.127, 0.211, 0.0],\n", "]\n", "\n", "bij = [\n", " [0.0, -586.1, 246.2],\n", " [301.2, 0.0, -104.2],\n", " [150.23, -114.78, 0.0],\n", "]\n", "\n", "cij = [\n", " [0.0, 0.3, 0.3],\n", " [0.3, 0.0, 0.3],\n", " [0.3, 0.3, 0.0],\n", "]\n", "\n", "model = yaeos.NRTL(aij, bij, cij)\n", "\n", "n = [2.0, 2.0, 8.0] # number of moles [mol]\n", "T = 298.15 # Temperature [K]\n", "\n", "model.ln_gamma(n, T)" ] } ], "metadata": { "kernelspec": { "display_name": "yaeos", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.12" } }, "nbformat": 4, "nbformat_minor": 5 }