コード例 #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