Exemplo n.º 1
0
def LN2evaporationFlow(vaporPressure, massFlow, T_incoming, P_incoming,
                       incomingGas):
    T = CoolProp.CoolProp.PropsSI('T', 'P', vaporPressure, 'Q', 0, 'Nitrogen')
    latentHeat = CoolProp.CoolProp.PropsSI(
        'H', 'P', vaporPressure,
        'Q', 1, 'Nitrogen') - CoolProp.CoolProp.PropsSI(
            'H', 'P', vaporPressure, 'Q', 0, 'Nitrogen')
    if incomingGas == 'He4':
        enthalpyDifference = hepak.HeCalc(
            'H', 0, 'T', T_incoming, 'P', P_incoming, 1) - hepak.HeCalc(
                'H', 0, 'T', T, 'P', P_incoming, 1)
    elif incomingGas == 'He3':
        incomingDensity = he3pak.He3Density(P_incoming, T_incoming)
        coldDensity = he3pak.He3Density(P_incoming, T)
        enthalpyDifference = he3pak.He3Prop(6, incomingDensity,
                                            T_incoming) - he3pak.He3Prop(
                                                6, coldDensity, T)
    elif incomingGas == 'He':
        enthalpyDifference = CoolProp.CoolProp.PropsSI(
            'enthalpy', 'T', T_incoming, 'P',
            P_incoming, 'Helium') - CoolProp.CoolProp.PropsSI(
                'enthalpy', 'T', T, 'P', P_incoming, 'Helium')
    else:
        raise NameError('Unknow gas ' + gas + '!')
    heatLoad = massFlow * enthalpyDifference
    return heatLoad / latentHeat
Exemplo n.º 2
0
def He3CoolingLoad(flow, pressure, inletTemperature, outletTemperature):
    inletDensity = he3pak.He3Density(pressure, inletTemperature)
    inletEnthalpy = he3pak.He3Prop(6, inletDensity, inletTemperature)
    outletDensity = he3pak.He3Density(pressure, outletTemperature)
    outletEnthalpy = he3pak.He3Prop(6, outletDensity, outletTemperature)
    return flow * (
        inletEnthalpy - outletEnthalpy
    )  # heat load on 1K pot = He3 gas flow * He3 enthalpy difference
Exemplo n.º 3
0
def He3Flow(inletTemperature, inletPressure, temperature, heatLoad):
    inletDensity = he3pak.He3Density(inletPressure, inletTemperature)
    inletEnthalpy = he3pak.He3Prop(6, inletDensity, inletTemperature)
    vaporEnthalpy = he3pak.He3SaturatedVaporProp(6, temperature)
    liquidEnthalpy = he3pak.He3SaturatedLiquidProp(6, temperature)
    liquidFraction = (inletEnthalpy - vaporEnthalpy) / (liquidEnthalpy -
                                                        vaporEnthalpy)
    latentHeat = he3pak.He3SaturatedLiquidProp(13, temperature)
    liquidFlow = heatLoad / latentHeat
    return liquidFlow / liquidFraction
Exemplo n.º 4
0
def velocity(massFlow, ID, OD, T, P, gas):
    if gas == 'He4':
        density = hepak.HeCalc('D', 0, 'T', T, 'P', P, 1)
    elif gas == 'He3':
        density = he3pak.He3Density(P, T)
    elif gas == 'N2':
        density = CoolProp.CoolProp.PropsSI('D', 'T', T, 'P', P, 'Nitrogen')
    elif gas == 'He':
        density = CoolProp.CoolProp.PropsSI('D', 'T', T, 'P', P, 'Helium')
    else:
        raise NameError('Unknow gas ' + gas + '!')
    crossSection = (OD**2 - ID**2) * math.pi / 4
    return massFlow / density / crossSection
Exemplo n.º 5
0
def dTdx2(massFlow, ID, OD, T, T_innerWall, T_outerWall, P, roughness, gas):
    if gas == 'He4':
        cP = hepak.HeCalc(14, 0, 'T', T, 'P', P, 1)
    elif gas == 'He3':
        density = he3pak.He3Density(P, T)
        cP = he3pak.He3Prop(9, density, T)
    elif gas == 'N2':
        cP = CoolProp.CoolProp.PropsSI('Cpmass', 'T', T, 'P', P, 'Nitrogen')
    elif gas == 'He':
        cP = CoolProp.CoolProp.PropsSI('Cpmass', 'T', T, 'P', P, 'Helium')
    else:
        raise NameError('Unknow gas ' + gas + '!')
    return dQdx2(massFlow, ID, OD, T, T_innerWall, T_outerWall, P, roughness,
                 gas) / cP / massFlow
Exemplo n.º 6
0
def reynoldsNumber(massFlow, ID, OD, T, P, gas):
    crossSection = (OD**2 - ID**2) * math.pi / 4.
    hydraulicDiameter = OD - ID
    if gas == 'He4':
        viscosity = hepak.HeCalc(25, 0, 'T', T, 'P', P, 1)
    elif gas == 'He3':
        density = he3pak.He3Density(P, T)
        viscosity = he3pak.He3Prop(29, density, T)
    elif gas == 'N2':
        viscosity = CoolProp.CoolProp.PropsSI('viscosity', 'T', T, 'P', P,
                                              'Nitrogen')
    elif gas == 'He':
        viscosity = CoolProp.CoolProp.PropsSI('viscosity', 'T', T, 'P', P,
                                              'Helium')
    else:
        raise NameError('Unknow gas ' + gas + '!')
    return massFlow * hydraulicDiameter / viscosity / crossSection
Exemplo n.º 7
0
def heatTransferCoeff(massFlow, ID, OD, T, T_wall, P, roughness, gas):
    Nu = nusseltNumber(massFlow, ID, OD, T, T_wall, P, roughness, gas)
    thermalConductivity = 0.
    if gas == 'He4':
        thermalConductivity = hepak.HeCalc(26, 0, 'T', T, 'P', P, 1)
    elif gas == 'He3':
        density = he3pak.He3Density(P, T)
        thermalConductivity = he3pak.He3Prop(28, density, T)
    elif gas == 'N2':
        thermalConductivity = CoolProp.CoolProp.PropsSI(
            'conductivity', 'T', T, 'P', P, 'Nitrogen')
    elif gas == 'He':
        thermalConductivity = CoolProp.CoolProp.PropsSI(
            'conductivity', 'T', T, 'P', P, 'Helium')
    else:
        raise NameError('Unknow gas ' + gas + '!')
    return Nu * thermalConductivity / (OD - ID)
Exemplo n.º 8
0
def nusseltNumber(massFlow, ID, OD, T, T_wall, P, roughness, gas):
    Re = reynoldsNumber(massFlow, ID, OD, T, P, gas)

    if Re < 1000:  # laminar flow
        return 4.36

    if gas == 'He4':
        prandtlNumber = hepak.HeCalc(27, 0, 'T', T, 'P', P, 1)
        viscosity = hepak.HeCalc(25, 0, 'T', T, 'P', P, 1)
        viscosity_wall = hepak.HeCalc(25, 0, 'T', T_wall, 'P', P, 1)
    elif gas == 'He3':
        density = he3pak.He3Density(P, T)
        prandtlNumber = he3pak.He3Prop(32, density, T)
        viscosity = he3pak.He3Prop(29, density, T)
        viscosity_wall = he3pak.He3Prop(29, density, T_wall)
    elif gas == 'N2':
        prandtlNumber = CoolProp.CoolProp.PropsSI('Prandtl', 'T', T, 'P', P,
                                                  'Nitrogen')
        viscosity = CoolProp.CoolProp.PropsSI('viscosity', 'T', T, 'P', P,
                                              'Nitrogen')
        viscosity_wall = CoolProp.CoolProp.PropsSI('viscosity', 'T', T_wall,
                                                   'P', P, 'Nitrogen')
    elif gas == 'He':
        prandtlNumber = CoolProp.CoolProp.PropsSI('Prandtl', 'T', T, 'P', P,
                                                  'Helium')
        viscosity = CoolProp.CoolProp.PropsSI('viscosity', 'T', T, 'P', P,
                                              'Helium')
        viscosity_wall = CoolProp.CoolProp.PropsSI('viscosity', 'T', T_wall,
                                                   'P', P, 'Helium')
    else:
        raise NameError('Unknow gas ' + gas + '!')

#  if Re > 10000.:
#  if not 0.7 <= prandtlNumber <= 16700.:
#    print('Prandtl number {0} outside valid range for Sieder-Tate correlation'.format(prandtlNumber))
    return 0.023 * Re**0.8 * prandtlNumber**(1. / 3.) * (
        viscosity / viscosity_wall)**0.14  # Sieder-Tate correlation
Exemplo n.º 9
0
import hepak
import he3pak

print('He4 Standard density:', hepak.HeCalc('D', 0, 'P', 101300, 'T', 273.15,
                                            1))
print(hepak.HeValidate(1, 2),
      hepak.HeMsg(hepak.HeCalc(-1, 0, 'P', 101300, 'T', 273.15, 1)))

print('\nList of HEPAK properties and their units:')
for p in range(40):
    print(p, hepak.HeProperty(p), [hepak.HeUnit(p, u) for u in range(1, 5)])

print('\nList of HEPAK constants:')
for p in range(1, 16):
    print(p, hepak.HeConst(p))
print('\n')

print('He3 standard density:', he3pak.He3Density(101300, 273.15), 'kg/m3')
print('He3 saturated density at 3K: {0} kg/m3 (liquid), {1} kg/m3 (vapor)'.
      format(he3pak.He3SaturatedLiquidProp(3, 0.8),
             he3pak.He3SaturatedVaporProp(3, 0.8)))
print('He3 temperature at saturated vapor pressure of 1 atm:',
      he3pak.He3SaturatedTemperature(101300), 'K')
Exemplo n.º 10
0
def plotTubeInTubeHEX(sol, innerMassFlow, innerID, innerOD, innerGas,
                      outerMassFlow, outerID, outerOD, outerGas, N2ID, N2OD,
                      roughness):
    fig, axes = plt.subplots(3, 2, figsize=(9.6, 10.8))
    fig.set_tight_layout(True)
    axes[0][0].plot(sol.x, sol.y[0], color='tab:red')
    axes[0][0].plot(sol.x, sol.y[1], color='tab:blue')
    y = numpy.array([Twall(innerMassFlow, innerID, innerOD, T_He, P_He, innerGas, outerMassFlow, outerID, outerOD, T_He3, P_He3, outerGas, roughness) \
                     for T_He, T_He3, P_He, P_He3 in zip(sol.y[0], sol.y[1], sol.y[2], sol.y[3])])
    axes[0][0].plot(sol.x, y, color='tab:brown')
    if len(sol.y) > 4:
        N2massFlow = LN2evaporationFlow(sol.y[5][0], He3MassFlow, sol.y[1][0],
                                        sol.y[3][0], outerGas)
        axes[0][0].plot(sol.x, sol.y[4], color='tab:green')
        y = numpy.array([Twall(innerMassFlow, innerID, innerOD, T_He, P_He, outerGas, N2massFlow, 0., N2OD, T_N2, P_N2, 'N2', roughness) \
                         for T_N2, T_He, P_N2, P_He in zip(sol.y[0], sol.y[4], sol.y[2], sol.y[5])])
        axes[0][0].plot(sol.x, y, color='tab:purple')
    axes[0][0].set_yscale('log')
    axes[0][0].set_ylabel('Temperature (K)')
    axes[0][0].grid(True, 'both')

    y = numpy.array([
        reynoldsNumber(innerMassFlow, innerID, innerOD, T, P, innerGas)
        for T, P in zip(sol.y[0], sol.y[2])
    ])
    axes[0][1].plot(sol.x, y, color='tab:red')
    y = numpy.array([
        reynoldsNumber(outerMassFlow, outerID, outerOD, T, P, outerGas)
        for T, P in zip(sol.y[1], sol.y[3])
    ])
    axes[0][1].plot(sol.x, y, color='tab:blue')
    if len(sol.y) > 4:
        y = numpy.array([
            reynoldsNumber(N2massFlow, 0., N2OD, T, P, 'N2')
            for T, P in zip(sol.y[4], sol.y[5])
        ])
        axes[0][1].plot(sol.x, y, color='tab:green')
    y = numpy.array([nusseltNumber(outerMassFlow, outerID, outerOD, T_outer, Twall(innerMassFlow, innerID, innerOD, T_inner, P_inner, innerGas, outerMassFlow, outerID, outerOD, T_outer, P_outer, outerGas, roughness), P_outer, roughness, outerGas) \
                     for T_inner, P_inner, T_outer, P_outer in zip(sol.y[0], sol.y[2], sol.y[1], sol.y[3])])
    axes[0][1].plot(sol.x, y, color='tab:cyan')
    axes[0][1].set_yscale('log')
    axes[0][1].set_ylabel('Reynolds number')
    axes[0][1].grid(True, 'both')

    #y = numpy.array([hepak.HeCalc('D', 0, 'P', P_He, 'T', T, 1) for T, P_He in zip(sol.y[0], sol.y[2])])
    #axes[1][0].plot(sol.x, y, color = 'tab:red')
    y = numpy.array(
        [he3pak.He3Density(P_He3, T) for T, P_He3 in zip(sol.y[1], sol.y[3])])
    axes[1][0].plot(sol.x, y, color='tab:blue')
    axes[1][0].set_ylabel('Density (kg/m3)')
    axes[1][0].grid(True, 'both')

    y = numpy.array([
        velocity(innerMassFlow, innerID, innerOD, T, P, innerGas)
        for T, P in zip(sol.y[0], sol.y[2])
    ])
    axes[1][1].plot(sol.x, y, color='tab:red')
    y = numpy.array([
        velocity(outerMassFlow, outerID, outerOD, T, P, innerGas)
        for T, P in zip(sol.y[1], sol.y[3])
    ])
    axes[1][1].plot(sol.x, y, color='tab:blue')
    if len(sol.y) > 4:
        y = numpy.array([
            velocity(N2massFlow, N2ID, N2OD, T, P, 'N2')
            for T, P in zip(sol.y[4], sol.y[5])
        ])
        axes[1][1].plot(sol.x, y, color='tab:green')
    axes[1][1].set_yscale('log')
    axes[1][1].set_ylabel('Velocity (m/s)')
    axes[1][1].grid(True, 'both')

    axes[2][0].plot(sol.x, sol.y[2], color='tab:red')
    axes[2][0].plot(sol.x, sol.y[3], color='tab:blue')
    if len(sol.y) > 4:
        axes[2][0].plot(sol.x, sol.y[5], color='tab:green')
    axes[2][0].set_ylabel('Pressure (Pa)')
    axes[2][0].grid(True, 'both')

    while True:
        try:
            plt.savefig(
                'HEX7_{0:.4g}K_{1:.4g}K_{2:.4g}gs_{3:.4g}gs.pdf'.format(
                    sol.y[0][0], sol.y[1][-1], innerMassFlow, outerMassFlow))
        except PermissionError:
            input(
                'Could not save plots. If the target file is still opened in another application please close it. Press ENTER to try again.'
            )
        else:
            break
    plt.close()