Esempio n. 1
0
    def extractKinetics(reactionline):
        """
        Takes a reaction line from RMG and creates Arrhenius object from
        the kinetic data, as well as extracts names of reactants, products and comments.
        Units from RMG-Java are in cm3, mol, s.
        Reference Temperature T0 = 1 K.
        """
        lines = reactionline.split("\t")

        reaction_string = lines[0]
        reactants, products = reaction_string.split(" --> ")
        reactants = reactants.split(" + ")
        products = products.split(" + ")

        if len(reactants) == 1:
            Aunits = "s^-1"
        elif len(reactants) == 2:
            Aunits = "cm**3/mol/s"
        else:  # 3 reactants?
            Aunits = "cm**6/(mol^2*s)"

        kinetics = Arrhenius(
            A=(float(lines[1]), Aunits),
            n=float(lines[2]),
            Ea=(float(lines[3]), "kcal/mol"),
            T0=(1, "K"),
        )

        comments = "\t".join(lines[4:])
        kinetics.comment = "Estimated by RMG-Java:\n" + comments
        entry = Entry(long_desc=comments)

        return reactants, products, kinetics, entry
 def extractKinetics(reactionline):
     """
     Takes a reaction line from RMG and creates Arrhenius object from
     the kinetic data, as well as extracts names of reactants, products and comments.
 
     Units from RMG-Java are in cm3, mol, s.
     Reference Temperature T0 = 1 K.
     """
     lines = reactionline.split("\t")
 
     reaction_string = lines[0]
     reactants, products = reaction_string.split(" --> ")
     reactants = reactants.split(" + ")
     products = products.split(" + ")
     
     if len(reactants) == 1:
         Aunits = "s^-1"
     elif len(reactants) == 2:
         Aunits = "cm**3/mol/s"
     else:   # 3 reactants?
         Aunits = "cm**6/(mol^2*s)"
         
     kinetics = Arrhenius(
         A = (float(lines[1]), Aunits),
         n = float(lines[2]),
         Ea = (float(lines[3]),"kcal/mol"),
         T0 = (1,"K"),
     )
 
     comments = "\t".join(lines[4:])
     kinetics.comment = "Estimated by RMG-Java:\n"+comments
     entry = Entry(longDesc=comments)
 
     return reactants, products, kinetics, entry