{ "cells": [ { "cell_type": "markdown", "id": "2f323a90-1e4f-4a27-a495-38dbf8dad3e3", "metadata": {}, "source": [ "# Surface tension of a pure substance " ] }, { "cell_type": "code", "execution_count": 1, "id": "06f40029-24e4-4f91-b502-6b9265818ed8", "metadata": {}, "outputs": [], "source": [ "from feos.si import *\n", "from feos.dft import HelmholtzEnergyFunctional, PhaseEquilibrium, PlanarInterface\n", "from feos.pcsaft import PcSaftParameters\n", "\n", "parameters = PcSaftParameters.from_json(\n", " substances=['methanol'], \n", " pure_path='../parameters/pcsaft/gross2002.json'\n", ")\n", "functional = HelmholtzEnergyFunctional.pcsaft(parameters)" ] }, { "cell_type": "code", "execution_count": 2, "id": "38b998ad-4fd0-4a1e-8fa3-991a13fc0860", "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "||temperature|density|\n", "|-|-|-|\n", "|phase 1|350.00000 K|62.68366 mol/m³|\n", "|phase 2|350.00000 K|23.13883 kmol/m³|\n" ], "text/plain": [ "phase 0: T = 350.00000 K, ρ = 62.68366 mol/m³\n", "phase 1: T = 350.00000 K, ρ = 23.13883 kmol/m³" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "vle = PhaseEquilibrium.pure(functional, 350 * KELVIN)\n", "vle" ] }, { "cell_type": "code", "execution_count": 3, "id": "a48aff0e-cdb8-4553-96ff-57328272c184", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$20.191\\,\\mathrm{\\frac{mN}{m}}$" ], "text/plain": [ "20.1906936921082 mN/m" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "surface_tension_pdgt = (PlanarInterface\n", " .from_pdgt(vle, 1024)\n", " .solve()\n", " .surface_tension)\n", "surface_tension_pdgt" ] }, { "cell_type": "code", "execution_count": 4, "id": "1bb266d3-8dbf-4bbf-833d-42bfee960fe8", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$20.191\\,\\mathrm{\\frac{mN}{m}}$" ], "text/plain": [ "20.190693551809428 mN/m" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "surface_tension_tanh = (PlanarInterface\n", " .from_tanh(vle, 1024, 100 * ANGSTROM, 500 * KELVIN)\n", " .solve()\n", " .surface_tension\n", ")\n", "surface_tension_tanh" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.9.7" } }, "nbformat": 4, "nbformat_minor": 5 }