Generally
The subroutines will provide densities η and fugacity coefficients φ for one or two coexisting phases. The densities are obtained through iteration, applying a simple Newton algorithm. The following properties are involved:
You give: | Temperature | T |
pressure | p | |
mole fractions of both phases | xi' and xi'' | |
starting values for the density in bith phases | ηsta' and ηsta'' | |
You get: | densities | η' and η'' |
fugacity coefficients | φi' and φi'' |
The file offered for download represents a compromise between computational effectiveness and transparency in programming. Each user may focus on different aspects and may personalize the subroutines and the structure accordingly.
Structure / Calling sequence of subroutines
The file PC-SAFT-PROP contains 6 subroutines. The calling sequence is illustrated in the scheme below. SUBROUTINE PC-SAFT-PROP is the entrance to all other subroutines. SUBROUTINE PHIEOS calculates the fugacity coefficients and along the way calls PERTPAR, DENSITR and F_EOS. The SUBROUTINE DENSITER will iterate the density and will repeatedly call P_EOS.
What does each subroutine do?
FUGACY | This subroutine serves as an interface (the only interface) between a program that performs phase equilibrium calculations and the part of your program that contain all the PC-SAFT specific subroutines. It calls Subroutine PHIEOS for each phase. |
PHIEOS | Calculates the fugacity coefficient. It calls F_EOS, PERTPAR and DENSITR |
DENSITR | DENSITR iterates the density of one phase. If temperature and pressure are specified, the density is iterated to be consistent with those specifications. DENSITR requires a starting value for the appropriate density. If a vapor-liquid equilibrium is to be calculated, one starting density may be ηsta=10-10 for the vapor phase and ηsta=0.4 for the liquid phase, whereas starting values of ηsta=0.4 are a good approximation for both phases for the case of liquid-liquid equilibria. |
F_EOS | Gives the residual Helmholtz free energy according to the Perturbed-Chain SAFT equation of state. |
P_EOS | Calculates the pressure (in Pa) and the derivative of pressure to density (dp/dη) according to the Perturbed-Chain SAFT equation of state for given values of temperature and density. |
PERTPAR | Provides constants and density independent expressions for the above described subroutines. |