예제 #1
0
파일: thermo.py 프로젝트: Ex-Mente/auxi.0
    def get_element_mass(self, element):
        """
        Determine the mass of the specified elements in the package.

        :returns: Masses. [kg]
        """

        result = numpy.zeros(1)
        for compound in self.material.compounds:
            result += self.get_compound_mass(compound) *\
                stoich.element_mass_fractions(compound, [element])
        return result[0]
예제 #2
0
파일: thermo.py 프로젝트: Ex-Mente/auxi.0
    def get_element_masses(self, elements=None):
        """
        Determine the masses of elements in the package.

        :returns: Array of element masses. [kg]
        """

        if elements is None:
            elements = self.material.elements
        result = numpy.zeros(len(elements))
        for compound in self.material.compounds:
            result += self.get_compound_mass(compound) *\
                stoich.element_mass_fractions(compound, elements)
        return result