From f0f46e665af6e4529b8e89fd81c913dd42e76f08 Mon Sep 17 00:00:00 2001 From: Ian Bell <ian.bell@nist.gov> Date: Wed, 6 Jul 2022 19:42:15 -0400 Subject: [PATCH] Docs for PC-SAFT --- doc/source/models/PCSAFT.ipynb | 72 +++++++++++++++++++++++++++++++--- 1 file changed, 66 insertions(+), 6 deletions(-) diff --git a/doc/source/models/PCSAFT.ipynb b/doc/source/models/PCSAFT.ipynb index 2a597f2..fa4a409 100644 --- a/doc/source/models/PCSAFT.ipynb +++ b/doc/source/models/PCSAFT.ipynb @@ -2,21 +2,81 @@ "cells": [ { "cell_type": "markdown", - "id": "df447d16", + "id": "f406bbb5", "metadata": {}, "source": [ - "# Cubic EOS\n", + "# PC-SAFT\n", "\n", - "Something about cubic EOS" + "The PC-SAFT implementation in teqp is based on the implementation of Gross and Sadowski (https://doi.org/10.1021/ie0003887), with the typo from their paper fixed. It does NOT include the association contribution, only the dispersive contributions.\n", + "\n", + "The model in teqp requires the user to specify the values of ``sigma``, ``epsilon/kB``, and ``m`` for each substance. A very few substances are hardcoded in teqp, for testing purposes. " ] }, { "cell_type": "code", - "execution_count": null, - "id": "9a884dab", + "execution_count": 7, + "id": "7bbd7129", "metadata": {}, "outputs": [], - "source": [] + "source": [ + "import teqp\n", + "\n", + "TeXkey = 'Gross-IECR-2001'\n", + "ms = [1.0, 1.6069, 2.0020]\n", + "eoverk = [150.03, 191.42, 208.11]\n", + "sigmas = [3.7039, 3.5206, 3.6184]\n", + "\n", + "coeffs = []\n", + "for i in range(len(ms)):\n", + " c = teqp.SAFTCoeffs()\n", + " c.m = ms[i]\n", + " c.epsilon_over_k = eoverk[i]\n", + " c.sigma_Angstrom = sigmas[i]\n", + " coeffs.append(c)\n", + " \n", + "model = teqp.PCSAFTEOS(coeffs)" + ] + }, + { + "cell_type": "markdown", + "id": "578630c8", + "metadata": {}, + "source": [ + "The model parameters can be queried:" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "d4e47e54", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(array([1. , 1.6069, 2.002 ]),\n", + " array([150.03, 191.42, 208.11]),\n", + " array([3.7039, 3.5206, 3.6184]))" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "model.get_m(), model.get_epsilon_over_k_K(), model.get_sigma_Angstrom()" + ] + }, + { + "cell_type": "markdown", + "id": "ca52e844", + "metadata": {}, + "source": [ + "## Superancillary\n", + "\n", + "The superancillary equation for PC-SAFT has been developed, and is much more involved than that of the cubic EOS. As a consequence, the superancillary equation has been provided as a separate package rather than integrating it into to teqp to minimize the computational overhead. It can be installed from PYPI with: ``pip install PCSAFTsuperanc``" + ] } ], "metadata": { -- GitLab