Example #1
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 = TrayColumn(
            default={
                "number_of_trays": 10,
                "feed_tray_location": 5,
                "condenser_type": CondenserType.totalCondenser,
                "condenser_temperature_spec": TemperatureSpec.atBubblePoint,
                "property_package": m.fs.properties,
                "has_heat_transfer": False,
                "has_pressure_change": False
            })

        # Inlet feed conditions
        m.fs.unit.feed.flow_mol.fix(100)
        m.fs.unit.feed.temperature.fix(368)
        m.fs.unit.feed.pressure.fix(101325)
        m.fs.unit.feed.mole_frac_comp[0, "benzene"].fix(0.5)
        m.fs.unit.feed.mole_frac_comp[0, "toluene"].fix(0.5)

        # unit level inputs
        m.fs.unit.condenser.reflux_ratio.fix(1.4)
        m.fs.unit.condenser.condenser_pressure.fix(101325)

        m.fs.unit.reboiler.boilup_ratio.fix(1.3)

        assert degrees_of_freedom(m) == 0

        return m
    def btx_ftpz_generic(self):
        m = ConcreteModel()
        m.fs = FlowsheetBlock(default={"dynamic": False})
        m.fs.properties = GenericParameterBlock(default=configuration)

        m.fs.unit = TrayColumn(
            default={
                "number_of_trays": 10,
                "feed_tray_location": 5,
                "condenser_type": CondenserType.totalCondenser,
                "condenser_temperature_spec": TemperatureSpec.atBubblePoint,
                "property_package": m.fs.properties,
                "has_heat_transfer": False,
                "has_pressure_change": False
            })

        # Inlet feed conditions
        m.fs.unit.feed.flow_mol.fix(100)
        m.fs.unit.feed.temperature.fix(368)
        m.fs.unit.feed.pressure.fix(101325)
        m.fs.unit.feed.mole_frac_comp[0, "benzene"].fix(0.5)
        m.fs.unit.feed.mole_frac_comp[0, "toluene"].fix(0.5)

        # unit level inputs
        m.fs.unit.condenser.reflux_ratio.fix(1.4)
        m.fs.unit.condenser.condenser_pressure.fix(101325)

        m.fs.unit.reboiler.boilup_ratio.fix(1.3)

        return m
Example #3
0
def test_config():

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

    m.fs.unit = TrayColumn(
        default={
            "number_of_trays": 10,
            "feed_tray_location": 5,
            "condenser_type": CondenserType.totalCondenser,
            "condenser_temperature_spec": TemperatureSpec.customTemperature,
            "property_package": m.fs.properties,
            "has_heat_transfer": False,
            "has_pressure_change": False
        })

    assert len(m.fs.unit.config) == 12

    assert m.fs.unit.tray[5].config.is_feed_tray

    assert hasattr(m.fs.unit, "condenser")
    assert hasattr(m.fs.unit, "reboiler")

    assert hasattr(m.fs.unit, "liq_stream")
    assert hasattr(m.fs.unit, "vap_stream")
Example #4
0
def distillation_model():
    m = ConcreteModel()
    m.fs = FlowsheetBlock(default={"dynamic": False})
    m.fs.properties = BTXParameterBlock(default={"valid_phase": ('Liq', 'Vap'),
                                            "activity_coeff_model": "Ideal",
                                            "state_vars": "FTPz"})
    m.fs.unit = TrayColumn(default={
                        "number_of_trays": 3,
                        "feed_tray_location": 2,
                        "condenser_type":
                            CondenserType.totalCondenser,
                        "condenser_temperature_spec":
                            TemperatureSpec.atBubblePoint,
                        "property_package": m.fs.properties})
    return m