prommis.cmi_precipitator.opt_based_precipitator#

Optimization-based Precipitator for the Critical Materials Innovation Hub (CMI) Process#

Author: Chris Laliwala

This precipitator makes use of equilibrium constants and solubility constants to predict the final concentrations of aqueous species, and the amount of precipitates formed at equilibrium.

Configuration Arguments#

The model requires the user to define the aqueous species and precipitates present in the system. Additionally, equilibrium constants for aqueous reactions, and solubility constants for precipitation/dissolution reactions are needed. Reaction stoichiometry must also be provided by the user. The aqueous components, equilibrium constants, and a dictionary defining the aqueous reaction stoichiometry is stored in the aqeuous property package. The precipitates, solubility constants, and a dictionary defining the precipitation/dissolution reaction stoichiometry is stored in the precipitate property package.

Model Structure#

This unit model has an inlet for aqueous (‘aqueous_inlet’) and precipitates (‘precipitate_inlet’) entering the unit, and an outlet for aqueous (‘aqueous_outlet’) and precipitates (‘precipitate_outlet’) leaving the unit.

Additional Model Information#

This precipitator model seeks to model aqueous systems involving precipitation and dissolution reactions as chemical equilibrium problems. The approach taken here is to solve a system of nonlinear equations involving equilibrium constants (the law of mass action approach, LMA) [1]. Instead of utilizing saturation indices heuristics commonly used by LMA software [1], this model formulates an optimization problem where the objective function is to minimize the square difference between the ion product, \(Q_{r,sp}\), defined over the actual concentration in solution, and the solubility constant, \(K_{r,sp}\), defined over the equilibrium concentration in solution,

\[z = \sum_{r \in N_{rxn,sp}} ( log(K_{r,sp}) - log(Q_{r,sp}) )^2 \quad (1)\]

where \(N_{rxn,sp}\) is the set of precipitation/dissolution reactions. By adding in the following constraints, this objective function allows the identification of the species that should precipitate (i.e. \(Q_{r,sp} = K_{r,sp}\)) and those that should not (i.e. \(Q_{r,sp} \leq K_{r,sp}\)):

\[log(Q_{r,sp}) = \sum_{i \in I_{r, products}} \alpha_{i,r} log(C_i^f) \forall r \in N_{rxn,sp} \quad (2)\]
\[log(Q_{r,sp}) \leq log(K_{r,sp}) \forall r \in N_{rxn,sp} \quad (3)\]

where \(I_{r,products}\) is the set of products formed in reaction \(r\). Eq. (2) computes the ionic product based on the actual concentrations in the solution; its upper bound is defined by the solubility product (Eq. 3).

Equilibrium conditions are imposed in all reactions that do not involve solids’ formation as shown in Eq. (4):

\[log(K_{r,aq}) = \sum_{i \in I_{r,products}} \alpha_{i,r} log(C_i^f) - \sum_{i \in I_{r, reactants}} \alpha_{i,r} log(C_i^f) \forall r \in N_{rxn,aq} \quad (4)\]

where \(\alpha_{i,r}\) is the stoichiometric coefficient of species \(i\) in reaction \(r\), \(C_i^f\) is the equilibrium concentration of species \(i\), and \(N_{rxn,aq}\) is the set of all aqueous reactions. The logartihmic form(s) in Eq. (2-4) to minimize numerical issues.

The set of restrictions is completed with the inclusion of mass and concentration balances to calculate the final concentration/mass of species:

\[C_i^f = C_i^0 + \sum_{r \in N_{rxn,i}} \alpha_{i,r} X_r \forall i \in I_{aq} \quad (5)\]
\[m_i^f = m_i^0 + \sum_{r \in N_{rxn,i}} \alpha_{i,r} X_r V \forall i \in I_{sp} \quad (6)\]

where \(C_i^0\) is the initial concentration of species \(i\), \(N_{rxn,i}\) is the set of all reactions involving species \(i\), \(X_r\) is the extent of reaction \(r\), \(I_{aq}\) is the set of all aqueous species, \(m_i^0\) is the initial amount of solid species \(i\), \(V\) is the volumetric flowrate of solvent, and \(I_{sp}\) is the set of all precipitates.

[1] Allan M.M. Leal, Dmitrii A. Kulik, William R. Smith, and Martin O. Saar. An overview of computational methods for chemical equilibrium and kinetic calculations for geochemical and reactive transport modeling. Pure Appl. Chem., 89:597-643, 2017.

class prommis.cmi_precipitator.opt_based_precipitator.Precipitator(*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

    dynamic

    Indicates whether this model will be dynamic or not, default = useDefault. Valid values: { useDefault - get flag from parent (default = False), True - set as a dynamic model, False - set as a steady-state model.}

    has_holdup

    Indicates whether holdup terms should be constructed or not. Must be True if dynamic = True, default - False. Valid values: { useDefault - get flag from parent (default = False), True - construct holdup terms, False - do not construct holdup terms}

    property_package_aqueous

    Property parameter object used to define property calculations, default - useDefault. “Valid values:** { useDefault - use default package from parent model or flowsheet, PropertyParameterObject - a PropertyParameterBlock object.}

    property_package_args_aqueous

    A ConfigBlock with arguments to be passed to a property block(s) and used when constructing these, default - None. Valid values: { see property package for documentation.}

    property_package_precipitate

    Property parameter object used to define property calculations, default - useDefault. Valid values: { useDefault - use default package from parent model or flowsheet, PropertyParameterObject - a PropertyParameterBlock object.}

    property_package_args_precipitate

    A ConfigBlock with arguments to be passed to a property block(s) and used when constructing these, default - None. Valid values: { see property package for documentation.}

    has_equilibrium_reactions

    Indicates whether terms for equilibrium controlled reactions should be constructed, default - True. Valid values: { True - include equilibrium reaction terms, False - exclude equilibrium reaction terms.}

    has_phase_equilibrium

    Indicates whether terms for phase equilibrium should be constructed, default = False. Valid values: { True - include phase equilibrium terms False - exclude phase equilibrium terms.}

    has_heat_of_reaction

    Indicates whether terms for heat of reaction terms should be constructed, default - False. Valid values: { True - include heat of reaction terms, False - exclude heat of reaction terms.}

  • 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:

(Precipitator) New instance

class prommis.cmi_precipitator.opt_based_precipitator.PrecipitatorData(component)[source]#

Precipitator Unit Model Class

build()[source]#

Building model

Parameters:

None

Returns:

None