Exemple #1
0
 def reactionString(self, i):
     """Reaction string for reaction number *i*"""
     s = ''
     nsp = _cantera.kin_nspecies(self.ckin)
     for k in range(nsp):
         nur = _cantera.kin_rstoichcoeff(self.ckin,k,i)
         if nur <> 0.0:
             if nur <> 1.0:
                 if nur <> round(nur):
                     s += str(nur)+' '
                 else:
                     s += `int(nur)`+' '
             s += self._sp[k]+' + '
     s = s[:-2]
     if self.isReversible(i):
         s += ' <=> '
     else:
         s += ' => '
     for k in range(nsp):
         nup = _cantera.kin_pstoichcoeff(self.ckin,k,i)
         if nup <> 0.0:
             if nup <> 1.0:
                 if nup <> round(nup):
                     s += str(nup)+' '
                 else:
                     s += `int(nup)`+' '
             s += self._sp[k]+' + '
     s = s[:-2]
     return s
Exemple #2
0
 def reactionString(self, i):
     """Reaction string for reaction number 'i'"""
     s = ''
     nsp = _cantera.kin_nspecies(self.ckin)
     for k in range(nsp):
         nur = _cantera.kin_rstoichcoeff(self.ckin, k, i)
         if nur <> 0.0:
             if nur <> 1.0:
                 if nur <> round(nur):
                     s += str(nur) + ' '
                 else:
                     s += ` int(nur) ` + ' '
             s += self._sp[k] + ' + '
     s = s[:-2]
     if self.isReversible(i):
         s += ' <=> '
     else:
         s += ' => '
     for k in range(nsp):
         nup = _cantera.kin_pstoichcoeff(self.ckin, k, i)
         if nup <> 0.0:
             if nup <> 1.0:
                 if nup <> round(nup):
                     s += str(nup) + ' '
                 else:
                     s += ` int(nup) ` + ' '
             s += self._sp[k] + ' + '
     s = s[:-2]
     return s
Exemple #3
0
 def reactantStoichCoeffs(self):
     """The array of reactant stoichiometric coefficients. Element
     [k,i] of this array is the reactant stoichiometric
     coefficient of species k in reaction i."""
     nsp = _cantera.kin_nspecies(self.ckin)
     nr = _cantera.kin_nreactions(self.ckin)
     nu = zeros((nsp,nr),'d')
     for i in range(nr):
         for k in range(nsp):
             nu[k,i] = _cantera.kin_rstoichcoeff(self.ckin,k,i)
     return nu
Exemple #4
0
 def reactantStoichCoeffs(self):
     """The array of reactant stoichiometric coefficients. Element
     [k,i] of this array is the reactant stoichiometric
     coefficient of species k in reaction i."""
     nsp = _cantera.kin_nspecies(self.ckin)
     nr = _cantera.kin_nreactions(self.ckin)
     nu = zeros((nsp, nr), 'd')
     for i in range(nr):
         for k in range(nsp):
             nu[k, i] = _cantera.kin_rstoichcoeff(self.ckin, k, i)
     return nu
Exemple #5
0
 def reactantStoichCoeff(self,k,i):
     """The stoichiometric coefficient of species *k* as a reactant in reaction *i*."""
     return _cantera.kin_rstoichcoeff(self.ckin,k,i)
Exemple #6
0
 def reactantStoichCoeff(self, k, i):
     """The stoichiometric coefficient of species k as a reactant in reaction i."""
     return _cantera.kin_rstoichcoeff(self.ckin, k, i)