Skip to content

Latest commit

 

History

History
233 lines (170 loc) · 9.91 KB

File metadata and controls

233 lines (170 loc) · 9.91 KB

Pressure Changer

The IDAES Pressure Changer model represents a unit operation with a single stream of material which undergoes a change in pressure due to the application of a work. The Pressure Changer model contains support for a number of different thermodynamic assumptions regarding the working fluid.

Degrees of Freedom

Pressure Changer units generally have one or more degrees of freedom, depending on the thermodynamic assumption used.

Typical fixed variables are:

  • outlet pressure, Pratio or ΔP,
  • unit efficiency (isentropic or pump assumption).

Model Structure

The core Pressure Changer unit model consists of a single ControlVolume0D (named control_volume) with one Inlet Port (named inlet) and one Outlet Port (named outlet). Additionally, if an isentropic pressure changer is used, the unit model contains an additional StateBlock named properties_isentropic at the unit model level.

Variables

Pressure Changers contain the following Variables (not including those contained within the control volume Block):

Variable Name Notes
Pratio ratioP
Vt volume Only if has_rate_reactions = True, reference to control_volume.rate_reaction_extent
Wmechanical, t work_mechanical Reference to control_volume.work
Wfluid, t work_fluid Pump assumption only
ηpump, t efficiency_pump Pump assumption only
Wisentropic, t work_isentropic Isentropic assumption only
ηisentropic, t efficiency_isentropic Isentropic assumption only

Isentropic Pressure Changers also have an additional Property Block named properties_isentropic (attached to the Unit Model).

Constraints

In addition to the Constraints written by the Control Volume block, Pressure Changer writes additional Constraints which depend on the thermodynamic assumption chosen. All Pressure Changers add the following Constraint to calculate the pressure ratio:


Pratio, t × Pin, t = Pout, t

Isothermal Assumption

The isothermal assumption writes one additional Constraint:


Tout = Tin

Adiabatic Assumption

The isothermal assumption writes one additional Constraint:


Hout = Hin

Isentropic Assumption

The isentropic assumption creates an additional set of Property Blocks (indexed by time) for the isentropic fluid calculations (named properties_isentropic). This requires a set of balance equations relating the inlet state to the isentropic conditions, which are shown below:


Fin, t, p, j = Fisentropic, t, p, j


sin, t = sisentropic, t


Pin, t × Pratio, t = Pisentropic, t

where Ft, p, j is the flow of component j in phase p at time t and s is the specific entropy of the fluid at time t.

Next, the isentropic work is calculated as follows:


Wisentropic, t = ∑pHisentropic, t, p − ∑pHin, t, p

where Ht, p is the total energy flow of phase p at time t. Finally, a constraint which relates the fluid work to the actual mechanical work via an efficiency term η.

If compressor is True, Wisentropic, t = Wmechanical, t × ηt

If compressor is False, Wisentropic, t × ηt = Wmechanical, t

Pump (Incompressible Fluid) Assumption

The incompressible fluid assumption writes two additional constraints. Firstly, a Constraint is written which relates fluid work to the pressure change of the fluid.


Wfluid, t = (Pout, t − Pin, t) × Fvol, t

where Fvol, t is the total volumetric flowrate of material at time t (from the outlet Property Block). Secondly, a constraint which relates the fluid work to the actual mechanical work via an efficiency term η.

If compressor is True, Wfluid, t = Wmechanical, t × ηt

If compressor is False, Wfluid, t × ηt = Wmechanical, t

Performance Curves

Isentropic pressure changers support optional performance curve constraints. The exact form of these constraints is left to the user, but generally the constraints take the form of one or two equations which provide a correlation between head, efficiency, or pressure ratio and mass or volumetric flow. Additional variables such as compressor or turbine speed can be added if needed.

Performance curves should be added to the performance_curve sub-block rather than adding them elsewhere because it allows them to be integrated into the unit model initialization. It also provides standardization for users and provides a convenient way to turn the performance equations on and off by activating and deactivating the block.

Usually there are one or two performance curve constraints. Either directly or indirectly, these curves specify an efficiency and pressure drop, so in adding performance curves the efficiency and/or pressure drop should be freed as appropriate.

Performance equations generally are in a simple form (e.g. efficiency = f(flow)), where no special initialization is needed. Performance curves also are specific to a particular property package selection and pressure changer, which allows the performance curve equations to be written in a well-scaled way since units of measure and magnitudes are known.

To add performance curves to an isentropic pressure changer, simply supply the "support_isentropic_performance_curves": True options in the pressure changer config dict. This will create a performance_curve sub-block of the pressure changer model. By default this block will have the expressions head and heat_isentropic for convenience, as these quantities often appear in performance curves.

Two examples are provided below that demonstrate two ways to add performance curves. The first does not use a callback the second does.

from pyomo.environ import ConcreteModel, SolverFactory, units, value from idaes.core import FlowsheetBlock from idaes.generic_models.unit_models.pressure_changer import Turbine from idaes.generic_models.properties import iapws95 import pytest

solver = SolverFactory('ipopt') m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.properties = iapws95.Iapws95ParameterBlock() m.fs.unit = Turbine(default={ "property_package": m.fs.properties, "support_isentropic_performance_curves":True})

# Add performance curves @m.fs.unit.performance_curve.Constraint(m.fs.config.time) def pc_isen_eff_eqn(b, t): # main pressure changer block parent of performance_curve prnt = b.parent_block() return prnt.efficiency_isentropic[t] == 0.9 @m.fs.unit.performance_curve.Constraint(m.fs.config.time) def pc_isen_head_eqn(b, t): # divide both sides by 1000 for scaling return b.head_isentropic[t]/1000 == -75530.8/1000*units.J/units.kg

# set inputs m.fs.unit.inlet.flow_mol[0].fix(1000) # mol/s Tin = 500 # K Pin = 1000000 # Pa Pout = 700000 # Pa hin = iapws95.htpx(Tin*units.K, Pin*units.Pa) m.fs.unit.inlet.enth_mol[0].fix(hin) m.fs.unit.inlet.pressure[0].fix(Pin)

m.fs.unit.initialize() solver.solve(m, tee=False)

assert value(m.fs.unit.efficiency_isentropic[0]) == pytest.approx(0.9, rel=1e-3) assert value(m.fs.unit.deltaP[0]) == pytest.approx(-3e5, rel=1e-3)

The next example shows how to use a callback to add performance curves.

from pyomo.environ import ConcreteModel, SolverFactory, units, value from idaes.core import FlowsheetBlock from idaes.generic_models.unit_models.pressure_changer import Turbine from idaes.generic_models.properties import iapws95 import pytest

solver = SolverFactory('ipopt') m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.properties = iapws95.Iapws95ParameterBlock()

def perf_callback(blk):

# This callback adds constraints to the performance_cruve block. blk is the # performance_curve block, but we also want to use quantities from the main # pressure changer model, which is the parent block. prnt = blk.parent_block() # this is the pressure changer model block @blk.Constraint(m.fs.config.time) def pc_isen_eff_eqn(b, t): return prnt.efficiency_isentropic[t] == 0.9 @blk.Constraint(m.fs.config.time) def pc_isen_head_eqn(b, t): return b.head_isentropic[t]/1000 == -75530.8/1000*units.J/units.kg

m.fs.unit = Turbine(default={

"property_package": m.fs.properties, "support_isentropic_performance_curves":True, "isentropic_performance_curves": {"build_callback": perf_callback}})

# set inputs m.fs.unit.inlet.flow_mol[0].fix(1000) # mol/s Tin = 500 # K Pin = 1000000 # Pa Pout = 700000 # Pa hin = iapws95.htpx(Tin*units.K, Pin*units.Pa) m.fs.unit.inlet.enth_mol[0].fix(hin) m.fs.unit.inlet.pressure[0].fix(Pin)

m.fs.unit.initialize() solver.solve(m, tee=False)

assert value(m.fs.unit.efficiency_isentropic[0]) == pytest.approx(0.9, rel=1e-3) assert value(m.fs.unit.deltaP[0]) == pytest.approx(-3e5, rel=1e-3)

PressureChanger Class

idaes.generic_models.unit_models.pressure_changer

PressureChanger

PressureChangerData Class

PressureChangerData