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

        m.fs.properties = SaponificationParameterBlock()
        m.fs.reactions = SaponificationReactionParameterBlock(default={
                                "property_package": m.fs.properties})

        m.fs.unit = StoichiometricReactor(default={
                "property_package": m.fs.properties,
                "reaction_package": m.fs.reactions,
                "has_heat_transfer": True,
                "has_heat_of_reaction": True,
                "has_pressure_change": True})

        m.fs.unit.inlet.flow_vol.fix(1)
        m.fs.unit.inlet.conc_mol_comp[0, "H2O"].fix(55388.0)
        m.fs.unit.inlet.conc_mol_comp[0, "NaOH"].fix(100.0)
        m.fs.unit.inlet.conc_mol_comp[0, "EthylAcetate"].fix(100.0)
        m.fs.unit.inlet.conc_mol_comp[0, "SodiumAcetate"].fix(0.0)
        m.fs.unit.inlet.conc_mol_comp[0, "Ethanol"].fix(0.0)

        m.fs.unit.inlet.temperature.fix(303.15)
        m.fs.unit.inlet.pressure.fix(101325.0)

        m.fs.unit.rate_reaction_extent[0, 'R1'].fix(90)
        m.fs.unit.heat_duty.fix(0)
        m.fs.unit.deltaP.fix(0)

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

    m.fs.properties = PhysicalParameterTestBlock()
    m.fs.reactions = ReactionParameterTestBlock(default={
                            "property_package": m.fs.properties})

    m.fs.unit = StoichiometricReactor(default={
            "property_package": m.fs.properties,
            "reaction_package": m.fs.reactions})

    # Check unit config arguments
    assert len(m.fs.unit.config) == 12

    assert m.fs.unit.config.material_balance_type == \
        MaterialBalanceType.useDefault
    assert m.fs.unit.config.energy_balance_type == \
        EnergyBalanceType.useDefault
    assert m.fs.unit.config.momentum_balance_type == \
        MomentumBalanceType.pressureTotal
    assert not m.fs.unit.config.has_heat_transfer
    assert not m.fs.unit.config.has_pressure_change
    assert not m.fs.unit.config.has_heat_of_reaction
    assert m.fs.unit.config.property_package is m.fs.properties
    assert m.fs.unit.config.reaction_package is m.fs.reactions
Ejemplo n.º 3
0
    def sapon(self):
        m = ConcreteModel()
        m.fs = FlowsheetBlock(default={"dynamic": False})

        m.fs.properties = SaponificationParameterBlock()
        m.fs.reactions = SaponificationReactionParameterBlock(default={
                                "property_package": m.fs.properties})

        m.fs.unit = StoichiometricReactor(default={
                "property_package": m.fs.properties,
                "reaction_package": m.fs.reactions,
                "has_heat_transfer": True,
                "has_heat_of_reaction": True,
                "has_pressure_change": True})

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

        m.fs.thermo_params = GenericParameterBlock(default=thermo_config)
        m.fs.rxn_params = GenericReactionParameterBlock(
            default={
                "property_package": m.fs.thermo_params,
                **reaction_config
            })

        m.fs.unit = StoichiometricReactor(
            default={
                "property_package": m.fs.thermo_params,
                "reaction_package": m.fs.rxn_params,
                "has_heat_transfer": False,
                "has_heat_of_reaction": False,
                "energy_balance_type": EnergyBalanceType.none,
                "has_pressure_change": False
            })

        m.fs.unit.inlet.mole_frac_comp[0, "Mg(HCO3)2"].fix(0.00003)
        m.fs.unit.inlet.mole_frac_comp[0, "Mg(OH)2"].fix(0.)
        m.fs.unit.inlet.mole_frac_comp[0, "Ca(HCO3)2"].fix(0.00003)
        m.fs.unit.inlet.mole_frac_comp[0, "CaCO3"].fix(0.)
        m.fs.unit.inlet.mole_frac_comp[0, "H2O"].fix(0.99991)

        m.fs.unit.inlet.pressure.fix(101325.0)
        m.fs.unit.inlet.temperature.fix(298.)
        m.fs.unit.inlet.flow_mol.fix(10)

        m.fs.unit.outlet.temperature.fix(298.)

        m.fs.unit.outlet.mole_frac_comp[0, "Ca(HCO3)2"].fix(0.000015)
        m.fs.unit.outlet.mole_frac_comp[0, "Mg(HCO3)2"].fix(0.000015)
        m.fs.unit.outlet.mole_frac_comp[0, "Ca(OH)2"].fix(0.0000003)

        return m