Ejemplo n.º 1
0
    def btx_fctp(self):
        m = ConcreteModel()
        m.fs = FlowsheetBlock(default={"dynamic": False})

        m.fs.properties = BTXParameterBlock(
            default={
                "valid_phase": ('Liq', 'Vap'),
                "activity_coeff_model": "Ideal",
                "state_vars": "FcTP"
            })

        m.fs.unit = Condenser(
            default={
                "property_package": m.fs.properties,
                "condenser_type": CondenserType.totalCondenser,
                "temperature_spec": TemperatureSpec.atBubblePoint
            })

        # Fix the total condenser variables (FcTP)
        m.fs.unit.reflux_ratio.fix(1)
        m.fs.unit.condenser_pressure.fix(101325)

        # Fix the inputs (typically the outlet vapor from the top tray)
        m.fs.unit.inlet.flow_mol_comp[0, "benzene"].fix(0.5)
        m.fs.unit.inlet.flow_mol_comp[0, "toluene"].fix(0.5)
        m.fs.unit.inlet.temperature.fix(375)
        m.fs.unit.inlet.pressure.fix(101325)

        return m
Ejemplo n.º 2
0
    def btx_ftpz(self):
        m = ConcreteModel()
        m.fs = FlowsheetBlock(default={"dynamic": False})

        m.fs.properties = BTXParameterBlock(default={
            "valid_phase": ('Liq', 'Vap'),
            "activity_coeff_model": "Ideal"
        })

        m.fs.unit = Condenser(
            default={
                "property_package": m.fs.properties,
                "condenser_type": CondenserType.partialCondenser,
                "temperature_spec": TemperatureSpec.customTemperature
            })

        # Fix the partial condenser variables (FTPz)
        m.fs.unit.reflux_ratio.fix(1)
        m.fs.unit.condenser_pressure.fix(101325)
        m.fs.unit.distillate.temperature.fix(369)

        # Fix the inputs (typically this will be the vapor from the top tray)
        m.fs.unit.inlet.flow_mol.fix(1)
        m.fs.unit.inlet.temperature.fix(375)
        m.fs.unit.inlet.pressure.fix(101325)
        m.fs.unit.inlet.mole_frac_comp[0, "benzene"].fix(0.5)
        m.fs.unit.inlet.mole_frac_comp[0, "toluene"].fix(0.5)

        return m
Ejemplo n.º 3
0
    def btx_ftpz(self):
        m = ConcreteModel()
        m.fs = FlowsheetBlock(default={"dynamic": False})

        m.fs.properties = BTXParameterBlock(default={"valid_phase":
                                                     ('Liq', 'Vap'),
                                                     "activity_coeff_model":
                                                     "Ideal"})

        m.fs.unit = Condenser(
            default={"property_package": m.fs.properties,
                     "condenser_type": CondenserType.totalCondenser,
                     "temperature_spec": TemperatureSpec.atBubblePoint})

        return m
Ejemplo n.º 4
0
    def btx_fctp(self):
        m = ConcreteModel()
        m.fs = FlowsheetBlock(default={"dynamic": False})

        m.fs.properties = BTXParameterBlock(
            default={
                "valid_phase": ('Liq', 'Vap'),
                "activity_coeff_model": "Ideal",
                "state_vars": "FcTP"
            })

        m.fs.unit = Condenser(
            default={
                "property_package": m.fs.properties,
                "condenser_type": CondenserType.partialCondenser,
                "temperature_spec": TemperatureSpec.customTemperature
            })

        return m
Ejemplo n.º 5
0
def test_config():

    m = ConcreteModel()
    m.fs = FlowsheetBlock(default={"dynamic": False})
    m.fs.properties = PhysicalParameterTestBlock()

    m.fs.unit = Condenser(
        default={"property_package": m.fs.properties,
                 "condenser_type": CondenserType.totalCondenser,
                 "temperature_spec": TemperatureSpec.customTemperature})

    assert len(m.fs.unit.config) == 8
    assert m.fs.unit.config.condenser_type == CondenserType.totalCondenser
    assert m.fs.unit.config.material_balance_type == \
        MaterialBalanceType.useDefault
    assert m.fs.unit.config.energy_balance_type == \
        EnergyBalanceType.useDefault
    assert hasattr(m.fs.unit, "heat_duty")
    assert hasattr(m.fs.unit, "condenser_pressure")
Ejemplo n.º 6
0
    def build(self):
        """Build the model.

        Args:
            None
        Returns:
            None
        """
        # Call UnitModel.build to setup dynamics
        super(TrayColumnData, self).build()

        # Create set for constructing indexed trays
        if self.config.number_of_trays is not None:
            self.tray_index = RangeSet(1, self.config.number_of_trays)
            self._rectification_index = RangeSet(
                1, self.config.feed_tray_location - 1)
            self._stripping_index = RangeSet(
                self.config.feed_tray_location + 1,
                self.config.number_of_trays)

        else:
            raise ConfigurationError("The config argument number_of_trays "
                                     "needs to specified and cannot be None.")

        # Add trays
        # TODO:
        # 1. Add support for multiple feed tray locations
        # 2. Add support for specifying which trays have side draws
        self.rectification_section = Tray(self._rectification_index,
                                          default={
                                              "has_liquid_side_draw":
                                              self.config.has_liquid_side_draw,
                                              "has_vapor_side_draw":
                                              self.config.has_vapor_side_draw,
                                              "has_heat_transfer":
                                              self.config.has_heat_transfer,
                                              "has_pressure_change":
                                              self.config.has_pressure_change,
                                              "property_package":
                                              self.config.property_package,
                                              "property_package_args":
                                              self.config.property_package_args
                                          })

        self.feed_tray = Tray(
            default={
                "is_feed_tray": True,
                "has_liquid_side_draw": self.config.has_liquid_side_draw,
                "has_vapor_side_draw": self.config.has_vapor_side_draw,
                "has_heat_transfer": self.config.has_heat_transfer,
                "has_pressure_change": self.config.has_pressure_change,
                "property_package": self.config.property_package,
                "property_package_args": self.config.property_package_args
            })

        self.stripping_section = Tray(self._stripping_index,
                                      default={
                                          "has_liquid_side_draw":
                                          self.config.has_liquid_side_draw,
                                          "has_vapor_side_draw":
                                          self.config.has_vapor_side_draw,
                                          "has_heat_transfer":
                                          self.config.has_heat_transfer,
                                          "has_pressure_change":
                                          self.config.has_pressure_change,
                                          "property_package":
                                          self.config.property_package,
                                          "property_package_args":
                                          self.config.property_package_args
                                      })

        # Add condenser
        self.condenser = Condenser(
            default={
                "condenser_type": self.config.condenser_type,
                "temperature_spec": self.config.condenser_temperature_spec,
                "property_package": self.config.property_package,
                "property_package_args": self.config.property_package_args
            })

        # Add reboiler
        self.reboiler = Reboiler(
            default={
                "has_boilup_ratio": True,
                "has_pressure_change": self.config.has_pressure_change,
                "property_package": self.config.property_package,
                "property_package_args": self.config.property_package_args
            })

        # Add extension to the feed port
        self.feed = Port(extends=self.feed_tray.feed)

        # Add extensions to rectification section

        # Add extensions to stripping section

        # Construct arcs between trays, condenser, and reboiler
        self._make_rectification_arcs()
        self._make_stripping_arcs()
        self._make_feed_arcs()
        self._make_condenser_arcs()
        self._make_reboiler_arcs()

        TransformationFactory("network.expand_arcs").apply_to(self)