Surface tension diagram of a pure substanceΒΆ
[1]:
from feos.si import *
from feos.dft import HelmholtzEnergyFunctional, PhaseDiagram, SurfaceTensionDiagram
from feos.pcsaft import PcSaftParameters
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
sns.set_context('talk')
sns.set_palette('Dark2')
sns.set_style('ticks')
colors = sns.palettes.color_palette('Dark2', 1)
[2]:
parameters = PcSaftParameters.from_json(
substances=['methanol'],
pure_path='../parameters/pcsaft/gross2002.json'
)
functional = HelmholtzEnergyFunctional.pcsaft(parameters)
[3]:
phase_diagram = PhaseDiagram.pure(functional, 150 * KELVIN, 25)
[4]:
st_diagram = SurfaceTensionDiagram(
phase_diagram.states,
n_grid=1024
)
[5]:
sns.lineplot(
y=st_diagram.surface_tension / (MILLI * NEWTON / METER),
x=st_diagram.liquid.temperature / KELVIN
)
sns.scatterplot(
y=st_diagram.surface_tension / (MILLI * NEWTON / METER),
x=st_diagram.liquid.temperature / KELVIN,
clip_on=False
)
sns.despine(offset=10)
plt.xlim(100, 600)
plt.ylim(0, 50)
plt.xlabel(r'$T$ / K')
plt.ylabel(r'$\gamma$ / mN m$^{-1}$');