Air-Water Equilibrium (AWE) Property Package
This property package implements property relationships for an aqueous liquid phase in equilibrium with a vapor phase.
- The AWE property package:
contains a liquid and a vapor phase;
sets H2O as the solvent for the liquid phase;
sets air as the solvent for the vapor phase;
uses mass flowrate (kg/s), pressure, and temperature as state variables;
does not support dynamics
Configuration
The AWE property package has several configuration options depending on the user’s preferences.
These are set via a Python dict when building the flowsheet.
Details of the implications of different configuration options are described in a later section.
Option |
Description |
Default |
Required |
Units |
Form |
|---|---|---|---|---|---|
|
Solute names in stream |
User provided |
Yes |
n/a |
|
|
Molecular weight in for solutes in |
User provided |
Yes |
\(\text{kg/}\text{mol}\) |
|
|
Liquid and vapor phase diffusivity data |
User provided |
No |
\(\text{kg/}\text{m s}\) |
|
|
Molar volume data for solutes |
User provided |
No |
\(\text{m/}^3\text{mol}\) |
|
|
Critical molar volume data for solutes |
User provided |
No |
\(\text{m/}^3\text{mol}\) |
|
|
Liquid and vapor phase density data |
|
No |
\(\text{kg/}\text{m}^3\) |
|
|
Liquid and vapor phase dynamic viscosity data |
|
No |
\(\text{Pa}\text{s}\) |
|
|
Dimensionless Henry’s Constant data for solutes |
User provided |
No |
\(\text{dimensionless}\) |
|
|
Boolean to indicate if Henry’s Constant should be temperature adjusted |
|
No |
n/a |
|
|
Standard enthalpy change of dissolution in water data for solutes |
User provided |
No |
\(\text{J/}\text{mol}\) |
|
|
Boiling temperature data for solutes |
User provided |
No |
\(\text{K}\) |
|
|
Charge data for solutes |
User provided |
No |
\(\text{K}\) |
|
|
Approach for liquid diffusivity calculation |
Hayduk-Laudie |
No |
n/a |
|
|
Approach for vapor diffusivity calculation |
Wilke-Lee |
No |
n/a |
|
|
Approach for molar volume calculation |
Tyn-Calus |
No |
n/a |
|
Note
1 default values are for 20C
Sets
The AWE property package contains two phases (Liq and Vap), two solvents (H2O and Air)
and as many solutes as the user provides via solute_list in the configuration.
Many properties in AWE are not calculated for every phase or component provided. Thus, several different indexing sets are created.
Description |
Symbol |
Name |
Indices |
|---|---|---|---|
All components and all solvents |
\(j\) |
|
|
Phases |
\(p\) |
|
|
Solvents |
\(j\) |
|
|
Components in liquid phase |
\(j\) |
|
|
Components in vapor phase |
\(j\) |
|
|
Solutes in liquid phase |
\(j\) |
|
|
Solutes in vapor phase |
\(j\) |
|
|
Solutes in both phases |
\(j\) |
|
|
Components in both phases |
\(j\) |
|
|
State variables
Description |
Symbol |
Variable |
Index |
Units |
|---|---|---|---|---|
Component mass flowrate |
\(M\) |
|
|
\(\text{kg}\text{ } \text{s}^{-1}\) |
Temperature |
\(T\) |
|
|
\(\text{K}\) |
Pressure |
\(P\) |
|
None |
\(\text{Pa}\) |
Parameters
Description |
Symbol |
Parameter |
Index |
Indexing Set |
Units |
|---|---|---|---|---|---|
Component molecular weight |
\(m_N\) |
|
|
|
\(\text{kg mol}^{-1}\) |
Molar volume of solute |
\(V\) |
|
|
|
\(\text{m}^3 \text{ mol}^{-1}\) |
Critical molar volume of solute |
\(V_c\) |
|
|
|
\(\text{m}^3 \text{ mol}^{-1}\) |
Dynamic viscosity |
\(\mu\) |
|
|
|
\(\text{Pa s}\) |
Component dimensionless Henry’s constant |
\(h_j\) |
|
|
|
\(\text{dimensionless}\) |
Standard enthalpy change of solution |
\(\Delta H_j^{\theta}\) |
|
|
|
\(\text{J}\text{ } \text{mol}^{-1}\) |
Boiling point temperature |
\(T_{b,j}\) |
|
|
|
\(\text{K}\) |
Properties
Description |
Symbol |
Variable |
Index |
Indexing Set |
Units |
|---|---|---|---|---|---|
Mass density of each phase |
\(\rho\) |
|
|
|
\(\text{kg m}^{-3}\) |
Component molar flowrate |
\(N\) |
|
|
|
\(\text{mol }\text{s}^{-1}\) |
Component mass fraction |
\(x\) |
|
|
|
\(\text{dimensionless}\) |
Component mass concentration |
\(m\) |
|
|
|
\(\text{kg m}^{-3}\) |
Component molar fraction |
\(y\) |
|
|
|
\(\text{dimensionless}\) |
Component molar concentration |
\(n\) |
|
|
|
\(\text{mol m}^{-3}\) |
Phase volumetric flowrate |
\(Q_p\) |
|
|
|
\(\text{m}^3\text{ } \text{s}^{-1}\) |
Phase gravimetric (mass) flowrate |
\(M_p\) |
|
|
|
\(\text{kg}\text{ } \text{s}^{-1}\) |
Total volumetric flowrate |
\(Q_{tot}\) |
|
None |
|
\(\text{m}^3\text{ } \text{s}^{-1}\) |
Mass diffusivity of solute |
\(D\) |
|
|
|
\(\text{m}^2 \text{ s}^{-1}\) |
Component energy of molecular attraction |
\(\varepsilon_j\) |
|
|
|
\(\text{erg}\) |
Air-component energy of molecular attraction |
\(\varepsilon_{air, j}\) |
|
|
|
\(\text{erg}\) |
Component collision molecular separation |
\(r_j\) |
|
|
|
\(\text{nm}\) |
Air-component collision molecular separation |
\(r_{air, j}\) |
|
|
|
\(\text{nm}\) |
Component collision function |
\(f(kT/\varepsilon_{air, j})\) |
|
|
|
\(\text{dimensionless}\) |
Component zeta for collision function |
\(\xi\) |
|
|
|
\(\text{dimensionless}\) |
Component ee for zeta of collision function |
\(E\) |
|
|
|
\(\text{dimensionless}\) |
Molar volume of solute |
\(V\) |
|
|
|
\(\text{m}^3 \text{ mol}^{-1}\) |
Component dimensionless Henry’s constant |
\(h_j\) |
|
|
|
\(\text{dimensionless}\) |
Saturation vapor pressure of water |
\(P_{sat}\) |
|
|
|
\(\text{Pa}\) |
Vapor pressure of water |
\(P_{vap}\) |
|
|
|
\(\text{Pa}\) |
Relative humidity |
\(rh\) |
|
|
|
\(\text{dimensionless}\) |
Relationships
Description |
Equation/Relationship |
|---|---|
Component mass fraction |
\(x_j=\frac{M_j}{\sum_j{M_j}}\) |
Component mass concentration |
\(m_j=\rho_p x_j\) |
Component molar fraction |
\(y_j=\frac{N_j}{\sum_j{N_j}}\) |
Component molar concentration |
\(n_j=\frac{m_j}{m_{N,j}}\) |
Mass density of each phase |
\(\rho\text{ specified as user input}\) |
Phase volumetric flowrate |
\(Q_p=\frac{\sum_j{N_j m_{Nj}}}{\rho}\) |
Phase gravimetric flowrate |
\(M_p=Q_p \rho_p\) |
Total volumetric flowrate |
\(Q_{tot}=\sum_p{Q_p}\) |
Component mass liquid phase diffusivity 1 |
\(D_{liq}\text{ specified as user input or calculated via Hayduk-Laudie correlation}\) |
Component mass vapor phase diffusivity 2 |
\(D_{vap}\text{ specified as user input or calculated via Wilke-Lee correlation}\) |
Component Henry’s constant 3 |
\(h_j\text{ specified as user input or calculated via van't Hoff correlation}\) |
Component molar volume 4 |
\(V\text{ specified as user input or calculated via Tyn-Calus correlation}\) |
Vapor pressure of water |
\(\text{Calculated with Antoine Equation}\) |
Saturation vapor pressure of water |
\(\text{Calculated with Huang Correlation}\) |
Relative humidity |
\(rh = \frac{P_{vap}}{P_{sat}}\) |
Note
1 Liquid phase diffusivity can either be (1) specified when the user provides data via the diffusivity_data configuration option or (2) calculated by the correlation defined in Hayduk, W., & Laudie, H. (1974). For the latter, the liq_diffus_calculation configuration option must be set to LiqDiffusivityCalculation.HaydukLaudie.
2 Vapor phase diffusivity can either be (1) specified when the user provides data via the diffusivity_data configuration option or (2) calculated by the correlation defined in Wilke & Lee (1955). For the latter, the vap_diffus_calculation configuration option must be set to VapDiffusivityCalculation.WilkeLee.
3 Henry’s constant can either be (1) specified when the user provides data via the henry_constant_data configuration option or (2) corrected for the vapor phase temperature via the van’t Hoff equation if the user sets the temp_adjust_henry configuration option to True. In the latter case, the user provided data is assumed to be for T = 298 K (i.e., \(h_{j,std}\)) and is added as a parameter called henry_constant_std_comp. In either case, user data is required.
4 Molar volume can either be (1) specified when the user provides data via the molar_volume_comp configuration option or (2) calculated by the Tyn-Calus correlation defined in Aniceto, J. P. S., Zêzere, B., & Silva, C. M. (2021). For the latter, the molar_volume_calculation configuration option must be set to MolarVolumeCalculation.TynCalus and the component critical molar volume must be specified via the critical_molar_volume_data configuration option.
van’t Hoff Correlation
The following is used to temperature correct Henry’s constant:
Tyn-Calus Correlation
The following is used to calculate molar volume:
Where \(\tau_A = 0.285\) and \(\tau_B = 1.048\).
Hayduk-Laudie Correlation
The following is used to calculate component liquid phase diffusion if user sets liq_diffus_calculation to LiqDiffusivityCalculation.HaydukLaudie.
The Hayduk-Laudie correlation returns liquid diffusivity \(\big( D_{liq,j} \big)\) in units of \(\text{m}^2/\text{s}\); liquid viscosity
\(\big( \mu_{liq} \big)\) has units of \(\text{cP}\) and molar volume \(\big( V_j \big)\) has untis of \(\text{cm}^3/\text{mol}\):
Where \(\varphi_A = 13.26 \times 10^{-9}\), \(\varphi_B = 1.14\), and \(\varphi_C = 0.589\).
Wilke-Lee Correlation
The following is used to calculate component vapor phase diffusion if user sets vap_diffus_calculation to VapDiffusivityCalculation.WilkeLee:
The Wilke-Lee correlation includes the collision function \(f(kT/\varepsilon_{air, j})\) in the denominator. There are several intermediary calculations necessary to get the value for the collision function, summarized in the following equations. Necessary parameters are provided in a table at the end of this section.
The collision function is calculated according to:
Where the exponent \(\xi\) is calculated with:
The \(E\) parameter is the base-10 logarithm of the expression \(\frac{kT}{\varepsilon_{air, j}}\) used in the collision function:
The molecular separation at collision for component \(j\) and air \(r_{j,air}\) is the average of the molecular separation of each component:
And \(r_j\) is calculated with:
The energy of molecular attraction for each component \(\varepsilon_j\) is calculated with the boiling point \(T_{b,j}\):
For air, the energy of molecular attraction \(\varepsilon_{air}\) is:
Finally, the energy of molecular attraction between component \(j\) and air \(\varepsilon_{j,air}\) is:
The following contains all the constants and parameters needed for the calculations germane to the Wilke-Lee correlation.
Parameter |
Value |
Units |
|---|---|---|
\(k^*\) |
\(\text{1.381} \times 10^{-16}\) |
\(\text{g cm}^{2} \text{ s}^{-2} \text{ K}^{-1}\) |
\(\omega_A\) |
\(\text{1.084}\) |
\(\text{cm}^{2} \text{ K}^{-1.5}\) |
\(\omega_B\) |
\(\text{0.249}\) |
\(\text{cm}^{2} \text{ K}^{-1.5}\) |
\(x_0\) |
\(\text{-0.14329}\) |
\(\text{dimensionless}\) |
\(x_1\) |
\(\text{-0.48343}\) |
\(\text{dimensionless}\) |
\(x_2\) |
\(\text{0.1939}\) |
\(\text{dimensionless}\) |
\(x_3\) |
\(\text{0.1361}\) |
\(\text{dimensionless}\) |
\(x_4\) |
\(\text{-0.20578}\) |
\(\text{dimensionless}\) |
\(x_5\) |
\(\text{0.083899}\) |
\(\text{dimensionless}\) |
\(x_6\) |
\(\text{-0.011491}\) |
\(\text{dimensionless}\) |
\(r_{air}\) |
\(\text{0.3711}\) |
\(\text{nm}\) |
\(\gamma\) |
\(\text{1.18}\) |
\(\text{nm mol}^{1/3} \text{ L}^{-1/3}\) |
\(\text{ }^*\) Boltzmann’s constant must be in \(\text{g cm}^{2} \text{ s}^{-2} \text{ K}^{-1}\) for these correlations.
Antoine Equation
Vapor pressure of water is calculated according to Antoine equation:
Where \(A = 8.07131\), \(B = 1730.63\), \(C = 233.426\) and \(T\) is the temperature of the liquid stream.
Huang Correlation
The saturation vapor pressure for water in the vapor stream is calculated with the Huang correlation:
With \(a = 34.494\), \(b = 4924.99\), \(c = 1.57\), \(d_1 = 237.1\), \(d_2 = 105\), and \(T\) is the temperature of the vapor stream in Celsius.
Physical/Chemical Constants
Description |
Symbol |
Value |
Unit |
|---|---|---|---|
Ideal gas constant |
\(R\) |
\(\text{8.3145}\) |
\(\text{J mol}^{-1} \text{K}^{-1}\) |
Faraday constant |
\(F\) |
\(96,485.33\) |
\(\text{C mol}^{-1}\) |
Avogadro constant |
\(N_A\) |
\(\text{6.022} \times 10^{23}\) |
\(\text{dimensionless}\) |
Boltzmann constant |
\(k\) |
\(\text{1.381} \times 10^{-16}\) |
\(\text{g cm}^{2} \text{s}^{-2} \text{K}^{-1}\) |
Scaling
A comprehensive scaling factor calculation method is coded in this property package.
Default scaling factors are as follows.
State variable |
Phase |
Default scaling factor |
|---|---|---|
|
None |
\(10^{-5}\) |
|
|
\(10^{-2}\) |
|
|
\(10^{-2}\) |
|
|
\(10^{3}\) |
|
|
\(1\) |
|
|
\(10^{3}\) |
|
|
\(10^{5}\) |
|
|
\(10^{10}\) |
|
|
\(10^{6}\) |
Note the only state variable for which there is no default scaling factor is flow_mass_phase_comp, so that must be assigned by the user.
Provided the state variables are scaled, calling calculate_scaling_factors on the model will assign scaling factors
to all instantiated variables in the property model:
m.fs.properties.set_default_scaling('flow_mass_phase_comp', 1e2, index=('Liq','{component name}'))
# m is the model name, and fs is the instantiated flowsheet block of m.
calculate_scaling_factors(m)
Proper scaling of variables is, in many cases, crucial to solver’s performance in finding an optimal solution of a problem. While designing scaling can have a mathematical sophistication, a general rule is to scale all variables as close to 1 as possible (in the range of 1e-2 to 1e2).
Classes
- class watertap_contrib.reflo.property_models.air_water_equilibrium_properties.AirWaterEq(*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
- solute_list
Required argument. List of strings that specify names of solute species.
- mw_data
Required argument. Dict of component names (keys) and molecular weight data (values)
- diffusivity_data
Dict of phase, solute species names (keys) and bulk ion diffusivity data (values)
- molar_volume_data
Dict of solute species names and molar volume of aqueous species
- critical_molar_volume_data
Dict of solute species names and critical molar volume of aqueous species.Used for Tyn-Calus method for calculating molar volume
- density_data
Dict of phases and density of vapor and liquid phases
- dynamic_viscosity_data
Dict of phases and dynamic viscosity of vapor and liquid phases
- henry_constant_data
Dict of solute species names and Henry’s Law Constant
- temp_adjust_henry
Flag to indicate if provided Henry’s Law Constant should be adjusted for temperature.
- standard_enthalpy_change_data
Dict of solute species names and standard enthalpy change of dissolution in water. Used to temperature adjust Henry’s Law Constant.
- temperature_boiling_data
Dict of solute species names and boiling temperature data
- charge_data
Dict of solute species names and ion charge
- liq_diffus_calculation
Options to account for ionic or molecular diffusivity.
default -
LiqDiffusivityCalculation.HaydukLaudieConfiguration Options
Description
LiqDiffusivityCalculation.noneUsers provide liquid diffusivity data via the diffusivity_data configuration
LiqDiffusivityCalculation.HaydukLaudieAllow the nonelectrolyte (neutral) species to get diffusivity from the Hayduk-Laudie equation
- vap_diffus_calculation
Options to account for ionic or molecular diffusivity.
default -
VapDiffusivityCalculation.WilkeLeeConfiguration Options
Description
VapDiffusivityCalculation.noneUsers provide vapor diffusivity data via the diffusivity_data configuration
VapDiffusivityCalculation.WilkeLeeAllow the nonelectrolyte (neutral) species to get diffusivity from the Wilke-Lee equation
- molar_volume_calculation
Options to estimate molar volume for a component.
default -
MolarVolumeCalculation.TynCalusConfiguration Options
Description
MolarVolumeCalculation.noneUsers provide data via the molar_volume_data configuration
MolarVolumeCalculation.TynCalusAllow the component species to calculate molar volume from the Tyn-Calus equation
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:
(AirWaterEq) New instance
- class watertap_contrib.reflo.property_models.air_water_equilibrium_properties.AirWaterEqData(component)[source]
- build()[source]
General build method for PropertyParameterBlocks. Inheriting models should call super().build.
- Parameters:
None –
- Returns:
None
- classmethod define_metadata(obj)[source]
Set all the metadata for properties and units.
This method should be implemented by subclasses. In the implementation, they should set information into the object provided as an argument.
- Parameters:
pcm (PropertyClassMetadata) – Add metadata to this object.
- Returns:
None
- class watertap_contrib.reflo.property_models.air_water_equilibrium_properties._AirWaterEqStateBlock(*args, **kwds)[source]
- calculate_state(var_args=None, hold_state=False, outlvl=0, solver=None, optarg=None)[source]
Solves state blocks given a set of variables and their values. These variables can be state variables or properties. This method is typically used before initialization to solve for state variables because non-state variables (i.e. properties) cannot be fixed in initialization routines. :keyword var_args: dictionary with variables and their values, they can be state variables or properties
{(VAR_NAME, INDEX): VALUE}
- Keyword Arguments:
hold_state – flag indicating whether all of the state variables should be fixed after calculate state. True - State variables will be fixed. False - State variables will remain unfixed, unless already fixed.
outlvl – idaes logger object that sets output level of solve call (default=idaeslog.NOTSET)
solver – solver name string if None is provided the default solver for IDAES will be used (default = None)
optarg – solver options dictionary object (default={})
- Returns:
results object from state block solve
- initialize(state_args=None, state_vars_fixed=False, hold_state=False, outlvl=0, solver=None, optarg=None)[source]
Initialization routine for property package. :keyword state_args: Dictionary with initial guesses for the state vars
chosen. Note that if this method is triggered through the control volume, and if initial guesses were not provided at the unit model level, the control volume passes the inlet values as initial guess.The keys for the state_args dictionary are: flow_mass_phase_comp : value at which to initialize
phase component flows
pressure : value at which to initialize pressure temperature : value at which to initialize temperature
- Keyword Arguments:
outlvl – sets output level of initialization routine (default=idaeslog.NOTSET)
optarg – solver options dictionary object (default=None)
state_vars_fixed –
- Flag to denote if state vars have already been
fixed. - True - states have already been fixed by the
control volume 1D. Control volume 0D does not fix the state vars, so will be False if this state block is used with 0D blocks.
- False - states have not been fixed. The state
block will deal with fixing/unfixing.
solver – Solver object to use during initialization if None is provided it will use the default solver for IDAES (default = None)
hold_state –
- flag indicating whether the initialization routine
should unfix any state variables fixed during initialization (default=False). - True - states variables are not unfixed, and
a dict of returned containing flags for which states were fixed during initialization.
- False - state variables are unfixed after
initialization by calling the release_state method
- Returns:
If hold_states is True, returns a dict containing flags for which states were fixed during initialization.
- release_state(flags, outlvl=0)[source]
Method to release state variables fixed during initialisation. :keyword flags: dict containing information of which state variables
were fixed during initialization, and should now be unfixed. This dict is returned by initialize if hold_state=True.
- Keyword Arguments:
outlvl – sets output level of of logging
- class watertap_contrib.reflo.property_models.air_water_equilibrium_properties.AirWaterEqStateBlockData(*args, **kwargs)[source]
- build()[source]
Callable method for Block construction.
- define_state_vars()[source]
Define state vars.
- get_enthalpy_flow_terms(p)[source]
Create enthalpy flow terms.
- get_material_flow_basis()[source]
Method which returns an Enum indicating the basis of the material flow term.
- get_material_flow_terms(p, j)[source]
Create material flow terms for control volume.