def dTdx(x, T): if heatLoad == 0: return 0. if T[0] < hepak.HeConst(3): print('T_4He {0:.3g} outside HEPAK range!'.format(T[0])) return 0. if conductivityModel == 'HEPAK': k = hepak.HeCalc(38, 0, 'P', pressure, 'T', T[0], 1) # heat conductivity from HEPAK if k > 0: return (heatLoad / A)**3 / k else: print('HEPAK conductivity <= 0!') return 0. elif conductivityModel == 'VanSciver': g_lambda = hepak.HeCalc( 'D', 0, 'P', pressure, 'T', T[0], 1)**2 * 1559.**4 * hepak.HeConst(9)**3 / 1450. f_inverse = g_lambda * ((T[0] / hepak.HeConst(9))**5.7 * (1 - (T[0] / hepak.HeConst(9))**5.7) )**3 # heat conductivity from vanSciver return (heatLoad / A)**3 / f_inverse else: raise 'Invalid Gorter-Mellink model!'
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
def HeReservoirEvaporation(He3Flow, He3Pressure, He3InletTemperature, IPFlow, IPPressure, IPInletTemperature, staticLoad, reservoirPressure): reservoirTemperature = hepak.HeCalc('T', 0, 'P', reservoirPressure, 'SV', 0., 1) He3HeatLoad = He3CoolingLoad(He3Flow, He3Pressure, He3InletTemperature, reservoirTemperature) IPHeatLoad = HeCoolingLoad(IPFlow, IPPressure, IPInletTemperature, reservoirTemperature) return (He3HeatLoad + IPHeatLoad + staticLoad) / hepak.HeCalc( 7, 0, 'P', reservoirPressure, 'SL', 0., 1) # evaporation flow = heatLoad/latent heat
def segmentedVaporTemperature(T_low, T_high, lengths): dTdx = (T_high - T_low)/sum(lengths) pressure = hepak.HeCalc('P', 0, 'T', T_low, 'SV', 0, 1) x = 0. fermiPotentials = [] for length in lengths: x2 = x + length meanDensity = scipy.integrate.quad(lambda y: hepak.HeCalc('D', 0, 'T', T_low + y*dTdx, 'P', pressure, 1), x, x2)[0]/length meanTemperature = T_low + (dTdx*x2 + dTdx*x)/2. meanLifetime = scipy.integrate.quad(lambda y: vaporLifetime(T_low + dTdx*y, pressure), x, x2)[0]/length fermiImag = imaginaryFermiPotential(meanLifetime) fermiPotentials.append( (realFermiPotential(meanDensity), fermiImag) ) print('{0:.2f}m: {1:.3f}K, {2:.1f}s'.format(x + length/2., meanTemperature, meanLifetime)) x = x2 return fermiPotentials
def equationSet(x, parameters): heatLoad = parameters['Beam heating'] + parameters[ 'Isopure static heat'] + HeCoolingLoad( parameters['Isopure He flow'], parameters['Isopure He pressure'], x[1], x[2]) T_He3 = He3Temperature(x[0], parameters['3He pressure drop']) flow = He3Flow(x[1], parameters['3He inlet pressure'], T_He3, heatLoad) reservoirTemperature = hepak.HeCalc('T', 0, 'P', parameters['He reservoir pressure'], 'SV', 0., 1) OneKPotFlow = OneKPotEvaporation(x[0], parameters['3He inlet pressure'], parameters['HEX4 exit temperature'], \ parameters['Isopure He flow'], parameters['Isopure He pressure'], reservoirTemperature, \ parameters['He reservoir pressure'], parameters['HEX5 exit temperature'], parameters['1K pot static load'], x[1]) T_1Kpot = OneKPotTemperature(OneKPotFlow, parameters['He pressure drop']) T_HEX1_low = HEX1TemperatureLow(T_He3, parameters['HEX1 length'], parameters['Channel diameter'], parameters['HEX1 surface'], heatLoad) T_HEX1_high = HEX1TemperatureHigh(T_HEX1_low, parameters['HEX1 length'], heatLoad) T_HeII_low = HeIITemperatureLow(T_HEX1_high, parameters['HEX1 length'], parameters['Channel diameter'], heatLoad) return [flow - x[0], T_1Kpot - x[1], T_HeII_low - x[2]]
def printSegmentedTemperature(T_low, pressure, heatLoad, channelDiameter, channelLength, conductivityModel, segmentLength, YoshikiParameter): profile = UCNsource.GorterMellink(T_low, pressure, heatLoad, channelDiameter, channelLength, conductivityModel) A = math.pi/4.*channelDiameter**2 bottleVolume = 0.034 temperatureVolumeIntegral = scipy.integrate.quad(lambda x: profile(x)[0], 0., channelLength)[0]*A + profile(channelLength)[0]*bottleVolume meanTemperature = temperatureVolumeIntegral/(channelLength*A + bottleVolume) lifetimeVolumeIntegral = scipy.integrate.quad(lambda x: liquidLifetime(profile(x)[0], YoshikiParameter), 0., channelLength)[0]*A + liquidLifetime(profile(channelLength)[0], YoshikiParameter)*bottleVolume meanLifetime = lifetimeVolumeIntegral/(channelLength*A + bottleVolume) print('Mean: {0:.3f} K, {1:.1f} s'.format(meanTemperature, meanLifetime)) with open('{0:.3f}K_{1:.2f}W_{2}_{3:.3f}.csv'.format(T_low, heatLoad, conductivityModel, YoshikiParameter), 'w', newline = '') as csvfile: csvWriter = csv.writer(csvfile) csvWriter.writerow(['Position (m)', 'Mean temperature (K)']) x = 0. fermiPotentials = [] while x < channelLength: meanDensity = scipy.integrate.quad(lambda y: hepak.HeCalc('D', 0, 'T', profile(y)[0], 'P', pressure, 1), x, x + segmentLength)[0]/segmentLength meanTemperature = scipy.integrate.quad(lambda y: profile(y)[0], x, x + segmentLength)[0]/segmentLength meanLifetime = scipy.integrate.quad(lambda y: liquidLifetime(profile(y)[0], YoshikiParameter), x, x + segmentLength)[0]/segmentLength fermiPotentials.append( (realFermiPotential(meanDensity), imaginaryFermiPotential(meanLifetime)) ) print('{0:.2f}m: {1:.3f}K, {2:.1f}s'.format(x + segmentLength/2.,meanTemperature, meanLifetime)) csvWriter.writerow([x + segmentLength/2., meanTemperature]) x = x + segmentLength return profile, fermiPotentials
def dydx(x, y): H = y[0] P = max(100., y[1]) density = hepak.HeCalc('D', 0, 'P', P, 'H', H, 1) dHdx = heatLoad / massFlow + pressureDrop / density dPdx = -pressureDrop if x < verticalDrop: dHdx = dHdx + 9.81 dPdx = dPdx + density * 9.81 return [dHdx, dPdx]
def OneKPotEvaporation(He3Flow, He3Pressure, He3InletTemperature, IPFlow, IPPressure, IPInletTemperature, HeInletPressure, HeInletTemperature, staticLoad, OneKPotTemperature): He3HeatLoad = He3CoolingLoad(He3Flow, He3Pressure, He3InletTemperature, OneKPotTemperature) IPHeatLoad = HeCoolingLoad(IPFlow, IPPressure, IPInletTemperature, OneKPotTemperature) HeInletEnthalpy = hepak.HeCalc('H', 0, 'T', HeInletTemperature, 'P', HeInletPressure, 1) HeVaporEnthalpy = hepak.HeCalc('H', 0, 'T', OneKPotTemperature, 'SV', 0., 1) HeLiquidEnthalpy = hepak.HeCalc('H', 0, 'T', OneKPotTemperature, 'SL', 0., 1) liquidFraction = (HeInletEnthalpy - HeVaporEnthalpy) / (HeLiquidEnthalpy - HeVaporEnthalpy) return (He3HeatLoad + IPHeatLoad + staticLoad) / hepak.HeCalc( 7, 0, 'T', OneKPotTemperature, 'SL', 0., 1 ) / liquidFraction # He mass flow = heat load / latent heat(T) / (1 - vapor mass fraction(H,T))
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
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
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
def OneKPotTemperature(HeFlow, pumpingPressureDrop): HeFlow = max(0., min(HeFlow, 0.1)) # inletPressure = scipy.optimize.root_scalar(lambda P: hepak.HeCalc(5, 0, 'P', P, 'T', pumpInletTemperature, 0)*gasFlow*hepak.HeConst(4)*inletTemperature/(pumpingSpeed/3600) - P, bracket = (1., 1e5)) # He pressure = Z(P, T)*dm/dt*R_s*T/(dV/dt) # if not inletPressure.converged: # print('Could not determine pump inlet pressure') # pumpInletPressure = HeFlow*hepak.HeConst(4)*pumpInletTemperature/(pumpingSpeed/3600) # P = dm/dt R_s T / (dV/dt) pumpInletPressure = scipy.optimize.root_scalar( lambda P: pumpData(P) / 0.75 - HeFlow, bracket=(15., 12000.) ) # find inlet pressure for given flow in pump data for He3 (divide by 0.75 to scale to He4) if not pumpInletPressure.converged: print("Could not calculate He4 pump inlet pressure!") T = hepak.HeCalc('T', 0, 'P', pumpInletPressure.root + pumpingPressureDrop, 'SL', 0., 1) # T_sat(P + dP) return T
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
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)
def HeCoolingFlow(heatLoad, pressure, inletTemperature, outletTemperature): return heatLoad / ( hepak.HeCalc('H', 0, 'P', pressure, 'T', outletTemperature, 1) - hepak.HeCalc('H', 0, 'P', pressure, 'T', inletTemperature, 1))
'HEX1 surface': 1.67, 'HeII overfill': 0.05, 'He reservoir pressure': 1.2e5, 'Isopure He flow': 0., #'Isopure He flow': 0.00014/3, # isopure condensation 'Isopure He pressure': 100e2, '20K shield temperature': 20., '100K shield temperature': 100., } result = UCNsource.calcUCNSource(parameters) print('3He flow: {0:.4g} g/s'.format(result['3He flow']*1000)) print('He reservoir evaporation: {0:.4g} g/s'.format(result['He reservoir flow']*1000)) print('1K pot: {0:.4} K, {1:.4g} g/s'.format(result['1K pot temperature'], result['1K pot flow']*1000)) print('He consumption: {0:.3g} L/h'.format((max(result['He reservoir flow'], result['20K shield flow'], result['100K shield flow']) + result['1K pot flow'])/hepak.HeCalc('D', 0, 'P', 1013e2, 'SL', 0., 1)*1000*3600)) print('Required shield flows: {0:.3g} g/s, {1:.3g} g/s'.format(result['20K shield flow']*1000, result['100K shield flow']*1000)) print('He-II pressure: {0:.4g} + {1:.4g} Pa'.format(result['HeII vapor pressure'], result['HeII pressure head'])) print('T: {0:.4g} -> {1:.4g} -> {2:.4g} -> {3:.4g} -> {4[0]:.4g} to {4[1]:.4g} K'.format(result['T_3He'], result['T_HEX1_low'], result['T_HEX1_high'], result['T_HeII_low'], result['T_HeII_high'])) it = 0 for T_low, heatLoad, GorterMellink, yoshikiParameter in zip([1.023, 0.9, 1.1, 0.8, 1.0, 1.023, 1.023, 1.023],\ [9.6, 9.6, 9.6, 0.2, 0.2, 9.6, 9.6, 9.6],\ ['VanSciver', 'VanSciver', 'VanSciver', 'VanSciver', 'VanSciver', 'HEPAK', 'VanSciver', 'VanSciver'],\ [0.016, 0.016, 0.016, 0.016, 0.016, 0.016, 0.008, 0.024]): vaporPressure = hepak.HeCalc('P', 0, 'T', T_low, 'SV', 0, 1) liquidPressure = vaporPressure + hepak.HeCalc('D', 0, 'T', T_low, 'SL', 0., 1)*9.81*parameters['HeII overfill'] profile, liquidPotentials = printSegmentedTemperature(T_low, liquidPressure, heatLoad, parameters['Channel diameter'], parameters['Channel length'], GorterMellink, segmentLength, yoshikiParameter) fig, ax = plt.subplots() xdata = numpy.linspace(0., parameters['Channel length'], int(parameters['Channel length']/segmentLength), endpoint = True)
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')
y7 = [] y72 = [] y8 = [] y9 = [] y9_2 = [] for j in range(datapoints): value = parameters[p]['range'][0] + float(j) / (datapoints - 1) * ( parameters[p]['range'][1] - parameters[p]['range'][0]) tempParameters[p] = value res = UCNsource.calcUCNSource(tempParameters) if res: print('{0:.3g} {1}: {2:.1f} L/h'.format( value, parameters[p]['unit'], (max(res['He reservoir flow'], res['20K shield flow'], res['100K shield flow']) + res['1K pot flow']) / hepak.HeCalc('D', 0, 'P', 1013e2, 'SL', 0., 1) * 1000 * 3600)) x.append(value) y.append(res['He reservoir flow'] * 1000) y2.append(res['T_HeII_high'][0]) y2_2.append(res['T_HeII_high'][1]) y3.append(res['T_3He']) y4.append(res['T_HeII_low']) y5.append(res['3He flow'] * 1000) y6.append(res['1K pot flow'] * 1000) y7.append(res['20K shield flow'] * 1000) y72.append(res['100K shield flow'] * 1000) y8.append(res['1K pot temperature']) y9.append(res['T_HEX1_low']) y9_2.append(res['T_HEX1_high']) ax = axes[i % plotRows][int(i / plotRows)] axes[0][0].get_shared_y_axes().join(axes[0][0], ax)
def dydx(x, y): H = y[0] P = max(100., y[1]) density = hepak.HeCalc('D', 0, 'P', P, 'H', H, 1) dHdx = heatLoad / massFlow + pressureDrop / density dPdx = -pressureDrop if x < verticalDrop: dHdx = dHdx + 9.81 dPdx = dPdx + density * 9.81 return [dHdx, dPdx] result = scipy.integrate.solve_ivp(dydx, (0, length), [ hepak.HeCalc('H', 0, 'P', inletPressure, 'SL', 0, 1), inletPressure - valvePressureDrop ], max_step=1.) exitEnthalpy = result.y[0][-1] exitPressure = result.y[1][-1] exitDensity = hepak.HeCalc('D', 0, 'P', exitPressure, 'H', exitEnthalpy, 1) exitLiquidDensity = hepak.HeCalc('D', 0, 'P', exitPressure, 'SL', 0, 1) exitVaporDensity = hepak.HeCalc('D', 0, 'P', exitPressure, 'SV', 0, 1) exitVaporMassFraction = hepak.HeCalc('X', 0, 'H', exitEnthalpy, 'P', exitPressure, 1) exitVaporVolumeFraction = exitVaporMassFraction / exitVaporDensity * exitDensity fullLiquidVelocity = massFlow / exitLiquidDensity / crossSection
def HeCoolingLoad(flow, pressure, inletTemperature, outletTemperature): outletTemperature = max(hepak.HeConst(3), outletTemperature) return flow * ( hepak.HeCalc('H', 0, 'P', pressure, 'T', inletTemperature, 1) - hepak.HeCalc('H', 0, 'P', pressure, 'T', outletTemperature, 1))
def calcUCNSource(parameters): sol = scipy.optimize.root(equationSet, x0=[0.0008, 1.8, 1.], args=parameters, method='hybr') if not sol.success: print('Solution did not converge!') return result = {} result['3He flow'] = sol.x[0] result['1K pot temperature'] = sol.x[1] result['T_HeII_low'] = sol.x[2] result['He reservoir temperature'] = hepak.HeCalc( 'T', 0, 'P', parameters['He reservoir pressure'], 'SV', 0., 1) result['1K pot flow'] = OneKPotEvaporation(result['3He flow'], parameters['3He inlet pressure'], parameters['HEX4 exit temperature'], \ parameters['Isopure He flow'], parameters['Isopure He pressure'], result['He reservoir temperature'], \ parameters['He reservoir pressure'], parameters['HEX5 exit temperature'], parameters['1K pot static load'], result['1K pot temperature']) result['He reservoir flow'] = HeReservoirEvaporation(result['3He flow'], parameters['3He inlet pressure'], parameters['He reservoir inlet temperature'], \ parameters['Isopure He flow'], parameters['Isopure He pressure'], parameters['20K shield temperature'], \ parameters['He reservoir static load'], parameters['He reservoir pressure']) result['He consumption'] = ( result['He reservoir flow'] + result['1K pot flow']) / hepak.HeCalc( 'D', 0, 'P', 1013e2, 'SL', 0., 1) * 1000 * 3600 result['20K shield flow'], result['100K shield flow'] = shieldFlow(parameters['20K shield temperature'], parameters['100K shield temperature'], result['He reservoir temperature'] + 0.1, \ parameters['20K shield temperature'], parameters['Isopure He flow'], parameters['Isopure He pressure']) result['Shield consumption'] = max( result['20K shield flow'], result['100K shield flow']) / hepak.HeCalc( 'D', 0, 'P', 1013e2, 'SL', 0., 1) * 1000 * 3600 result['T_3He'] = He3Temperature(result['3He flow'], parameters['3He pressure drop']) heatLoad = parameters['Beam heating'] + parameters[ 'Isopure static heat'] + HeCoolingLoad( parameters['Isopure He flow'], parameters['Isopure He pressure'], result['1K pot temperature'], result['T_HeII_low']) result['T_HEX1_low'] = HEX1TemperatureLow(result['T_3He'], parameters['HEX1 length'], parameters['Channel diameter'], parameters['HEX1 surface'], heatLoad) result['T_HEX1_high'] = HEX1TemperatureHigh(result['T_HEX1_low'], parameters['HEX1 length'], heatLoad) result['HeII vapor pressure'] = 0. result['HeII pressure head'] = 0. result['T_HeII_high'] = result['T_HeII_low'], result['T_HeII_low'] if parameters['Beam heating'] > 0. and result[ 'T_HeII_low'] > hepak.HeConst(3): result['HeII vapor pressure'] = hepak.HeCalc('P', 0, 'T', result['T_HeII_low'], 'SL', 0., 1) result['HeII pressure head'] = hepak.HeCalc( 'D', 0, 'T', result['T_HeII_low'], 'SL', 0., 1) * 9.81 * parameters['HeII overfill'] result['T_HeII_high'] = HeIItemperatureHigh( parameters['Channel length'], result['T_HeII_low'], result['HeII vapor pressure'] + result['HeII pressure head'], parameters['Beam heating'], parameters['Channel diameter']) return result