コード例 #1
0
    def test_set_Tv(self):
        """Set a pair of properties of the State and check the properties.

        Also works as a functional/regression test of CoolProp.
        """
        s = State(substance="water")
        s.Tv = Q_(400.0, "K"), Q_(1.801983936953226, "m**3/kg")
        assert isclose_quant(s.T, Q_(400.0, "K"))
        assert isclose_quant(s.p, Q_(101325.0, "Pa"))
        assert isclose_quant(s.Tv[0], Q_(400.0, "K"))
        assert isclose_quant(s.Tv[1], Q_(1.801983936953226, "m**3/kg"))
        assert isclose_quant(s.u, Q_(2547715.3635084038, "J/kg"))
        assert isclose_quant(s.s, Q_(7496.2021523754065, "J/(kg*K)"))
        assert isclose_quant(s.cp, Q_(2009.2902478486988, "J/(kg*K)"))
        assert isclose_quant(s.cv, Q_(1509.1482452129906, "J/(kg*K)"))
        assert isclose_quant(s.v, Q_(1.801983936953226, "m**3/kg"))
        assert isclose_quant(s.h, Q_(2730301.3859201893, "J/kg"))
        assert s.x is None
コード例 #2
0
    def test_set_hv(self):
        """Set a pair of properties of the State and check the properties.

        Also works as a functional/regression test of CoolProp.
        """
        s = State(substance="water")
        s.hv = Q_(1061602.391543017, "J/kg"), Q_(0.4772010021515822, "m**3/kg")
        assert isclose_quant(s.T, Q_(373.1242958476843, "K"))
        assert isclose_quant(s.p, Q_(101325.0, "Pa"))
        assert isclose_quant(s.hv[0], Q_(1061602.391543017, "J/kg"))
        assert isclose_quant(s.hv[1], Q_(0.4772010021515822, "m**3/kg"))
        assert isclose_quant(s.u, Q_(1013250, "J/kg"))
        assert isclose_quant(s.s, Q_(3028.9867985920914, "J/(kg*K)"))
        assert isclose_quant(s.v, Q_(0.4772010021515822, "m**3/kg"))
        assert isclose_quant(s.h, Q_(1061602.391543017, "J/kg"))
        assert isclose_quant(s.x, Q_(0.28475636946248034, "dimensionless"))
コード例 #3
0
    def test_set_hp(self):
        """Set a pair of properties of the State and check the properties.

        Also works as a functional/regression test of CoolProp.
        """
        s = State(substance="water")
        s.hp = Q_(1061602.391543017, "J/kg"), Q_(101325.0, "Pa")
        assert isclose_quant(s.T, Q_(373.1242958476843, "K"))
        assert isclose_quant(s.p, Q_(101325.0, "Pa"))
        assert isclose_quant(s.hp[0], Q_(1061602.391543017, "J/kg"))
        assert isclose_quant(s.hp[1], Q_(101325.0, "Pa"))
        assert isclose_quant(s.u, Q_(1013250, "J/kg"))
        assert isclose_quant(s.s, Q_(3028.9867985920914, "J/(kg*K)"))
        assert isclose_quant(s.v, Q_(0.4772010021515822, "m**3/kg"))
        assert isclose_quant(s.h, Q_(1061602.391543017, "J/kg"))
        assert isclose_quant(s.x, Q_(0.28475636946248034, "dimensionless"))
        s.hp = Q_(3336406.139862406, "J/kg"), Q_(101325.0, "Pa")
        assert isclose_quant(s.T, Q_(700.9882316847855, "K"))
        assert isclose_quant(s.p, Q_(101325.0, "Pa"))
        assert isclose_quant(s.hp[0], Q_(3336406.139862406, "J/kg"))
        assert isclose_quant(s.hp[1], Q_(101325.0, "Pa"))
        assert isclose_quant(s.u, Q_(3013250, "J/kg"))
        assert isclose_quant(s.s, Q_(8623.283568815832, "J/(kg*K)"))
        assert isclose_quant(s.v, Q_(3.189303132125469, "m**3/kg"))
        assert isclose_quant(s.h, Q_(3336406.139862406, "J/kg"))
        assert s.x is None
コード例 #4
0
    def test_set_Tx(self):
        """Set a pair of properties of the State and check the properties.

        Also works as a functional/regression test of CoolProp.
        """
        s = State(substance="water")
        s.Tx = Q_(400.0, "K"), Q_(0.5, "dimensionless")
        assert isclose_quant(s.T, Q_(400.0, "K"))
        assert isclose_quant(s.p, Q_(245769.34557103913, "Pa"))
        assert isclose_quant(s.Tx[0], Q_(400.0, "K"))
        assert isclose_quant(s.Tx[1], Q_(0.5, "dimensionless"))
        assert isclose_quant(s.u, Q_(1534461.5163075812, "J/kg"))
        assert isclose_quant(s.s, Q_(4329.703956664546, "J/(kg*K)"))
        assert isclose_quant(s.cp, Q_(4056.471547685226, "J/(kg*K)"))
        assert isclose_quant(s.cv, Q_(2913.7307270395363, "J/(kg*K)"))
        assert isclose_quant(s.v, Q_(0.3656547423394701, "m**3/kg"))
        assert isclose_quant(s.h, Q_(1624328.2430353598, "J/kg"))
        assert isclose_quant(s.x, Q_(0.5, "dimensionless"))
        s.Tx = Q_(400.0, "K"), Q_(50, "percent")
        assert isclose_quant(s.T, Q_(400.0, "K"))
        assert isclose_quant(s.p, Q_(245769.34557103913, "Pa"))
        assert isclose_quant(s.Tx[0], Q_(400.0, "K"))
        assert isclose_quant(s.Tx[1], Q_(0.5, "dimensionless"))
        assert isclose_quant(s.u, Q_(1534461.5163075812, "J/kg"))
        assert isclose_quant(s.s, Q_(4329.703956664546, "J/(kg*K)"))
        assert isclose_quant(s.cp, Q_(4056.471547685226, "J/(kg*K)"))
        assert isclose_quant(s.cv, Q_(2913.7307270395363, "J/(kg*K)"))
        assert isclose_quant(s.v, Q_(0.3656547423394701, "m**3/kg"))
        assert isclose_quant(s.h, Q_(1624328.2430353598, "J/kg"))
        assert isclose_quant(s.x, Q_(0.5, "dimensionless"))