Newer
Older
"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. "
"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",
"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]))"
]
},
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"model.get_m(), model.get_epsilon_over_k_K(), model.get_sigma_Angstrom()"
]
},
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
"cell_type": "markdown",
"id": "5cbb382d",
"metadata": {},
"source": [
"## Adjusting k_ij\n",
"\n",
"Fine-tuned values of $k_{ij}$ can be provided when instantiating the model, for Peng-Robinson and SRK. A complete matrix of all the $k_{ij}$ values must be provided. This allows for asymmetric mixing models in which $k_{ij}\\neq k_{ji}$."
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "a32c41b5",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<teqp.teqp.PCSAFTEOS at 0x19478910bf0>"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"k_01 = 0.01; k_10 = k_01\n",
"kmat = [[0,k_01,0],[k_01,0,0],[0,0,0]]\n",
"teqp.PCSAFTEOS(coeffs, kmat)"
]
},
{
"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": {
"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.10.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}