Exemplo n.º 1
0
 def massFractions(self, species = None):
     """Species mass fraction array.
     If optional argument 'species'
     is supplied, then only the values for the selected species are
     returned.
     >>> y1 = ph.massFractions()   # all species
     >>> y2 = ph.massFractions(['OH', 'CH3'. 'O2'])
     """
     y = _cantera.phase_getarray(self._phase_id,21)
     return self.selectSpecies(y, species)
Exemplo n.º 2
0
    def moleFractions(self, species = None):
        """Species mole fraction array.
        If optional argument *species* is supplied, then only the values
        for the selected species are returned.

        >>> x1 = ph.moleFractions()   # all species
        >>> x2 = ph.moleFractions(['OH', 'CH3'. 'O2'])
        """
        x = _cantera.phase_getarray(self._phase_id,20)
        return self.selectSpecies(x, species)
Exemplo n.º 3
0
    def atomicWeights(self, elements = []):
        """Array of element molar masses [kg/kmol].

        If a sequence of element symbols is supplied, only the values
        for those elements are returned, ordered as in the
        list. Otherwise, the values are for all elements in the phase,
        ordered as in the input file.  """
        atw = _cantera.phase_getarray(self._phase_id,1)
        if elements:
            ae = []
            m = 0
            for e in elements:
                m = self.elementIndex(e)
                ae.append(atw[m])
            return asarray(ae)
        else:
            return atw
Exemplo n.º 4
0
 def molarMasses(self, species = None):
     """Array of species molar masses [kg/kmol]."""
     mm  = _cantera.phase_getarray(self._phase_id,22)
     return self.selectSpecies(mm, species)