calc
Description
This module contains our thermodynamic calculations. Calculation of pressure, fugacity coefficient, and max density are handled by an Eos object so that these functions can be used with any EOS. The thermodynamics module contains a series of wrapper to handle the inputs and outputs of these functions.
Functions
|
Calculate activity coefficient given T, P, yi, and xi. |
|
Search binary vapor mole fraction combinations for a new estimate that produces a vapor density. |
|
Obtain minimum and maximum pressure values for bubble point calculation. |
|
Obtain min and max pressure values. |
|
Calculate bubble point mole fraction and pressure given system liquid mole fraction and temperature. |
|
Calculate dew point mole fraction and pressure given system vapor mole fraction and temperature. |
|
Binary flash calculation of vapor and liquid mole fractions. |
|
Find liquid mole fraction given pressure, vapor mole fraction, and temperature. |
|
Computes liquid density under system conditions. |
|
Computes liquid fugacity coefficient under system conditions. |
|
Calculate the alternative phase composition given the composition and fugacity coefficients of one phase, and the fugacity coefficients of the target phase. |
|
Computes the saturated pressure, gas and liquid densities for a single component system. |
|
Find vapor mole fraction given pressure, liquid mole fraction, and temperature. |
|
Computes vapor density under system conditions. |
|
Computes vapor fugacity coefficient under system conditions. |
|
For a binary mixture, determine whether the K values will produce properly constrained mole fractions. |
|
Computes the objective value used to determine equilibrium between phases. |
|
Search liquid mole fraction combinations for a new estimate that produces a liquid density. |
|
Search vapor mole fraction combinations for a new estimate that produces a vapor density. |
|
A consistency test where d(ln φ)/dP = (Z-1)/P. |
|
A consistency test where np.sum( xi * d(ln φ)/dn1) = 0 at constant temperature and pressure. |
|
Calculate the solubility parameter based on temperature and composition. |
|
Mixture fugacity coefficient d(ln(φ)) = np.sum(xi*ln(φi)) |
|
Objective function used to search pressure values and solve outer loop of constant temperature bubble point calculations. |
|
Objective function used to search pressure values and solve outer loop of constant temperature dew point calculations. |
|
Objective function for solving for stable vapor mole fraction. |
|
Objective function for solving for stable vapor mole fraction. |
|
Objective function used to calculate the saturation pressure. |
|
Calculate difference between set point pressure and computed pressure for a given density. |
|
Output arrays with specific volume and pressure arrays calculated from the given EOS. |
|
Plot pressure vs. |
|
Fit arrays of specific volume and pressure values to a cubic Univariate Spline. |