Esempio n. 1
0
    def build(self):
        super(_PhysicalParameterBlock, self).build()

        self.p1 = Phase()
        self.p2 = Phase()

        self.c1 = Component()
        self.c2 = Component()

        self.phase_equilibrium_idx = Set(initialize=["e1", "e2"])
        self.element_list = Set(initialize=["H", "He", "Li"])
        self.element_comp = {"c1": {"H": 1, "He": 2, "Li": 3},
                             "c2": {"H": 4, "He": 5, "Li": 6}}

        self.phase_equilibrium_list = \
            {"e1": ["c1", ("p1", "p2")],
             "e2": ["c2", ("p1", "p2")]}

        # Add inherent reactions for use when needed
        self.inherent_reaction_idx = Set(initialize=["i1", "i2"])
        self.inherent_reaction_stoichiometry = {("i1", "p1", "c1"): 1,
                                                ("i1", "p1", "c2"): 1,
                                                ("i1", "p2", "c1"): 1,
                                                ("i1", "p2", "c2"): 1,
                                                ("i2", "p1", "c1"): 1,
                                                ("i2", "p1", "c2"): 1,
                                                ("i2", "p2", "c1"): 1,
                                                ("i2", "p2", "c2"): 1}

        # Attribute to switch flow basis for testing
        self.basis_switch = 1
        self.default_balance_switch = 1

        self._state_block_class = TestStateBlock

        self.set_default_scaling("flow_vol", 100)
        self.set_default_scaling("flow_mol", 101)
        self.set_default_scaling("flow_mol_phase_comp", 102)
        self.set_default_scaling("test_var", 103)
        self.set_default_scaling("pressure", 104)
        self.set_default_scaling("temperature", 105)
        self.set_default_scaling("enth_mol", 106)
        self.set_default_scaling("gibbs_mol_phase_comp", 107)
        self.set_default_scaling("entr_mol", 108)
        self.set_default_scaling("mole_frac_phase_comp", 109)
        self.set_default_scaling("enthalpy_flow", 110)
        self.set_default_scaling("energy_dens", 111)
        self.set_default_scaling("material_flow_mol", 112)
        self.set_default_scaling("material_dens_mol", 113)
        self.set_default_scaling("material_flow_mass", 114)
        self.set_default_scaling("material_dens_mass", 115)
Esempio n. 2
0
    def build(self):
        super(_NoPressureParameterBlock, self).build()

        self.p1 = Phase()
        self.p2 = Phase()
        self.c1 = Component()
        self.c2 = Component()

        self.phase_equilibrium_idx = Set(initialize=["e1", "e2"])

        self.phase_equilibrium_list = \
            {"e1": ["c1", ("p1", "p2")],
             "e2": ["c2", ("p1", "p2")]}

        self._state_block_class = NoPressureStateBlock
Esempio n. 3
0
    def build(self):
        super(ParameterData, self).build()

        # all components are in the aqueous phase
        self.aq = Phase()
        self.S = Component()
        self.E = Component()
        self.C = Component()
        self.P = Component()
        self.Solvent = Component()

        self._state_block_class = AqueousEnzymeStateBlock