コード例 #1
0
def get_T_iso(state=AS("HEOS", "Water")):
    try:
        state.build_phase_envelope("dummy")
    except:
        pass
    try:
        T_c = state.T_critical()
    except:
        try:
            T_c, r_c = state.true_critical_point()
        except:
            T_c = (state.Tmin() + state.Tmax()) / 2.0
    T_min = state.Tmin()
    T_max = state.Tmax()
    return np.array([(T_c + T_min) / 2.0, T_c, (T_c + T_max) / 2.0])
コード例 #2
0
def get_h_iso(state=AS("HEOS", "Water")):
    res = []
    try:
        T_c = state.T_critical()
        r_c = state.rhomolar_critical()
        state.update(CoolProp.DmolarT_INPUTS, r_c, T_c)
        res.append(state.hmass())
        state.update(CoolProp.QT_INPUTS, 0, 0.75 * T_c)
        res.append(state.hmass())
        state.update(CoolProp.QT_INPUTS, 1, 0.75 * T_c)
        res.append(state.hmass())
        return np.array(res)
    except:
        state.build_phase_envelope("dummy")
        PE = state.get_phase_envelope_data()
        T_c = PE.T[int(len(PE.T) / 2)]
        p_c = PE.p[int(len(PE.p) / 2)]
        state.update(CoolProp.PQ_INPUTS, p_c, 0.0)
        res.append(state.hmass())
        state.update(CoolProp.PQ_INPUTS, p_c * 0.75, 0.0)
        res.append(state.hmass())
        state.update(CoolProp.PQ_INPUTS, p_c * 0.75, 1.0)
        res.append(state.hmass())
        return np.array(res)
コード例 #3
0
def get_T_range(state=AS("HEOS", "Water")):
    T_max = 100.0 + 273.15
    T_min = -50.0 + 273.15
    T_range = np.linspace(T_min, T_max, steps)
    return T_range
コード例 #4
0
def get_p_range(state=AS("HEOS", "Water")):
    p_max = 100.0e5
    p_min = 0.001e5
    p_range = np.logspace(np.log10(p_min), np.log10(p_max), steps, base=10)
    return p_range