当前位置: 首页>>代码示例>>Python>>正文


Python Species.states方法代码示例

本文整理汇总了Python中rmgpy.species.Species.states方法的典型用法代码示例。如果您正苦于以下问题:Python Species.states方法的具体用法?Python Species.states怎么用?Python Species.states使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rmgpy.species.Species的用法示例。


在下文中一共展示了Species.states方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: loadFAMEInput

# 需要导入模块: from rmgpy.species import Species [as 别名]
# 或者: from rmgpy.species.Species import states [as 别名]

#.........这里部分代码省略.........
            speciesDict[species.label] = species
            if species.label in moleculeDict:
                species.molecule = [moleculeDict[species.label]]
            
            # Read species E0
            E0units, E0 = readMeaningfulLine(f).split()
            species.E0 = Quantity(float(E0), E0units)
            
            # Read species thermo data
            H298units, H298 = readMeaningfulLine(f).split()
            S298units, S298 = readMeaningfulLine(f).split()
            Cpcount, Cpunits = readMeaningfulLine(f).split()
            Cpdata = []
            for i in range(int(Cpcount)):
                Cpdata.append(float(readMeaningfulLine(f)))
            species.thermo = ThermoData(
                H298 = Quantity(float(H298), H298units),
                S298 = Quantity(float(S298), S298units),
                Tdata = Quantity([300,400,500,600,800,1000,1500], "K"),
                Cpdata = Quantity(Cpdata, Cpunits),
            )
            
            # Read species collision parameters
            molWtunits, molWt = readMeaningfulLine(f).split()
            if molWtunits == 'u': molWtunits = 'g/mol'
            species.molecularWeight = Quantity(float(molWt), molWtunits)
            sigmaLJunits, sigmaLJ = readMeaningfulLine(f).split()
            epsilonLJunits, epsilonLJ = readMeaningfulLine(f).split()
            species.lennardJones = LennardJones(
                sigma = Quantity(float(sigmaLJ), sigmaLJunits),
                epsilon = Quantity(float(epsilonLJ), epsilonLJunits),
            )
            
            species.states = StatesModel()
            
            # Read species vibrational frequencies
            freqCount, freqUnits = readMeaningfulLine(f).split()
            frequencies = []
            for j in range(int(freqCount)):
                frequencies.append(float(readMeaningfulLine(f)))
            species.states.modes.append(HarmonicOscillator(
                frequencies = Quantity(frequencies, freqUnits),
            ))
            
            # Read species external rotors
            rotCount, rotUnits = readMeaningfulLine(f).split()
            if int(rotCount) > 0:
                raise NotImplementedError('Cannot handle external rotational modes in FAME input.')
            
            # Read species internal rotors
            freqCount, freqUnits = readMeaningfulLine(f).split()
            frequencies = []
            for j in range(int(freqCount)):
                frequencies.append(float(readMeaningfulLine(f)))
            barrCount, barrUnits = readMeaningfulLine(f).split()
            barriers = []
            for j in range(int(barrCount)):
                barriers.append(float(readMeaningfulLine(f)))
            if barrUnits == 'cm^-1':
                barrUnits = 'J/mol'
                barriers = [barr * constants.h * constants.c * constants.Na * 100. for barr in barriers]
            elif barrUnits in ['Hz', 's^-1']:
                barrUnits = 'J/mol'
                barriers = [barr * constants.h * constants.Na for barr in barriers]
            elif barrUnits != 'J/mol':
                raise Exception('Unexpected units "{0}" for hindered rotor barrier height.'.format(barrUnits))
开发者ID:ajalan,项目名称:RMG-Py,代码行数:70,代码来源:main.py


注:本文中的rmgpy.species.Species.states方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。