Gibbs Reactor#

The IDAES Gibbs reactor model represents a unit operation where a material stream undergoes some set of reactions such that the Gibbs energy of the resulting mixture is minimized. Gibbs reactors rely on conservation of individual elements within the system, and thus require element balances, and make use of Lagrange multipliers to find the minimum Gibbs energy state of the system.

Configuration Arguments#

The Gibbs Reactor unit model allows users to specify a list of components which should be considered to be inerts within the reactor. This is done using the “inert_species” configuration argument, which should be a list of valid component names. These components will be considered inert, such that flows in and out of the unit for those components in each phase are equal.

Degrees of Freedom#

Gibbs reactors generally have between 0 and 2 degrees of freedom, depending on construction arguments.

Typical fixed variables are:

  • reactor heat duty (has_heat_transfer = True only).

  • reactor pressure change (has_pressure_change = True only).

Model Structure#

The core Gibbs reactor unit model consists of a single ControlVolume0DBlock (named control_volume) with one Inlet Port (named inlet) and one Outlet Port (named outlet).

Variables#

Gibbs reactor units add the following additional Variables beyond those created by the Control Volume Block.

Variable Name

Symbol

Notes

lagrange_mult

\(L_{t,e}\)

Lagrange multipliers

heat_duty

\(Q_t\)

Only if has_heat_transfer = True, reference

deltaP

\(\Delta P_t\)

Only if has_pressure_change = True, reference

Parameters#

The Gibbs reactor unit model includes a scaling parameter for the Gibbs energy minimization constraint, which is named “gibbs_scaling”. The default value is 1 and users may adjust the value of this parameter is required.

Constraints#

Gibbs reactor models write the following additional constraints to calculate the state that corresponds to the minimum Gibbs energy of the system.

gibbs_minimization(time, phase, component):

\[0 = \eps \times g_{partial,t,j} + \eps \times \sum_e{(L_{t,e} \times \alpha_{j,e})}\]

where \(g_{partial,t,j}\) is the partial molar Gibbs energy of component \(j\) at time \(t\), \(L_{t,e}\) is the Lagrange multiplier for element \(e\) at time \(t\) and \(\alpha_{j,e}\) is the number of moles of element \(e\) in one mole of component \(j\). \(g_{partial,t,j}\) and \(\alpha_{j,e}\) come from the outlet StateBlock. \(t\), \(eps\) is the gibbs_scaling parameter. In cases where inert species are present, these are excluded from the \(sum_e\) term.

In cases where inerts are present, the following additional constraint is written for each inert component and phase:

\[0 = F_{in, p, j} - F_{out, p, j}\]

GibbsReactor Class#

class idaes.models.unit_models.gibbs_reactor.GibbsReactor(*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

    Gibbs reactors do not support dynamic models, thus this must be False.

    has_holdup

    Gibbs reactors do not have defined volume, thus this must be False.

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.useDefault. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    has_heat_transfer

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

    has_pressure_change

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

    property_package

    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

    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.}

    inert_species

    List of species which do not take part in reactions.

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

(GibbsReactor) New instance

GibbsReactorData Class#

class idaes.models.unit_models.gibbs_reactor.GibbsReactorData(component)[source]#

Standard Gibbs Reactor Unit Model Class

This model assume all possible reactions reach equilibrium such that the system partial molar Gibbs free energy is minimized. Since some species mole flow rate might be very small, the natural log of the species molar flow rate is used. Instead of specifying the system Gibbs free energy as an objective function, the equations for zero partial derivatives of the grand function with Lagrangian multiple terms with respect to product species mole flow rates and the multiples are specified as constraints.

build()[source]#

Begin building model (pre-DAE transformation).

Parameters:

None

Returns:

None

default_scaler#

alias of GibbsReactorScaler

GibbsReactorScaler Class#

class idaes.models.unit_models.gibbs_reactor.GibbsReactorScaler(**kwargs)[source]#

Scaler for Gibbs Reactor units.

Due to the nature of Gibbs Reactors, scaling is highly dependent on the outlet concentrations which cannot be predicted a priori, thus we rely on users to provide the best initial guesses they can for the outlet concentrations.

zero_tolerance

Value at which a variable will be considered equal to zero for scaling.

max_variable_scaling_factor

Maximum value for variable scaling factors.

min_variable_scaling_factor

Minimum value for variable scaling factors.

max_constraint_scaling_factor

Maximum value for constraint scaling factors.

min_constraint_scaling_factor

Minimum value for constraint scaling factors.

overwrite

Whether to overwrite existing scaling factors.

constraint_scaling_routine(model, overwrite=False, submodel_scalers=None)[source]#

Routine to apply scaling factors to constraints in model.

Constraints will be scaled based on nominal Jacobian norms, and thus will be heavily dependent on variable scaling.

Parameters:
  • model – model to be scaled

  • overwrite (bool) – whether to overwrite existing scaling factors

  • submodel_scalers (dict) – dict of Scalers to use for sub-models, keyed by submodel local name

Returns:

None

variable_scaling_routine(model, overwrite=False, submodel_scalers=None)[source]#

Variable scaling routine for Gibbs reactors.

Due to the nature of Gibbs Reactors, scaling is highly dependent on the outlet concentrations which cannot be predicted a priori, thus we rely on users to provide the best initial guesses they can for the outlet concentrations.

Parameters:
  • model – instance of GibbsReactor to be scaled

  • overwrite (bool) – whether to overwrite existing scaling factors

  • submodel_scalers (dict) – dict of Scalers to use for sub-models, keyed by submodel local name

Returns:

None