コード例 #1
0
ファイル: test_nitrogen.py プロジェクト: j-thd/thesis
    def test_table(self):
        # Page 1410 of Span2000 and further. Values must be converted to kg/m^3 from mol/dm^3 with molar mass = 0.02801348e3
        fp = FluidProperties("nitrogen")
        # Just use a single temperature
        T = 300  # [K]

        # density in, pressure out
        in_out = ((1.1232845210400002, 1e5, -1), (2.2469612308, 2e5, -1),
                  (5.6200643576000004, 5e5, -2), (11.248812894, 10e5, -1),
                  (16.883724396, 15e5, -2), (22.523398189599998, 20e5, -1))

        for rho, p, places in in_out:
            res_p = fp.get_pressure(T=T, rho=rho)
            self.assertAlmostEqual(res_p, p, places=places)

        # Again, but different temperature
        T = 1000  # [K]

        in_out = ((0.33680607004, 1e5, 0), (0.67338803224, 2e5, -1), (
            1.68170523136,
            5e5,
            -1,
        ), (3.35775173976, 10e5, -2), (5.027859390400001, 15e5, -2),
                  (6.6921402372, 20e5, -2))

        for rho, p, places in in_out:
            res_p = fp.get_pressure(T=T, rho=rho)
            self.assertAlmostEqual(res_p, p, places=places)
コード例 #2
0
ファイル: test_nitrogen.py プロジェクト: j-thd/thesis
    def test_table(self):
        # Table V from Lemmon2004 has density as inputs, which is not interesting for our purposes, so first the pressure must be obtained

        fp = FluidProperties("nitrogen")

        # T in, Density in mol/dm^3, thermal conductivity in W/(m*K)
        in_out = ((100, 25.0, 103.834e-3, 6), (200, 10.0, 36.0099e-3, 7),
                  (300, 5.0, 32.7694e-3, 7))

        molar_mass = 0.02801348  # [kg/mol] also from Span2000

        for T, rho, kappa, places in in_out:
            p = fp.get_pressure(T=T, rho=rho * molar_mass * 1e3)
            res_kappa = fp.get_thermal_conductivity(T=T, p=p)
            self.assertAlmostEqual(res_kappa, kappa, places=places)
コード例 #3
0
ファイル: test_nitrogen.py プロジェクト: j-thd/thesis
    def test_table(self):
        # Table V from Lemmon2004 has density as inputs, which is not interesting for our purposes, so first the pressure must be obtained

        fp = FluidProperties("nitrogen")

        # T in, Density in mol/dm^3, viscosity out Pa*s
        in_out = ((100, 25.0, 79.7418e-6, 10), (200, 10.0, 21.0810e-6, 10),
                  (300, 5.0, 20.7430e-6, 10))

        molar_mass = 0.02801348  # [kg/mol] also from Span2000

        for T, rho, mu, places in in_out:
            p = fp.get_pressure(T=T, rho=rho * molar_mass * 1e3)
            res_mu = fp.get_viscosity(T=T, p=p)
            self.assertAlmostEqual(res_mu, mu, places=places)