Exemplo n.º 1
0
    def test_basic(self):
        """Basic calculation of some enthalpies."""
        specific_heat = np.array([1089.5, 1174., 1258.5])
        latent_heat = np.array([2531771., 2508371., 2484971.])

        expected = [[536447.103773,  818654.207476, 1097871.329623]]
        result = Utilities.calculate_enthalpy(
            self.mixing_ratio.data, specific_heat,
            latent_heat, self.temperature.data)

        self.assertArrayAlmostEqual(result, expected)
Exemplo n.º 2
0
    def test_basic(self):
        """Basic calculation of some enthalpies."""
        specific_heat = self.pressure.copy(data=[1089.5, 1174., 1258.5])
        specific_heat.units = 'J kg-1 K-1'
        latent_heat = self.pressure.copy(data=[2531771., 2508371., 2484971.])
        latent_heat.units = 'J kg-1'

        expected = [536447.1, 818654.2, 1097871.3]
        result = Utilities.calculate_enthalpy(self.mixing_ratio, specific_heat,
                                              latent_heat, self.temperature)

        self.assertArrayAlmostEqual(result.data, expected)
        self.assertEqual(result.units, Unit('J kg-1'))