Vapor-Liquid Equilibrium Property Models (Ideal Gas - Non-ideal Liquids)#

This property package supports phase equilibrium calucations with a smooth phase transition formulation that makes it amenable for equation oriented optimization. The gas phase is assumed to be ideal and for the liquid phase, the package supports an ideal liquid or a non-ideal liquid using an activity coefficient model. To compute the activity coefficient, the package currently supports the Non Random Two Liquid Model (NRTL) or the Wilson model. Therefore, this property package supports the following combinations for gas-liquid mixtures for VLE calculations:

  1. Ideal (vapor) - Ideal (liquid)

  2. Ideal (vapor) - NRTL (liquid)

  3. Ideal (vapor) - Wilson (liquid)

Flow basis: Molar

Units: SI units

State Variables:

The state block supports the following two sets of state variables:

Option 1 - “FTPz”:

  • Total molar flow rate (mol/s) - flow_mol
  • Temperature (K) - temperature
  • Pressure (Pa) - pressure
  • Mole fraction of the mixture - mole_frac_comp

Option 2 - “FcTP”:

  • Component molar flow rate (mol/s) - flow_mol_comp
  • Temperature (K) - temperature
  • Pressure (Pa) - pressure

The user can specify the choice of state variables while instantiating the parameter block. See the Inputs section for more details.

Support for other combinations of state variables will be made available in the future.

Inputs#

When instantiating the parameter block that uses this particular state block, 2 arguments can be passed:

  • valid_phase - "Liq" or "Vap" or ("Liq", "Vap") or ("Vap", "Liq")
  • activity_coeff_model - "Ideal" or "NRTL" or "Wilson"
  • state_vars - "FTPz" or "FcTP"

The valid_phase argument denotes the valid phases for a given set of inlet conditions. For example, if the user knows a priori that the it will only be a single phase (for example liquid only), then it is best not to include the complex flash equilibrium constraints in the model. If the user does not specify any option, then the package defaults to a 2 phase assumption meaning that the constraints to compute the phase equilibrium will be computed.

The activity_coeff_model denotes the liquid phase assumption to be used. If the user does not specify any option, then the package defaults to assuming an ideal liquid assumption.

The state_vars denotes the preferred set of state variables to be used. If the user does not specify any option, then the package defaults to using the total flow, mixture mole fraction, temperature and pressure as the state variables.

Degrees of Freedom#

The number of degrees of freedom that need to be fixed to yield a square problem (i.e. degrees of freedom = 0) depends on the options selected. The following table provides a summary of the variables to be fixed and also the corresponding variable names in the model.

Property Model Type

State variables

Additional Variables

Total number of variables

Ideal (vapor) - Ideal (liquid)

flow_mol, temperature, pressure, mole_frac_comp

None

3 + \(N_{c}\)

Ideal (vapor) - NRTL (liquid)

flow_mol, temperature, pressure, mole_frac_comp

alpha, tau

3 + \(N_{c}\) + \(2N_{c}^{2}\)

Ideal (vapor) - Wilson (liquid)

flow_mol, temperature, pressure, mole_frac_comp

vol_mol_comp, tau

3 + \(N_{c}\) + \(2N_{c}^{2}\)

Please refer to reference 3 for recommended values for tau.

VLE Model with Smooth Phase Transition#

The flash equations consists of the following equations depending on the choice of state variables selected by the user.

If the state variables are total flow, mole fraction, temperature, and pressure, then the following constraints are implemented:

\[F^{in} = F^{liq} + F^{vap}\]
\[z_{i}^{in}F^{in} = x_{i}^{liq}F^{liq} + y_{i}^{vap}F^{vap}\]

If the state variables are component flow rates, temperature, and pressure, then the following constraints are implemented:

\[F^{in}_{i} = F^{liq}_{i} + F^{vap}_{i}\]

The equilibrium condition, the fugacity of the vapor and liquid phase are defined as follows:

\[f_{i}^{vap} = f_{i}^{liq}\]
\[f_{i}^{vap} = y_{i}\phi_{i}P\]
\[f_{i}^{liq} = x_{i}p^{sat}_{i}\nu_{i}\]

The equilibrium constraint is written as a generic constraint such that it can be extended easily for non-ideal gases and liquids. As this property package only supports an ideal gas, the fugacity coefficient (\(\phi_{i}\)) for the vapor phase is 1 and hence the expression reduces to \(y_{i}P\). For the liquid phase, if the ideal option is selected then the activity coefficient (\(\nu_{i}\)) is 1. If an activity coefficient model is selected then corresponding constraints are added to compute the activity coefficient.

Typically, the flash calculations are computed at a given temperature, \(T\). However, the flash calculations become trivial if the given conditions do not fall in the two phase region. For simulation only studies, the user may know a priori the condition of the stream but when the same set of equations are used for optimization, there is a high probability that the specifications can transcend the phase envelope and hence the flash equations included may be trivial in the single phase region (i.e. liquid or vapor only). To circumvent this problem, property packages in IDAES that support VLE will compute the flash calculations at an “equilibrium” temperature \(T_{eq}\). The equilibrium temperature is computed as follows:

\[T_{1} = max(T_{bubble}, T)\]
\[T_{eq} = min(T_{1}, T_{dew})\]

where \(T_{eq}\) is the equilibrium temperature at which flash calculations are computed, \(T\) is the stream temperature, \(T_{1}\) is the intermediate temperature variable, \(T_{bubble}\) is the bubble point temperature of mixture, and \(T_{dew}\) is the dew point temperature of the mixture. Note that, in the above equations, approximations are used for the max and min functions as follows:

\[T_{1} = 0.5{[T + T_{bubble} + \sqrt{(T-T_{bubble})^2 + \epsilon_{1}^2}]}\]
\[T_{eq} = 0.5{[T_{1} + T_{dew} - \sqrt{(T-T_{dew})^2 + \epsilon_{2}^2}]}\]

where \(\epsilon_1\) and \(\epsilon_2\) are smoothing parameters(mutable). The default values are 0.01 and 0.0005 respectively. It is recommended that \(\epsilon_1\) > \(\epsilon_2\). Please refer to reference 4 for more details. Therefore, it can be seen that if the stream temperature is less than that of the bubble point temperature, the VLE calucalations will be computed at the bubble point. Similarly, if the stream temperature is greater than the dew point temperature, then the VLE calculations are computed at the dew point temperature. For all other conditions, the equilibrium calculations will be computed at the actual temperature.

Additional constraints are included in the model to compute the thermodynamic properties such as component saturation pressure, enthalpy, specific heat capacity. Please note that, these constraints are added only if the variable is called for when building the model. This eliminates adding unnecessary constraints to compute properties that are not needed in the model.

The saturation or vapor pressure (pressure_sat) for component \(i\) is computed using the following correlation[1]:

\[\log\frac{P^{sat}}{P_c} = \frac{Ax+Bx^{1.5}+Cx^3+Dx^6}{1-x}\]
\[x=1-\frac{T_{eq}}{T_c}\]

where \(P_c\) is the critical pressure, \(T_c\) is the critical temperature of the component and \(T_{eq}\) is the equilibrium temperature at which the saturation pressure is computed. Please note that when using this expression, \(T_{eq}<T_{c}\) is required and when violated it results in a negative number raised to the power of a fraction.

The specific enthalpy (enthalpy_comp_liq) for component \(i\) is computed using the following expression for the liquid phase:

\[h_{i}^{liq} = \Delta h_{form,Liq,i} + \int_{298.15}^{T}(A+BT+CT^2+DT^3+ET^4)dT\]

The specific enthalpy (enthalpy_comp_vap) for component \(i\) is computed using the following expression for the vapor phase:

\[h_{i}^{vap} = \Delta h_{form,Vap,i} + \int_{298.15}^{T}(A+BT+CT^2+DT^3+ET^4)dT\]

The mixture specific enthapies (enthalpy_liq & enthalpy_vap) are computed using the following expressions for the liquid and vapor phase respectively:

\[H^{liq} = \sum_i{h_{i}^{liq}x_{i}}\]
\[H^{vap} = \sum_i{h_{i}^{vap}y_{i}}\]

Similarly, specific entropies are calculated as follows. The specific entropy (entropy_comp_liq) for component \(i\) is computed using the following expression for the liquid phase:

\[s_{i}^{liq} = \Delta s_{form,Liq,i} + \int_{298.15}^{T}(A/T+B+CT+DT^2+ET^3)dT\]

The specific entropy (entropy_comp_vap) for component \(i\) is computed using the following expression for the vapor phase:

\[s_{i}^{vap} = \Delta s_{form,Vap,i} + \int_{298.15}^{T}(A/T+B+CT+DT^2+ET^3)dT\]

Please refer to references 1 and 2 to get parameters for different components.

Activity Coefficient Model - NRTL#

The activity coefficient for component \(i\) is computed using the following equations when using the Non-Random Two Liquid model [3]:

\[\log{\gamma_i} = \frac{\sum_j{x_j\tau_jG_{ji}}}{\sum_kx_kG_{ki}} + \sum_j\frac{x_jG_{ij}}{\sum_kx_kG_{kj}}\lbrack\tau_{ij} - \frac{\sum_mx_m\tau_{mj}G_{mj}}{\sum_kx_kG_{kj}}\rbrack\]
\[G_{ij}=\exp({-\alpha_{ij}\tau_{ij}})\]

where \(\alpha_{ij}\) is the non-randomness parameter and \(\tau_{ij}\) is the binary interaction parameter for the NRTL model. Note that in the IDAES implementation, these are declared as variables that allows for more flexibility and the ability to use these in a parameter estimation problem. These NRTL model specific variables need to be either fixed for a given component set or need to be estimated from VLE data.

The bubble point is computed by enforcing the following condition:

\[\sum_i{\lbrack z_{i}p^{sat}_{i}(T_{bubble})\nu_{i}}\rbrack-P=0\]

Activity Coefficient Model - Wilson#

The activity coefficient for component \(i\) is computed using the following equations when using the Wilson model [3]:

\[\log{\gamma_i} = 1 - \log{\sum_jx_jG_{ji}} - \sum_j\frac{x_jG_{ij}}{\sum_kx_kG_{kj}}\]
\[G_{ij}=(v_{i}/v_{j})\exp(-\tau_{ij})\]

where \(v_{i}\) is the molar volume of component \(i\) and \(\tau_{ij}\) is the binary interaction parameter. These are Wilson model specific variables that either need to be fixed for a given component set or need to be estimated from VLE data.

The bubble point is computed by enforcing the following condition:

\[\sum_i{\lbrack z_{i}p^{sat}_{i}(T_{bubble})\nu_{i}}\rbrack-P=0\]

List of Variables#

Variable Name

Description

Units

flow_mol

Total molar flow rate

mol/s

mole_frac_comp

Mixture mole fraction indexed by component

None

temperature

Temperature

K

pressure

Pressure

Pa

flow_mol_phase

Molar flow rate indexed by phase

mol/s

mole_frac_phase_comp

Mole fraction indexed by phase and component

None

pressure_sat

Saturation or vapor pressure indexed by component

Pa

density_mol_phase

Molar density indexed by phase

mol/m3

ds_vap

Molar entropy of vaporization

J/mol.K

enthalpy_comp_liq

Liquid molar enthalpy indexed by component

J/mol

enthalpy_comp_vap

Vapor molar enthalpy indexed by component

J/mol

enthalpy_liq

Liquid phase enthalpy

J/mol

enthalpy_vap

Vapor phase enthalpy

J/mol

entropy_comp_liq

Liquid molar entropy indexed by component

J/mol

entropy_comp_vap

Vapor molar entropy indexed by component

J/mol

entrolpy_liq

Liquid phase entropy

J/mol

entropy_vap

Vapor phase entropy

J/mol

temperature_bubble

Bubble point temperature

K

temperature_dew

Dew point temperature

K

_temperature_equilibrium

Temperature at which the VLE is calculated

K

NRTL model specific variables#

Variable Name

Description

Units

alpha

Non-randomness parameter indexed by component and component

None

tau

Binary interaction parameter indexed by component and component

None

activity_coeff_comp

Activity coefficient indexed by component

None

Wilson model specific variables#

Variable Name

Description

Units

vol_mol_comp

Molar volume of component indexed by component

None

tau

Binary interaction parameter indexed by component and component

None

activity_coeff_comp

Activity coefficient indexed by component

None

Initialization#

class idaes.models.properties.activity_coeff_models.activity_coeff_prop_pack.ActivityCoeffInitializer(**kwargs)[source]#

Initializer for Activity Coefficient property packages.

This Initializer uses a hierarchical routine to initialize the property package using the Pyomo solve_strongly_connected_components method is used at each step to converge the problem.

Note that for systems without vapor-liquid equilibrium the generic BlockTriangularizationInitializer is probably sufficient for initializing the property package.

constraint_tolerance

Tolerance for checking constraint convergence

output_level

Set output level for logging messages

solver

Solver to use for initialization

solver_options

Dict of options to pass to solver

solver_writer_config

Dict of writer_config arguments to pass to solver

calculate_variable_options

Dict of options to pass to calc_var_kwds argument in solve_strongly_connected_components method. NOTE: models involving ExternalFunctions must set ‘diff_mode=differentiate.Modes.reverse_numeric’

initialization_routine(model)[source]#

Sequential initialization routine for cubic EoS properties.

Parameters:

model (Block) – model to be initialized

Returns:

None

Config Block Documentation#

class idaes.models.properties.activity_coeff_models.activity_coeff_prop_pack.ActivityCoeffParameterBlock(*args, **kwds)#
Parameters:
  • rule (function) – A rule function or None. Default rule calls build().

  • concrete (bool) – If True, make this a toplevel model. Default - False.

  • ctype (class) –

    Pyomo ctype of the block. Default - pyomo.environ.Block

    Config args

    default_arguments

    Default arguments to use with Property Package

    activity_coeff_model

    Flag indicating the activity coefficient model to be used for the non-ideal liquid, and thus corresponding constraints should be included, default - Ideal liquid. Valid values: { “NRTL” - Non Random Two Liquid Model, “Wilson” - Wilson Liquid Model,}

    state_vars

    Flag indicating the choice for state variables to be used for the state block, and thus corresponding constraints should be included, default - FTPz Valid values: { “FTPx” - Total flow, Temperature, Pressure and Mole fraction, “FcTP” - Component flow, Temperature and Pressure}

    valid_phase

    Flag indicating the valid phase for a given set of conditions, and thus corresponding constraints should be included, default - (“Vap”, “Liq”). Valid values: { “Liq” - Liquid only, “Vap” - Vapor only, (“Vap”, “Liq”) - Vapor-liquid equilibrium, (“Liq”, “Vap”) - Vapor-liquid equilibrium,}

  • initialize (dict) – ProcessBlockData config for individual elements. Keys are BlockData indexes and values are dictionaries with config arguments as keys.

  • idx_map (function) – Function to take the index of a BlockData element and return the index in the initialize dict from which to read arguments. This can be provided to override the default behavior of matching the BlockData index exactly to the index in initialize.

Returns:

(ActivityCoeffParameterBlock) New instance

class idaes.models.properties.activity_coeff_models.activity_coeff_prop_pack.ActivityCoeffStateBlock(*args, **kwds)#
Parameters:
  • rule (function) – A rule function or None. Default rule calls build().

  • concrete (bool) – If True, make this a toplevel model. Default - False.

  • ctype (class) –

    Pyomo ctype of the block. Default - pyomo.environ.Block

    Config args

    parameters

    A reference to an instance of the Property Parameter Block associated with this property package.

    defined_state

    Flag indicating whether the state should be considered fully defined, and thus whether constraints such as sum of mass/mole fractions should be included, default - False. Valid values: { True - state variables will be fully defined, False - state variables will not be fully defined.}

    has_phase_equilibrium

    Flag indicating whether phase equilibrium constraints should be constructed in this state block, default - True. Valid values: { True - StateBlock should calculate phase equilibrium, False - StateBlock should not calculate phase equilibrium.}

  • initialize (dict) – ProcessBlockData config for individual elements. Keys are BlockData indexes and values are dictionaries with config arguments as keys.

  • idx_map (function) – Function to take the index of a BlockData element and return the index in the initialize dict from which to read arguments. This can be provided to override the default behavior of matching the BlockData index exactly to the index in initialize.

Returns:

(ActivityCoeffStateBlock) New instance

class idaes.models.properties.activity_coeff_models.activity_coeff_prop_pack.ActivityCoeffStateBlockData(*args, **kwargs)[source]#

An example property package for ideal VLE.

build()[source]#

Callable method for Block construction.

define_state_vars()[source]#

Define state vars.

get_energy_density_terms(p)[source]#

Create enthalpy density terms.

get_enthalpy_flow_terms(p)[source]#

Create enthalpy flow terms.

get_material_density_terms(p, j)[source]#

Create material density terms.

get_material_flow_basis()[source]#

Declare material flow basis.

get_material_flow_terms(p, j)[source]#

Create material flow terms for control volume.

model_check()[source]#

Model checks for property block.

References#

  1. “The properties of gases and liquids by Robert C. Reid”

  2. “Perry’s Chemical Engineers Handbook by Robert H. Perry”.

  3. H. Renon and J.M. Prausnitz, “Local compositions in thermodynamic excess functions for liquid mixtures.”, AIChE Journal Vol. 14, No.1, 1968.

  4. AP Burgard, JP Eason, JC Eslick, JH Ghouse, A Lee, LT Biegler, DC Miller. “A Smooth, Square Flash Formulation for Equation Oriented Flowsheet Optimization”, Computer Aided Chemical Engineering 44, 871-876, 2018