Multi-Component Aqueous Solution (MCAS) Property Package

This property package implements property relationships for an aqueous solution that may contain multiple neutral and/or ionic solutes.

This MCAS property package
  • sets H2O as the solvent;

  • supports multiple solute components including ions and neutral molecules;

  • supports only liquid phase;

  • uses molar flow rate (in mol/s), temperature and pressure as the initial state variables;

  • does not support dynamics.

Classes

class watertap.property_models.multicomp_aq_sol_prop_pack.MCASParameterBlock(*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

    List of solute species names

    stokes_radius_data

    Dict of solute species names and Stokes radius data

    diffusivity_data

    Dict of solute species names and bulk ion diffusivity data

    mw_data

    Dict of component names and molecular weight data

    elec_mobility_data

    Ion electrical mobility

    trans_num_data

    transport number of ions in the liquid phase

    equiv_conductivity_phase_data

    Equivalent conductivity of ions in the liquid phase

    charge

    Ion charge

    activity_coefficient_model

    Options to account for activity coefficient model.

    default - ActivityCoefficientModel.ideal

    Configuration Options

    Description

    ActivityCoefficientModel.ideal

    Activity coefficients equal to 1 assuming ideal solution

    ActivityCoefficientModel.davies

    Activity coefficients estimated via Davies model

    density_calculation

    Options to account for solution density.

    default - DensityCalculation.constant

    Configuration Options

    Description

    DensityCalculation.constant

    Solution density assumed constant at 1000 kg/m3

    DensityCalculation.seawater

    Solution density based on correlation for seawater (TDS)

    DensityCalculation.laliberte

    Solution density based on mixing correlation from Laliberte

    elec_mobility_calculation

    Options to account for ion electrical mobility.

    default - ElectricalMobilityCalculation.none

    Configuration Options

    Description

    ElectricalMobilityCalculation.none

    Users provide data via the elec_mobility_data configuration

    ElectricalMobilityCalculation.EinsteinRelation

    Calculate from the diffusivity_data by the Einstein Relation

    trans_num_calculation

    Options to account for ion transport number in the solution.

    default - TransportNumberCalculation.ElectricalMobility

    Configuration Options

    Description

    TransportNumberCalculation.none

    Users provide data via the trans_num_data configuration

    TransportNumberCalculation.ElectricalMobility

    Calculated from the elec_mobility_data

    equiv_conductivity_calculation

    Options to account for the total equivalent conductivity of the liquid phase (solution).

    default - EquivalentConductivityCalculation.none

    Configuration Options

    Description

    EquivalentConductivityCalculation.none

    Users provide data via the equiv_conductivity_data configuration

    EquivalentConductivityCalculation.ElectricalMobility

    Calculated from the electrical_mobility_data

  • 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

(MCASParameterBlock) New instance

class watertap.property_models.multicomp_aq_sol_prop_pack.MCASParameterData(component)[source]
build()[source]

Callable method for Block construction.

classmethod define_metadata(obj)[source]

Define properties supported and units.

class watertap.property_models.multicomp_aq_sol_prop_pack._MCASStateBlock(*args, **kwds)[source]

This Class contains methods which should be applied to Property Blocks as a whole, rather than individual elements of indexed Property Blocks.

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 Arguments
  • var_args – dictionary with variables and their values, they can be state variables or properties {(VAR_NAME, INDEX): VALUE}

  • 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 Arguments
  • 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_mol_phase_comp : value to initialize phase component flows; pressure : value at which to initialize pressure; temperature : value at which to initialize temperature.

  • 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 - state 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 Arguments
  • 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.

  • outlvl – sets output level of logging

class watertap.property_models.multicomp_aq_sol_prop_pack.MCASStateBlockData(*args, **kwargs)[source]
build()[source]

Callable method for Block construction.

define_state_vars()[source]

Define state vars.

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.

Sets

Description

Symbol

Members

AqueousPhase

\(p\)

{‘Liq’}

component_list

\(j\)

{‘H2O’, solute_list 1}

solute_set

\(j\)

{neutral species in solute_list} 2

ion_set

\(j\)

{ionic species in solute_list}

cation_set

\(j\)

{cationic species in solute_list}

anion_set

\(j\)

{anionic species in solute_list}

Notes

1 solute_list is provided by a necessary configuration to use this property package. 2 In the implementing codes, the “solute_set” was declared to include only neutral species for current programming convenience; in other places throughout this document, “solute” by itself includes both ionic and neutral species solvated by water.

State variables

Description

Symbol

Coded Var Name

Index

Unit

Component molar flow rate

\(N\)

flow_mol_phase_comp

[p, j]

\(\text{mol s}^{-1}\)

Temperature

\(T\)

temperature

None

\(\text{K}\)

Pressure

\(P\)

pressure

None

\(\text{Pa}\)

Calculated Properties

Description

Symbol

Coded Var Name

Index

Unit

Calculation Methods

Component mass flow rate

\(M\)

flow_mass_phase_comp

[p, j]

\(\text{kg s}^{-1}\)

\(M=Nm_N\)

Component charge-equivalent molar flow rate

\(\tilde{N}\)

flow_equiv_phase_comp

[p, j]

\(\text{mol s}^{-1}\)

\(\tilde{N}=N\left|z\right|\)

Component charge-equivalent molar concentration

\(\tilde{n}\)

conc_equiv_phase_comp

[p, j]

\(\text{mol m}^{-3}\)

\(\tilde{n}=n\left|z\right|\)

Component mass fraction

\(x\)

mass_frac_phase_comp

[p, j]

\(\text{dimensionless}\)

\(x_j=\frac{M_j}{\sum_j{M_j}}\)

Mass density of aqueous phase

\(\rho\)

dens_mass_phase

[p]

\(\text{kg m}^{-3}\)

\(\rho=1000 \text{kg m}^{-3}\) or \(\rho=\rho_w + \textbf{f} \left(\sum_{j\in solute}{x_j}, T\right)\) 1

Mass density of solvent water

\(\rho_w\)

dens_mass_w_phase

[p]

\(\text{kg m}^{-3}\)

\(\rho_w=\textbf{f}\left(T\right)\) 1

Phase volumetric flowrate

\(Q\)

flow_vol_phase

[p]

\(\text{m}^3\text{ } \text{s}^{-1}\)

\(Q=\frac{\sum_j{N_j m_{Nj}}}{\rho}\)

Total volumetric flowrate

\(Q_{tot}\)

flow_vol

None

\(\text{m}^3\text{ } \text{s}^{-1}\)

\(Q_{tot}=\sum_p{Q_p}\)

Component molar concentration

\(n\)

conc_mol_phase_comp

[p, j]

\(\text{mol m}^{-3}\)

\(nm_N=m\)

Component mass concentration

\(m\)

conc_mass_phase_comp

[p, j]

\(\text{kg m}^{-3}\)

\(m=\rho x\)

Component molar fraction

\(y\)

mole_frac_phase_comp

[p, j]

\(\text{dimensionless}\)

\(y_j=\frac{N_j}{\sum_j{N_j}}\)

Component molality

\(b\)

molality_phase_comp

[p, j]

\(\text{mol kg}^{-1}\)

\(b=\frac{N}{N_{H_2O} m_{N\text{H_2O}}}\)

Component diffusivity

\(D\)

diffus_phase_comp

[p, j]

\(\text{m}^2 \text{ } \text{s}^{-1}\)

\(D=\) input from users

Dynamic viscosity

\(\mu\)

visc_d_phase

[p]

\(\text{Pa s}\)

\(\mu=\) input from users

Kinematic viscosity

\(\nu\)

visc_k_phase

[p]

\(\text{m}^2 \text{ s}^{-1}\)

\(\nu=\mu\rho^{-1}\)

Phase osmotic pressure

\(\Pi\)

pressure_osm_phase

[p]

\(\text{Pa}\)

\(\Pi=RT\sum_{j\in solute}{n_j}\)

Component stokes radius

\(r_h\)

radius_stokes_comp

[j]

\(\text{m}\)

\(r_h=\) input from users

Component molecular weight

\(m_N\)

mw_comp

[j]

\(\text{kg mol}^{-1}\)

\(m_N=\) input from users

Ion component electrical mobility

\(\mu_e\)

elec_mobility_phase_comp

[p,j]

\(\text{m}^2\text{ }\text{V}^{-1}\text{ }\text{s}^{-1}\)

\(\mu_e=\) input from users or \(\mu_e=\frac{D\left|z\right|F}{RT}\)

Ion component transport number

\(t\)

trans_num_phase_comp

[p, j]

\(\text{dimensionless}\)

\(t=\) input from users or \(t_j=\frac{\left|z_j\right|\mu_{ej} n_j}{\sum_{j\in ion}{\left|z_j\right|\mu_{ej} n_j}}\)

Phase equivalent conductivity

\(\Lambda\)

equiv_conductivity_phase

[p]

\(\text{m}^2 \text{ } \Omega^{-1} \text{ mol}^{-1}\)

\(\Lambda=\) input from users or \(\Lambda=\frac{\sum_{j\in ion}{F\left|z_j\right|\mu_{ej} n_j}}{\sum_{j\in cation}{\left|z_j\right|n_j}}\)

Phase electrical conductivity

\(\lambda\)

elec_cond_phase

[p]

\(\Omega^{-1} \text{ m}^{-1}\)

\(\lambda=\Lambda\sum_{j\in cation}{\left|z_j\right|n_j}\)

Ion component charge

\(z\)

charge_comp

[j]

\(\text{dimensionless}\)

\(z=\) input from users

Component activity coefficient

\(\gamma\)

act_coeff_phase_comp

[j]

\(\text{dimensionless}\)

\(\gamma=\) input from users

Dielectric constant

\(\epsilon\)

dielectric_constant

none

\(\text{dimensionless}\)

\(\epsilon=\) input from users

Debye-Huckel constant

\(A\)

deby_huckel_constant

none

\(\text{dimensionless}\)

\(A=\frac{\left(2 \pi N_A\right)^{0.5}}{log(10)} \left(\frac{\textbf{e}^2}{4 \pi \epsilon \epsilon_0 kT}\right)^{\frac{3}{2}}\)

Ionic Strength

\(I\)

ionic_strength_molal

none

\(\text{mol kg}^{-1}\)

\(I=0.5\sum_{j\in ion}{z_j^2b_j}\)

Notes

1 \(\textbf{f}(\cdot)\) refers to empirical correlations of phase or solvent mass density to seawater salinity and temperature following the study of Sharqawy et al. (2010).

Physical/chemical constants

Description

Symbol

Value

Unit

Idea gas constant

\(R\)

8.3145

\(\text{J mol}^{-1} \text{K}^{-1}\)

Faraday constant

\(F\)

96485.33

\(\text{C mol}^{-1}\)

Avogadro constant

\(N_A\)

6.022e23

\(\text{dimensionless}\)

Boltzmann constant

\(k\)

1.381e-23

\(\text{J K}^{-1}\)

Vacuum permittivity

\(\epsilon_0\)

8.854e-12

\(\text{F m}^{-1}\)

Elementary charge

\(\textbf{e}\)

1.602e-19

\(\text{C}\)

Scaling

A comprehensive scaling factor calculation method is coded in this property package. Among the state variables (\(N, T, \text{and } p\)), default scaling factors for \(T\) and \(p\) were set and do not need users’ input, while, for \(N\), usually require a user input via an interface. The coding interface to set defalut scaling factor for \(N\) and call the scaling calculation for other variables is the following.

m.fs.properties.set_default_scaling('flow_mol_phase_comp', 1e2, index=('Liq','{component name}'))
# m is the model name, and fs is the instanced flowsheet block of m.
calculate_scaling_factors(m)

Users also have the authority to set a scaling factor for non-state variables via the following codes:

import idaes.core.util.scaling as iscale #import the needed utility package
...
iscale.set_scaling_factor(m.fs.properties.{property_name}, 100)

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, e.g., in the range of 1e-2 to 1e2.

Reference

M.H. Sharqawy, J.H.L. V, S.M. Zubair, Thermophysical properties of seawater: a review of existing correlations and data, Desalination and Water Treatment. 16 (2010) 354–380. https://doi.org/10.5004/dwt.2010.1079. (2017 corrections provided at http://web.mit.edu/seawater )

Bard, A. J., Faulkner, L. R., & White, H. S. (2022). Electrochemical methods: fundamentals and applications. John Wiley & Sons.