Example #1
0
def Virials(variables):
    from CoolProp.HumidAirProp import HAProps_Aux
    import numpy as np

    varString = "%-10s" % ('T')
    units = "%-10s" % ('C')
    #Build the header
    for var in variables:
        varString += "%-20s" % (var)
        units += "%-20s" % (HAProps_Aux(var, 300, 100, 0.0)[1])
    print varString
    print units

    #Build the table
    for T in np.linspace(-60, 200, 27) + 273.15:
        values = "%-10.1f" % (T - 273.15)
        for var in variables:
            values += "%-20.10e" % (HAProps_Aux(var, T, 100, 0.0)[0])
        print values
Example #2
0
    def _lib(self):
        args = self.args()
        P = self._P()

        if "Tdb" in self._mode:
            tdb = self.kwargs["Tdb"]
        else:
            tdb = HAProps("Tdb", *args)
        tdp = HAProps("Tdp", *args)
        twb = HAProps("Twb", *args)
        w = HAProps("W", *args)
        HR = HAProps("RH", *args)*100
        Pvs = HAProps_Aux("p_ws", tdb, self._P_kPa, w)[0]*1000
        Pv = Pvs*HR/100
        ws = HAProps("W", "P", self._P_kPa, "Tdb", tdb, "RH", 1)
        v = HAProps("V", *args)
        h = HAProps("H", *args)

        return tdp, tdb, twb, P, Pvs, Pv, ws, w, HR, v, h
Example #3
0
print "Pure fluid Virial Coefficients Derivatives"
print "------------------------------------------"
Virials(['dBaa', 'dCaaa', 'dBww', 'dCwww'])
Virials(['dBaw', 'dCaaw', 'dCaww'])

##############################
####### Water Saturation #####
##############################

print ""
print "Water saturation pressure p_ws [kPa]"
from CoolProp.HumidAirProp import HAProps_Aux
import numpy as np
Tv = np.linspace(-60, 300, 13) + 273.15
print "%-10s %-20s" % ('T', 'p_ws')
print "%-10s %-20s" % ('C', HAProps_Aux('p_ws', Tv[-1], 100, 0.0)[1])
#Build the table
for T in Tv:
    values = "%-10.2f" % (T - 273.15)
    values += "%-20.10e" % (HAProps_Aux('p_ws', T, 100, 0.0)[0])
    print values

##############################
####### Henry Constant #######
##############################

print ""
print "Henry Constant (zero for T < 273.15 K)"
from CoolProp.HumidAirProp import HAProps_Aux
import numpy as np
Tv = np.linspace(0, 300, 11) + 273.16