Skip to content

Latest commit

 

History

History
313 lines (189 loc) · 16.2 KB

control_volume_1d.rst

File metadata and controls

313 lines (189 loc) · 16.2 KB

1D Control Volume Class

Contents

The ControlVolume1DBlock block is used for systems with one spatial dimension where material flows parallel to the spatial domain. Examples of these types of unit operations include plug flow reactors and pipes. ControlVolume1DBlock blocks are discretized along the length domain and contain one StateBlock and one ReactionBlock (if applicable) at each point in the domain (including the inlet and outlet).

idaes.core.control_volume1d

ControlVolume1DBlock

ControlVolume1DBlockData

ControlVolume1DBlock Equations

This section documents the variables and constraints created by each of the methods provided by the ControlVolume0DBlock class.

  • t indicates time index
  • x indicates spatial (length) index
  • p indicates phase index
  • j indicates component index
  • e indicates element index
  • r indicates reaction name index

Most terms within the balance equations written by ControlVolume1DBlock are on a basis of per unit length (e.g. mol/m ⋅ s).

add_geometry

The add_geometry method creates the normalized length domain for the control volume (or a reference to an external domain). All constraints in ControlVolume1DBlock assume a normalized length domain, with values between 0 and 1.

This method also adds variables and constraints to describe the geometry of the control volume. ControlVolume1DBlock does not support varying dimensions of the control volume with time at this stage.

Variables

Variable Name Symbol Indices Conditions
length_domain x None None
volume V None None
area A None None
length L None If length_var argument is provided, a reference to the provided component is made in place of creating a new variable

Constraints

`geometry_constraint`:


V = A × L

add_phase_component_balances

Material balances are written for each component in each phase (e.g. separate balances for liquid water and steam). Physical property packages may include information to indicate that certain species do not appear in all phases, and material balances will not be written in these cases (if has_holdup is True holdup terms will still appear for these species, however these will be set to 0).

Variables

Variable Name Symbol Indices Conditions
material_holdup Mt, x, p, j t, x, p, j has_holdup = True
phase_fraction ϕt, x, p t, x, p has_holdup = True
material_accumulation $\frac{\partial M_{t,x,p,j}}{\partial t}$ t, x, p, j dynamic = True
_flow_terms Ft, x, p, j t, x, p, j None
material_flow_dx $\frac{\partial F_{t,x,p,j}}{\partial x}$ t, x, p, j None
rate_reaction_generation Nkinetic, t, x, p, j t, x, p ,j has_rate_reactions = True
rate_reaction_extent Xkinetic, t, x, r t, x, r has_rate_reactions = True
equilibrium_reaction_generation Nequilibrium, t, x, p, j t, x, p ,j has_equilibrium_reactions = True
equilibrium_reaction_extent Xequilibrium, t, x, r t, x, r has_equilibrium_reactions = True
phase_equilibrium_generation Npe, t, x, p, j t, x, p ,j has_phase_equilibrium = True
mass_transfer_term Ntransfer, t, x, p, j t, x, p ,j has_mass_transfer = True

Constraints

`material_balances(t, x, p, j)`:

$$L \times \frac{\partial M_{t, x, p, j}}{\partial t} = fd \times \frac{\partial F_{t, x, p, j}}{\partial x} + L \times N_{kinetic, t, x, p, j} + L \times N_{equilibrium, t, x, p, j} + L \times N_{pe, t, x, p, j} + L \times N_{transfer, t, x, p, j} + L \times N_{custom, t, x, p, j}$$

fd is a flow direction term, which allows for material flow to be defined in either direction. If material flow is defined as forward, fd =  − 1, otherwise fd = 1.

The Ncustom, t, x, p, j term allows the user to provide custom terms (variables or expressions) in both mass and molar basis which will be added into the material balances, which will be converted as necessary to the same basis as the material balance (by multiplying or dividing by the component molecular weight). The basis of the material balance is determined by the physical property package, and if undefined (or not mass or mole basis), an Exception will be returned.

`material_flow_linking_constraints(t, x, p, j)`:

This constraint is an internal constraint used to link the extensive material flow terms in the StateBlocks into a single indexed variable. This is required as Pyomo.DAE requires a single indexed variable to create the associated DerivativeVars and their numerical expansions.

If has_holdup is True, `material_holdup_calculation(t, x, p, j)`:


Mt, x, p, j = ρt, x, p, j × A × ϕt, x, p

where ρt, x, p, j is the density of component j in phase p at time t and location x.

If dynamic is True:

Numerical discretization of the derivative terms, $\frac{\partial M_{t,x,p,j}}{\partial t}$, will be performed by Pyomo.DAE.

If has_rate_reactions is True, `rate_reaction_stoichiometry_constraint(t, x, p, j)`:


Nkinetic, t, x, p, j = αr, p, j × Xkinetic, t, x, r

where αr, p.j is the stoichiometric coefficient of component j in phase p for reaction r (as defined in the PhysicalParameterBlock).

If has_equilibrium_reactions argument is True, `equilibrium_reaction_stoichiometry_constraint(t, x, p, j)`:


Nequilibrium, t, x, p, j = αr, p, j × Xequilibrium, t, x, r

where αr, p.j is the stoichiometric coefficient of component j in phase p for reaction r (as defined in the PhysicalParameterBlock).

add_total_component_balances

Material balances are written for each component across all phases (e.g. one balance for both liquid water and steam). Physical property packages may include information to indicate that certain species do not appear in all phases, and material balances will not be written in these cases (if has_holdup is True holdup terms will still appear for these species, however these will be set to 0).

Variables

Variable Name Symbol Indices Conditions
material_holdup Mt, x, p, j t, x, p, j has_holdup = True
phase_fraction ϕt, x, p t, x, p has_holdup = True
material_accumulation $\frac{\partial M_{t,x,p,j}}{\partial t}$ t, x, p, j dynamic = True
_flow_terms Ft, x, p, j t, x, p, j None
material_flow_dx $\frac{\partial F_{t,x,p,j}}{\partial x}$ t, x, p, j None
rate_reaction_generation Nkinetic, t, x, p, j t, x, p ,j has_rate_reactions = True
rate_reaction_extent Xkinetic, t, x, r t, x, r has_rate_reactions = True
equilibrium_reaction_generation Nequilibrium, t, x, p, j t, x, p ,j has_equilibrium_reactions = True
equilibrium_reaction_extent Xequilibrium, t, x, r t, x, r has_equilibrium_reactions = True
mass_transfer_term Ntransfer, t, x, p, j t, x, p ,j has_mass_transfer = True

Constraints

`material_balances(t, x, p, j)`:

$$L \times \sum_p{\frac{\partial M_{t, x, p, j}}{\partial t}} = fd \times \sum{\frac{\partial F_{t, x, p, j}}{\partial x}} + L \times \sum_p{N_{kinetic, t, x, p, j}} + L \times \sum_p{N_{equilibrium, t, x, p, j}} + L \times \sum_p{N_{transfer, t, x, p, j}} + L \times N_{custom, t, x, j}$$

fd is a flow direction term, which allows for material flow to be defined in either direction. If material flow is defined as forward, fd =  − 1, otherwise fd = 1.

The Ncustom, t, x, j term allows the user to provide custom terms (variables or expressions) in both mass and molar basis which will be added into the material balances, which will be converted as necessary to the same basis as the material balance (by multiplying or dividing by the component molecular weight). The basis of the material balance is determined by the physical property package, and if undefined (or not mass or mole basis), an Exception will be returned.

`material_flow_linking_constraints(t, x, p, j)`:

This constraint is an internal constraint used to link the extensive material flow terms in the StateBlocks into a single indexed variable. This is required as Pyomo.DAE requires a single indexed variable to create the associated DerivativeVars and their numerical expansions.

If has_holdup is True, `material_holdup_calculation(t, x, p, j)`:


Mt, x, p, j = ρt, x, p, j × A × ϕt, x, p

where ρt, x, p, j is the density of component j in phase p at time t and location x.

If dynamic is True:

Numerical discretization of the derivative terms, $\frac{\partial M_{t,x,p,j}}{\partial t}$, will be performed by Pyomo.DAE.

If has_rate_reactions is True, `rate_reaction_stoichiometry_constraint(t, x, p, j)`:


Nkinetic, t, x, p, j = αr, p, j × Xkinetic, t, x, r

where αr, p.j is the stoichiometric coefficient of component j in phase p for reaction r (as defined in the PhysicalParameterBlock).

If has_equilibrium_reactions argument is True, `equilibrium_reaction_stoichiometry_constraint(t, x, p, j)`:


Nequilibrium, t, x, p, j = αr, p, j × Xequilibrium, t, x, r

where αr, p.j is the stoichiometric coefficient of component j in phase p for reaction r (as defined in the PhysicalParameterBlock).

add_total_element_balances

Material balances are written for each element in the mixture.

Variables

Variable Name Symbol Indices Conditions
element_holdup Mt, x, e t, x, e has_holdup = True
phase_fraction ϕt, x, p t, x, p has_holdup = True
element_accumulation $\frac{\partial M_{t,x,e}}{\partial t}$ t, x, e dynamic = True
elemental_mass_transfer_term Ntransfer, t, x, e t, x, e has_mass_transfer = True
elemental_flow_term Ft, x, e t, x, e None

Constraints

`elemental_flow_constraint(t, x, e)`:


Ft, x, e = ∑pjFt, x, p, j × nj, e

where nj, e is the number of moles of element e in component j.

`element_balances(t, x, e)`:

$$L \times \frac{\partial M_{t, x, e}}{\partial t} = fd \times \frac{\partial F_{t, x, e}}{\partial x} + L \times N_{transfer, t, p, j} + L \times N_{custom, t, e}$$

fd is a flow direction term, which allows for material flow to be defined in either direction. If material flow is defined as forward, fd =  − 1, otherwise fd = 1.

The Ncustom, t, x, e term allows the user to provide custom terms (variables or expressions) which will be added into the material balances.

If has_holdup is True, `elemental_holdup_calculation(t, x, e)`:


Mt, x, e = ρt, x, p, j × A × ϕt, x, p

where ρt, x, p, j is the density of component j in phase p at time t and location x.

If dynamic is True:

Numerical discretization of the derivative terms, $\frac{\partial M_{t,x,p,j}}{\partial t}$, will be performed by Pyomo.DAE.

add_total_enthalpy_balances

A single enthalpy balance is written for the entire mixture at each point in the spatial domain.

Variables

Variable Name Symbol Indices Conditions
energy_holdup Et, x, p t, x, p has_holdup = True
phase_fraction ϕt, x, p t, x, p has_holdup = True
energy_accumulation $\frac{\partial E_{t,x,p}}{\partial t}$ t, x, p dynamic = True
_enthalpy_flow Ht, x, p t, x, p None
enthalpy_flow_dx $\frac{\partial H_{t,x,p}}{\partial x}$ t, x, p None
heat Qt, x t, x has_heat_transfer = True
work Wt, x t, x has_work_transfer = True
enthalpy_transfer Htransfer, t, x t, x has_enthalpy_transfer = True

Expressions

`heat_of_reaction(t, x)`:


Qrxn, t, x = sumrXkinetic, t, x, r × ΔHrxn, r + sumrXequilibrium, t, x, r × ΔHrxn, r

where Qrxn, t, x is the total enthalpy released by both kinetic and equilibrium reactions, and ΔHrxn, r is the specific heat of reaction for reaction r.

Parameters

Parameter Name Symbol Default Value
scaling_factor_energy senergy 1E-6

Constraints

`enthalpy_balance(t)`:

$$s_{energy} \times L \times \sum_p{\frac{\partial E_{t, x, p}}{\partial t}} = s_{energy} \times fd \ times \sum_p{\frac{\partial H_{t, x, p}}{\partial x}} + s_{energy} \times L \times Q_{t,x} + s_{energy} \times L \times W_{t,x} + s_{energy} \times L \times H_{transfer,t,x} + s_{energy} \times L \times Q_{rxn, t, x} + s_{energy} \times L \times E_{custom, t, x}$$

fd is a flow direction term, which allows for material flow to be defined in either direction. If material flow is defined as forward, fd =  − 1, otherwise fd = 1.

The Ecustom, t, x term allows the user to provide custom terms which will be added into the energy balance.

`enthalpy_flow_linking_constraints(t, x, p)`:

This constraint is an internal constraint used to link the extensive enthalpy flow terms in the StateBlocks into a single indexed variable. This is required as Pyomo.DAE requires a single indexed variable to create the associated DerivativeVars and their numerical expansions.

If has_holdup is True, `enthalpy_holdup_calculation(t, x, p)`:


Et, x, p = ut, x, p × A × ϕt, x, p

where ut, x, p is the internal density (specific internal energy) of phase p at time t and location x.

If dynamic is True:

Numerical discretization of the derivative terms, $\frac{\partial E_{t,x,p}}{\partial t}$, will be performed by Pyomo.DAE.

add_total_pressure_balances

A single pressure balance is written for the entire mixture at all points in the spatial domain.

Variables

Variable Name Symbol Indices Conditions
pressure Pt, x t, x None
pressure_dx $\frac{\partial P_{t,x}}{\partial x}$ t, x None
deltaP ΔPt, x t, x has_pressure_change = True

Parameters

Parameter Name Symbol Default Value
scaling_factor_pressure spressure 1E-4

Constraints

`pressure_balance(t, x)`:

$$0 = s_{pressure} \times fd \times \frac{\partial P_{t,x}}{\partial x} + s_{pressure} \times L \times \Delta P_{t,x} + s_{pressure} \times L \times \Delta P_{custom, t, x}$$

fd is a flow direction term, which allows for material flow to be defined in either direction. If material flow is defined as forward, fd =  − 1, otherwise fd = 1.

The ΔPcustom, t, x term allows the user to provide custom terms which will be added into the pressure balance.

`pressure_linking_constraint(t, x)`:

This constraint is an internal constraint used to link the pressure terms in the StateBlocks into a single indexed variable. This is required as Pyomo.DAE requires a single indexed variable to create the associated DerivativeVars and their numerical expansions.