示例#1
0
    def test_liquid_input_reading(self):
        """
        Check if constant concentration condition is well handled. 
        From input file reading to information storage in liquid reactor object.
        """
        rmg = RMG()
        rmg.input_file = os.path.join(os.path.dirname(rmgpy.__file__),
                                      'solver', 'files',
                                      'liquid_phase_constSPC', 'input.py')
        rmg.initialize()

        for index, reactionSystem in enumerate(rmg.reaction_systems):
            self.assertIsNotNone(
                reactionSystem.const_spc_names,
                'Reactor should contain constant species name and indices after few steps'
            )
            self.assertIsNotNone(
                reactionSystem.const_spc_indices,
                'Reactor should contain constant species indices in the core species array'
            )
            self.assertIs(
                reactionSystem.const_spc_names[0],
                rmg.reaction_model.core.species[
                    reactionSystem.const_spc_indices[0]].label,
                'The constant species name from the reaction model and constantSPCnames should be equal'
            )