<<

FREIA Report 2020/01 July 9, 2020

Department of and Astronomy Uppsala University

Benchmarking a Cryogenic Code for the FREIA Helium Liquefier

Elias Waagaard Supervisor: Volker Ziemann Subject reader: Roger Ruber

Bachelor Thesis, 15 credits

Uppsala University Uppsala, Sweden

Department of Physics and Astronomy Uppsala University Box 516 SE-75120 Uppsala Sweden Papers in the FREIA Report Series are published on internet in PDF format. Download from http://uu.diva-portal.org Abstract The inside the helium liquifier in the FREIA still contains many unknowns. The purpose of this project is to develop a theoretical model and im- plement it in MATLAB, with the help of the CoolProp library. This theoretical model of the FREIA liquefaction cycle aims at finding the unknown parameters not specified in the manual of the manufacturer, starting from the principle of conservation. Inspiration was taken from the classical liquefaction cycles of Linde-Hampson, Claude and Collins. We developed a linear mathematical model for cycle components such as turboexpanders and exchangers, and a non-linear model for the liquefaction in the phase separator. Liquefaction yields of 10% and 6% were obtained in our model simula- tions, with and without pre-cooling respectively - similar to those in the FREIA liquefier within one percentage point. The sensors placed in FREIA showed simi- lar and values, even though not every point could be verified due to the lack of sensors. We observed an increase of more than 50% in yield after adjustments of the heat exchanger design in the model, especially the first one. This constitutes a guideline for possible future improvements of the liquefier.

Sammanfattning Termodynamiken bakom heliumf¨orv¨atskaren i FREIA-laboratoriet inneh˚allerfortfarande m˚angaok¨anda aspekter. Detta kandidatarbete syftar till att utveckla en teoretisk modell och implementera den i MATLAB med hj¨alp av biblioteket CoolProp. Denna modell av FREIA:s f¨orv¨atskningscykel syftar till att hitta de ok¨anda parametrar som inte specifi- cerats av tillverkaren, och baserar sig p˚aprincipen om entalpins bevarande. Inspiration togs fr˚ande klassiska f¨orv¨atskningscyklerna Linde-Hampson, Claude och Collins. Vi ut- vecklade en linj¨ar matematisk modell f¨or cykelkomponenter s˚asomexpansionsturbiner och v¨armev¨axlare, och en icke-linj¨ar modell f¨or sj¨alva f¨orv¨atskningen i fasseparatorn. En f¨orv¨atskningsverkningsgrad p˚a10% och 6% uppn˚addesi v˚aramodellsimuleringar, med respektive utan f¨orkylning med flytande kv¨ave - liknande verkningsgraderna i FREIA- f¨orv¨atskaren inom en procentenhet. Sensorerna placerade i FREIA visade p˚aliknande tryck och temperaturer, ¨aven om bristen p˚asensorer gjorde att vi inte kunde bekr¨afta varje punkt. Vi observerade en ¨okning p˚amer ¨an 50% i verkningsgrad efter att ha juste- rat v¨armev¨axlardesignen n˚agot,speciellt f¨or den f¨orsta. Detta kan utg¨ora riktlinjer f¨or var man fram¨over kan f¨orb¨attra den faktiska f¨orv¨atskaren. Contents

1 Introduction 1

2 Fundamental Thermodynamics 2

3 Cycle Components 6 3.1 Compressor ...... 6 3.2 Heat Exchanger ...... 6 3.2.1 Counterflow Two-fluid Heat Exchanger ...... 7 3.2.2 Counterflow Three-fluid Heat Exchanger ...... 11 3.3 Turboexpander ...... 15 3.4 Joule-Thomson Valve ...... 17

4 Classical Liquefaction Cycles 18 4.1 Linde-Hampson Cycle ...... 18 4.2 Claude Cycle ...... 20 4.3 Collins Cycle ...... 23

5 The FREIA Helium Liquefier 25 5.1 Simulations and Results of the FREIA Model ...... 28

6 Discussion 33

7 Future Prospects 35

8 Conclusion 35

9 Popular Science Summary 36

10 Acknowledgements 37

References 38

11 Appendices 39 11.1 FREIA LN2 Enthalpy Model Function ...... 39 11.2 FREIA LN2 Enthalpy Model Tester Script ...... 44 1 Introduction

Cryogenics, the study of material behaviour at low , has a long tradition in Upp- sala. An important step to better understand the concept of temperature was taken there in 1742, when Anders Celsius launched his centigrade scale. This scale was based on phase transitions: the freezing and boiling point of water at a particular atmospheric pres- sure. This standardized temperature measurement around the world until this day, although he initially proposed that water should boil at 0◦C and freeze at 100◦C. This scale was reversed after his death and then accepted worldwide [1]. Today, the FREIA Laboratory at the Uppsala University carries out experiments for accelerator physics and instrumentation at low temper- atures with liquid nitrogen and as coolants. However, lighter gases such as these are not trivial to liquefy. Carl von Linde and William Hampson independently succeeded with the liquefaction of air in 1895 using the cycle that was later named after them [2]. It would take until 1908 for helium to be liquefied for the first time, achieved by Heike Kamerlingh Onnes with a pre-cooled Linde-Hampson cycle [3]. Nowadays, play a fundamental role to supply coolants to a range of scientific experi- ments, medical applications and industrial machinery. For instance, liquid helium is often used for the cooling of superconducting magnets in Functional Magnetic Resonance Imaging (fMRI) machines [4]. The need for low-temperature equipment in industry is also growing rapidly. The market size is estimated to grow from USD 80 Billion in 2015 to reach more than USD 100 Billion by 2020, dominated by large international corporations such as the Linde Group and Air Liquide [5]. Only the system of superconducting magnets at the Large Hadron Collider at CERN use a total of 120 metric tonnes of helium to be cooled down to the working temperature of 1.8 K [6]. Due to the abundant applications and few deposits on Earth, the supply of liquid helium is limited and causes very fluctuating market prices. As pointed out by Sophia Hayes in Physics Today, the market price of liquid helium was USD 5 per litre in 2010, but this had almost quadrupled by 2016 [7]. This volatility of the global helium supply stresses even further the need for robustly designed and leakproof helium liquefaction systems. Moreover, simulations help to optimize and guide towards improving the efficiency where the information provided by the manufacturer is not sufficient. In the FREIA Laboratory, the helium liquefier Linde L140 built by the Linde Group delivers over 140 l/h of liquid helium into a 2000 l storage dewar, and includes liquid nitrogen pre-cooling and a helium recovery system [8]. However, the process of helium liquefaction still contains many unknown parameters at several points in the cycle, where sensors are missing. These unknowns include gas flows, temperatures and . The purpose of this project is to construct a theoretical model of the liquefier, starting from drawings of the vendor. This theoretical model is based on balancing the flow of through the system at thermodynamic equilibrium, and is implemented in a model simulation in MATLAB. The system parameters from the FREIA control system, such as temperatures and pressures, are compared with output parameter values of the simulation. For higher temperatures and lower pressures, helium behaves like an for which calcu- lations are relatively simple. However, in many instances, we need to consider the behaviour of real gases, whose thermodynamic relations are far more complex. For this project, we use the open-source library CoolProp that contains tables for many thermodynamic quantities, in- cluding real gases to a very good approximation [9]. Thus, our model is applicable also for real systems.

1 In this report, we first describe some essential terminology in thermodynamics in Section 2, followed by mathematical models for the individual cycle components in Section 3. These com- ponents will then be put together in liquefaction cycle models that are simulated in MATLAB. We will gradually increase the complexity of the models, starting from the historically impor- tant liquefaction cycles of Linde-Hampson, Claude and Collins in Section 4, to finally simulate the FREIA liquefaction cycle in Section 5. The MATLAB code to simulate the FREIA lique- faction cycle can be found in Appendices 11.1 and 11.2. A popular science summary can be found in Section 9.

2 Fundamental Thermodynamics

To start with, several recurrent thermodynamic concepts need to be defined. We will often come back to the first law of thermodynamics, which states the conservation of the internal U, or the energy associated to the random motion of molecules in a system. According to the first law, an infinitesimal change dU in the is

dU = δQ + dW, (1) where δQ is the infinitesimal heat of the process and dW is the infinitesimal . In other words, the sum of all incoming in a system equals the outgoing energies or what is accumulated [2]. To describe a system, we use principal properties such as pressure P , V , molar quantity n, and temperature T . P and T do not depend directly on the size or the amount of material in the system, and are called intensive quantities. P is the force exerted per unit area of the system, and T is a quantitative expression of the heat in the system. For such a system, we express the infinitesimal work as dW = −P dV . In this report, we shall always give P in terms of absolute pressure, in unit [bar(a)]. Conversely, V and n are extensive quantities and depend on the size of the system, or how much is contained in it. The thermodynamic relation between these quantities is called an . In classical thermodynamics, the equation of state for an ideal gas is

PV = nRT, (2) where n is the amount of substance of the gas (in moles) and R = 8.314 [J/(mol K)] is the ideal gas constant. An ideal gas is a theoretical gas for which Equation (2) holds for all pressures P and temperatures T [10]. Gases such as helium, nitrogen, but also some heavier gases such as CO2 behave like ideal gases to the first order, and approach a perfect ideal gas at higher T and lower P [11]. Per unit of gas, if two of the quantities P,V,T are known, the third can easily be found from the equation of state. This principle will be used throughout the report. We shall see that especially T leads to many other important concepts. According to Joule’s law, the internal energy U of an ideal gas is only a function of its temperature T and not of its pressure P : U = U(T ). From a different perspective, T can also be seen as a measurement of the kinetic energy of gas molecules in the system. For an ideal gas, this random motion of gas molecules constitutes the pressure P of the system. In his kinetic gas theory, Maxwell derived that the average kinetic energy EK per particle for a monatomic ideal gas is

2 1 3 E = mv2 = k T, (3) K 2 rms 2 B

p 2 where vrms = hv i is the root mean square velocity of the gas particles and m its individual 3 mass [10]. Consequently, EK,T ot ≡ U = 2 NkBT if summing up the energies of all the N particles. For ideal gases, we can also easily relate heat and temperature. We define the CV of a gas at constant volume (isochoric) as the heat differential dQ needed to increase the system temperature with dT

∂Q CV = , (4) ∂T V where the unit is [J/K]. From Equation (1), (3) and the fact that W = −P dV = 0 for isochoric processes, we have in particular for ideal monatomic gases

∂ ∂ 3  3 3 C = (U − W ) = Nk T = Nk = nR. (5) V ∂T V ∂T 2 B 2 B 2

The specific heat capacity cV [J/(mol K)] is then

C 3 c ≡ V = R (6) V n 2 for an ideal monatomic gas. If we instead are interested in the specific heat capacity at constant pressure cP , we resort to Mayer’s relation [10]

cP − cV = R, (7)

5 which results in cP = 2 R [J/(mol K)]. These values of the specific heat capacities shall be frequently used when we have gases that behave like ideal gases, such as helium at higher T . In the thermodynamic cycles that are to come, cP is more frequently used as gas may change volume when liquefied, but the pressure stays the same. Specific heat capacities cP of helium at various pressures, including those that will later be observed in the FREIA liquefier, are presented in Figure (1). Let us elaborate further on the concept of heat. If we have a totally , we can express the internal energy and the pressure-volume PV term in terms of the so-called enthalpy H, defined as

H = U + PV. (8)

PV represents the work that the system needs to perform to expand into the volume V . Just like for the internal energy U, H = H(T ) for an ideal gas. We define the specific enthalpy h as h = H/m, where m is the mass of the system. Enthalpy is an extensive quantity, but h is an intensive quantity. In the case of closed thermodynamic cycles, we assume instantaneously isolated systems where the conservation of H is used. As H contains both the internal energy and the pressure-volume term, enthalpy provides an indispensable tool for phase transitions. The L [J], the energy absorbed or emitted during a first-order phase transition, is simply the difference between enthalpies. For instance, the latent heat of vaporization is

3 Figure 1: Specific heat capacities at constant pressure cP of helium, generated with CoolProp. 5 cP = 2 R is also marked out as a black horizontal line.

L = Hvap − Hliq, (9) where Hvap is the enthalpy of the vapour and Hliq is the enthalpy of the liquid. We obtain the specific latent heat l by simply dividing both sides in Equation (9) by the concerned mass m. Another essential concept is the S, also an extensive quantity. The formal definition of an infinitesimal entropy increment dS of a process on a (i.e. where heat but not matter can enter) is

δQ dS ≥ , (10) T where δQ is the infinitesimal heat transfer of the process. Equation (10) becomes an equality if the process is reversible and ideal, but an inequality if the process is real. However, in this context, we will mostly find S from the equation of state: S = S(P,V,T ). The second law of thermodynamics follows suit, stating that entropy is conserved in ideal processes, but increases in real processes [10]. One of the consequences of the second law is that heat cannot flow from a colder body to a hotter body by itself, which will be of great importance for this project. For instance, one of the most famous thermodynamic cycles, the Carnot heat cycle, is an indirect consequence of the second law of thermodynamics. The Carnot heat cycle is a theoretical cycle that sets the upper efficiency for any cycle involving heat-work transfer. To effectively illustrate processes in thermodynamic cycles, temperature-entropy (TS) diagrams are often employed. The Carnot heat cycle is illustrated in Figure (2) to the left. The combination of expansions and compressions that are either isothermal and isentropic give the characteristic rectangular shape. To the right in Figure (2), we have a typical liquefaction cycle (the Claude cycle) plotted. At step 1, gas is compressed isothermally, followed by isobaric cooling of the gas along step 2. The non-rectangular shape indicates that the coefficient of performance is lower than the ideal .

4 For this study, we are particularly interested in the thermodynamics regarding liquefaction. We need to consider that there are situations in which vapour and liquid phases can coexist. The critical point with temperature TC and pressure PC is the point in a TS diagram from which coexistence of phases is possible. Below this point, the so-called saturation dome starts, a bell-shaped region in the TS diagram where vapour and liquid phases co-exist. The percentage of vapour and liquid respectively is determined by the vapour quality, where a fully saturated vapour has a vapour quality of 100% and fully saturated liquid has a vapour quality of 0%. As we shall see later in this study, these phenomena are crucial for liquefaction. An illustration of the saturation dome can be seen in Figure (2) to the right. The dashed red line to the right of the critical point is called the saturated vapour line (100% vapour quality), and the red dashed line to the left of the critical point is the saturated liquid line (0% vapour quality). The zone where phase coexistence occurs is underneath the critical point inside the bell-shaped curve, between these saturation lines. Step 3 describes the isenthalpic process that leads to liquefaction, if temperatures are low enough. What is liquefied of the gas then goes towards the left of the saturation dome (as saturated liquid), and what remains gaseous progresses to the right as saturated vapour. This gas is then reheated along step 4 isobarically, before it reaches the initial point of the cycle. If the temperature is too high at the start of step 3, one can include isentropic expansion as a part of a multi-stage cooling process of the gas to achieve liquefaction. This process is illustrated in step 5 in Figure (2), and will be further explained along with the Claude cycle in Section 4.2. One of the objectives of the project is to extract such a TS diagram for the FREIA cycle.

Figure 2: Sketch of Carnot cycle displayed in a TS diagram to the left, and a typical Claude liquefaction cycle displayed to the right. The liquefaction cycle is represented in the blue solid line, and the saturation dome in dashed red.

Both H and S are essential quantities for the components used in the context of this study. Rather than the actual enthalpy or entropy, one is often interested in their difference, ∆H or ∆S, of a process. H and S are dependent on the quantities P,V,T , and can be found if two of these are known. However, the equation of state does not always take a form as simple as the in Equation (2). In most cases for real gases, the relation between the quantities P,V,T is very complex and far from linear. In order to facilitate calculations when real gases cannot be approximated as ideal, we resort to CoolProp.

5 3 Cycle Components

The various thermodynamic components that build up a cycle are described in the following section, including code snippets in MATLAB with examples of how they practically can be implemented. Some involve more theoretically complex physical phenomena, whereas others are simpler.

3.1 Compressor

A compressor (CMP) is a device that increases the pressure P of a gas by reducing its volume V , by compression [2]. In the thermodynamic cycles that will be presented, the compressor is often the first step. Ideally, this process is isothermal, such that the gas keeps its original temperature while P is increased. This is achieved by connecting the compressor system to a heat bath with large heat capacity. In this study, we often use the high-pressure outlet of the compressor as the start of the cycle.

3.2 Heat Exchanger

Heat exchangers are devices that transfer enthalpy between two or more flows of fluids or gases, without transferring the gas or fluid itself. These hot and cold flows can be parallel, anti-parallel, or arranged in a more intricate way. In cryogenics, counterflow heat exchangers are often preferred to parallel flows as larger temperature drops can be achieved. This is due to the fact that the outlet temperature T4 of the cold fluid can be much higher than the outlet temperature T2 of the hot fluid in a counterflow system, which is not possible in a parallel flow [2]. In Figure (3), a simple one-dimensional counterflow heat exchanger is presented.

Figure 3: Illustration of a simple counterflow heat exchanger. The hot flow from 1 to 2 is marked in red, and the cold flow from 3 to 4 is marked in blue.

The principle of enthalpy transfer is always the same regardless of the type. If enthalpies at the inlet points H1, H3 and the enthalpy transfer differential dH are known, we simply add to the cold flow and subtract from the hot flow to solve for H2 and H4, as presented in the code snippet below. However, we are often interested in the total enthalpy transferred per second across the whole heat exchanger, which we denote ∆H˙ .

1 H2= H1- dH; 2 H4= H3+ dH;

6 3.2.1 Counterflow Two-fluid Heat Exchanger

If only the inlet temperatures T1 and T3 for a heat exchanger are known, how do we calculate the ˙ final temperatures T2 and T4, and the total enthalpy ∆H transferred? We start with a simple one-dimensional counterflow heat exchanger (CX) with two flows, assuming an incoming hot flow with total heat capacity per second Ca =m ˙aca and a return flow with total heat capacity per second Cb =m ˙ bcb, where ci are the specific heat capacities at constant pressure of the fluid andm ˙ i are the mass flows (i = a, b). We have temperatures T1, T2, T3 and T4 as seen in Figure (4). Let us also assume that the length of the heat exchanger is L, and that C0 is the heat exchanger design parameter. C0 constitutes the heat transfer coefficient times the contact area, often also denoted UA, indicating how easily heat is transferred between the hot and the respective cold streams. In addition, we do not know the exact nature of the flow inside the heat exchanger. The so-called Reynolds number is a parameter that characterizes the flow patterns in fluids. This behaviour affects how much the fluid comes in contact with the inner walls, and consequently how much enthalpy the fluid absorbs or emits. At low Reynolds numbers, the flow is laminar (sheet-like), whereas high Reynolds numbers indicate a turbulent flow [2]. Turbulent flows increase chances that all the fluid will come in contact with the inner walls of the heat exchanger, meaning a higher transfer of enthalpy. In our case however, this effect is included in the parameter C0. We once again look into an idealized one-dimensional case, but it can easily be applied to three dimensions if UA is used instead of C0.

Figure 4: Illustration of simple one-dimensional counterflow heat exchanger with incoming flow a and return flow b, with inlet temperatures T1 and T3, outlet temperatures T2 and T4, and heat capacities per second Ca and Cb.

For the flow in a short segment of length dx, we set up the system of equations for the differential heat transfer rate

˙ dHa = −CadTa (from hot fluid) (11) ˙ dHb = −CbdTb (to cold fluid) (12) ˙ 0 dH = C (Ta − Tb)dx (between fluids), (13)

˙ ˙ ˙ where dHa, dHb and dH are the instantaneous enthalpy transfers from the incoming flow, the return flow and across the heat exchanger respectively. The minus sign in Equation (11) is due to heat emitted by the hot flow in the incoming flow. In Equation (12), the heat of the hot flow

7 is absorbed in the cold flow, which gives a plus sign. However, a minus sign arises as we move in the direction of −dx, as can be seen in Figure (4). The heat emitted from one side corresponds ˙ ˙ ˙ to the absorbed heat on the other side as energy is conserved, so we have dHa = dH = dHb. Hence, we can manipulate Equation (11), (12) and (13) and obtain

0 0 dTa C dTb C = − (Ta − Tb) and = − (Ta − Tb), (14) dx Ca dx Cb or expressed in matrix form

" # " 0 0 #" # T − C C T d a Ca Ca a = C0 C0 . (15) dx Tb − Tb Cb Cb

The eigenvalues α to the matrix in Equation (15) are obtained from solving the characteristic equation

 C0  C0  C02 α + α − + = 0. (16) Ca Cb CaCb

0 1 1  The solutions to Equation (16) are α1 = 0 and α2 = −C − , with respective eigenvectors Ca Cb  C0  1  Ca ~v1 = 1 and ~v2 = C0 . As Equation (15) is a linear system of first-order homogeneous Cb differential equations, we know that its solution can be expressed as

" # " C0 C0 −αx#" # Ta − C C e A1 = A ~v eα1x + A ~v eα2x = a a , (17) 1 1 2 2 C0 C0 −αx Tb − e A2 Cb Cb

0 1 1  where A1 and A2 are integration constants and α = C − . These are fixed by imposing Ca Cb the boundary conditions Ta(x = 0) = T1 and Tb(x = L) = T3, which means

" # " C0 C0 #" # T1 − A1 = Ca Ca C0 C0 −αL T3 − C C e A2 b b (18) " # " C0 C0 #−1 " # A1 − T1 ⇒ = Ca Ca . C0 C0 −αL A2 − e T3 Cb Cb

Solving for A1 and A2, we find the integration constants to be

C0 −αL C0 e T1 − T3 T − T A = Cb Ca and A = 3 1 . (19) 1 C0 e−αL − C0 2 C0 e−αL − C0 Cb Ca Cb Ca

Inserting these in Equation (17) we obtain, after some simplification

8 1 − e−αL T2 = T1 − (T1 − T3) ≡ T1 − η(T1 − T3) 1 − Ca e−αL Cb −αL (20) Ca 1 − e Ca T4 = T3 + (T1 − T3) ≡ T3 + η(T1 − T3) Ca −αL Cb 1 − e Cb Cb where η = 1−e−αL is defined as the efficiency of a counterflow heat exchanger. Therefore, 1− Ca e−αL Cb we see that the heat exchanger temperatures constitute a system of linear equations that can easily be solved. If, on the other hand, we are interested in the total enthalpy transfer across a counterflow heat exchanger as a function of the inlet temperatures T1 and T3 as in Figure (4), we resort once again to Equation (13) and our solutions from Equation (17)

˙ 0 0 −αx dH = C (Ta(x) − Tb(x))dx = C αA2e dx. (21)

Integrating over the whole heat exchanger gives

Z L C C (1 − e−αL) ˙ 0 −αx a b (22) ∆H = C A2 αe dx = −αL (T3 − T1) ≡ CH (T3 − T1) 0 Cae − Cb

−α CaCb(1−e ) if Ca 6= Cb. This constant CH = −α is called the heat conduction constant of a heat Cae −Cb exchanger.

However, if Ca = Cb, the reasoning thus far breaks down as the matrix in Equation (15) is singular with degenerate eigenvalues, so it is not invertible. For this case, we manipulate Equation (11), (12) and (13) yet again but in a slightly different order

    ˙ 1 1 0 1 1 dTa − dTb = d(Ta − Tb) = −dH − = −C (Ta − Tb) − dx = 0 (23) Ca Cb Ca Cb which implies that

d(T − T ) a b = 0, ⇒ T − T = D (24) dx a b where D is an integration constant. Now we once again employ Equation (11) and (12), meaning

0 − dTaCa = C (Ta − Tb)dx 0 0 dTa C C = (Ta − Tb) = − D dx Ca Ca (25) C0 ⇒Ta = E − Dx, Ca where E is another integration constant. From Equation (24), we have that

9 Tb = Ta − D C0  C0  (26) ⇒ Tb = E − D − Dx = E − D 1 + x . Ca Ca

With the boundary conditions Ta(x = 0) = T1 and Tb(x = L) = T3, we immediately observe that E = T1 and consequently deduce that

 0  C T1 − T3 T3 = T1 − D 1 + L so D = C0 . (27) Ca 1 + L Ca

This finally leads to

0 C (T − T )  0  Ca 1 3 C (T1 − T3) Ta(x) = T1 + C0 x, Tb(x) = T1 + 1 + C0 x. (28) 1 + L Ca 1 + L Ca Ca

If we now solve for the total enthalpy flow

˙ 0 0 dH = C (Ta(x) − Tb(x))dx = C Ddx Z L T − T ∆H˙ = C0Ddx = C0L 1 3 ≡ C (T − T ) 1 + C0 L H 1 3 (29) 0 Ca 1 1 1 ⇒ = + 0 CH Ca C L

if Ca = Cb. No matter if the heat capacities are equal or not, the total transferred enthalpy per second ∆H˙ over the heat exchanger can be found.

The code snippet below shows how CH can be calculated in the various cases, to finally find ˙ 0 ∆H if Ca,Cb,C and L are known. The if-statement in line 6 makes sure to avoid numerical singularities if the exponent is too small.

1 %Counterflow two-fluidCX heat conduction constant 2 if abs(Ca-Cb)< 1e-8 3 Ch = 1/(1/Ca+1/(Cprime*L)); 4 else 5 tmp=Cprime*L*(1/Ca-1/Cb); 6 if tmp <30 7 eaL=exp(-Cprime*L*(1/Ca-1/Cb)); 8 else 9 eaL=0; 10 end 11 Ch=(Ca*Cb*(1-eaL))/(Ca*eaL-Cb); 12 end 13 DeltaH= Ch*(T1- T3);

10 3.2.2 Counterflow Three-fluid Heat Exchanger

When three flows of fluid or gas are involved, the situation is more complex than for only two flows. In a general three-fluid counterflow heat exchanger, we assume a hot incoming flow with heat capacity per second Ch between two parallel cold return flows with respective heat 0 0 capacities per second C1 and C2, as can be seen in Figure (5). C1 and C2 represent the heat exchanger design parameters on the respective sides, or the respective heat transfer coefficient times the contact area. Also the input temperatures Th,i, Tc1,i and Tc2,i are known, and will constitute our boundary conditions.

Figure 5: Three-fluid heat exchanger with one hot flow with temperature Th in the centre, surrounded on each side by two parallel cold flows with temperatures Tc1 and Tc2, with direction opposite to the hot middle flow.

Just like in the case with a two-fluid counterflow heat exchanger, we set up the equations for the heat balance for a small segment dx

dT C c1 = −C0 (T − T ) (30) 1 dx 1 h c1 dT C h = −C0 (T − T ) − C0 (T − T ) (31) h dx 1 h c1 2 h c2 dT C c2 = −C0 (T − T ). (32) 2 dx 2 h c2

These equations correspond to the specific set-up where the hot flow is placed between two parallel cold flows opposite with respect to the hot flow, but these can easily be changed. We do not consider a coupling between the cold flows, as Equation (31) describes the heat flow from and to the intermediate hot flow and should take care of this aspect, as all heat has to pass through the hot flow. In addition, the temperature gradient is much smaller between the cold flows than between a hot and a cold flow, meaning that such an effect would have a very small impact. A general approach on heat balance equations is discussed by Sekulic et al., that also omits the cold-cold coupling [12]. We observe that this system of first-order linear homogeneous differential equations can be expressed as

11  C0 C0    1 − 1 0   Tc1 C1 C1 Tc1 d  0 0 0 0    C1 (C1+C2) C2   Th  =  −  Th  , (33) dx    Ch Ch Ch     C0 C0  Tc2 0 − 2 2 Tc2 C2 C2 which, just like in the two-fluid case, leads us to deduce the ansatz

  Tc1 X αix Th  = Ai~vie , (34) Tc2 i where αi represent the eigenvalues of the matrix M in Equation (33), ~vi the corresponding eigenvectors and Ai integration constants (i = 1, 2, 3). The characteristic equation |M −αI| = 0 gives

 C0 C0 (C0 + C0 ) C0 C0 (C0 + C0 )C0 C0   C02 C02  α −α2 − 1 + 2 + 1 2 α− 1 2 + 1 2 2 + 1 − 2 + 1 = 0, C1 C2 Ch C1C2 Ch C2 C1 C2Ch C1Ch (35) where I is the 3×3 identity matrix. We immediately see that α1 = 0 forms one solution. α2 and α3 are found by solving the second-order polynomial equation

C0 C0 (C0 + C0 ) C0 C0 (C0 + C0 )C0 C0   C02 C02  − α2 − 1 + 2 + 1 2 α − 1 2 + 1 2 2 + 1 − 2 + 1 = 0, C1 C2 Ch C1C2 Ch C2 C1 C2Ch C1Ch (36) that is a quadratic equation and can be solved easily, though the expressions become rather long. To each of these eigenvalues α1, α2 and α3, there is a correlated eigenvector ~v1, ~v2 and ~v3.  v11   1   v12  As α1 = 0, we conclude that ~v1 = v21 = 1 in order to fulfil (M − α1)~v1 = ~0. ~v2 = v22 v31 1 v32  v13  and ~v3 = v23 can easily be found with numerical methods, such as the eigenvalue and v33 eigenvector finder function in MATLAB. Consequently, the general solution to the temperature profile described by Equation (33) is

   α1x α2x α3x   Tc1 v11e v12e v13e A1 α1x α2x α3x α1x α2x α3x Th  = A1 ~v1e + A2 ~v2e + A3 ~v3e = v21e v22e v23e  A2 (37) α1x α2x α3x Tc2 v31e v32e v33e A3 where A1, A2 and A3 are integration constants determined the boundary conditions Tc1(x = L) = Tc1,i, Th(x = 0) = Th,i and Tc2(x = L) = Tc2,i. Imposing these boundary conditions we can write Equation (37) as

12    α1L α2L α3L   Tc1,i v11e v12e v13e A1 Th,i  =  v21 v22 v23  A2 α1L α2L α3L Tc2,i v31e v32e v33e A3 (38) −1    α1L α2L α3L   A1 v11e v12e v13e Tc1,i ⇒ A2 =  v21 v22 v23  Th,i  , α1L α2L α3L A3 v31e v32e v33e Tc2,i which lets us determine the integration constants. At the end of the day, just like in the case of a two-fluid counterflow heat exchanger, we find that the relation between the temperatures is described by a system of linear equations that can easily be solved, at least numerically. If we are interested in the actual enthalpy transfer between the flows, we recall Equation (30) and apply it on the hot stream and cold return stream 1

˙ 0 dH1 = C1(Th(x) − Tc1(x))dx. (39)

If we substitute the temperatures from Equation (37), we find that

  ˙ 0 α1x α2x α3x dH1 = C1 A1(v21 − v11)e + A2(v22 − v12)e + A3(v23 − v13)e dx. (40)

Integrating over the whole heat exchanger gives

Z L   ˙ 0 α1x α2x α3x ∆H1 = C1 A1(v21 − v11)e + A2(v22 − v12)e + A3(v23 − v13)e dx 0

 α1L α2L α3L  0 A1(v21 − v11)(e − 1) A2(v22 − v12)(e − 1) A3(v23 − v13)(e − 1) = C1 + + , α1 α2 α3 (41) which is the total enthalpy transfer between the hot stream and cold stream 1. Analogously ˙ 0 we know that dH2 = C2(Th(x) − Tc2(x))dx, so one obtains a similar expression for the total transfer between the hot stream and cold stream 2

 α1L α2L α3L  ˙ 0 A1(v21 − v31)(e − 1) A2(v22 − v32)(e − 1) A3(v23 − v33)(e − 1) ∆H2 = C2 + + . α1 α2 α3 (42)

For this type of system, one of the eigenvalues αi is zero-valued, with corresponding eigenvector  1  ~vi = 1 . This means that any vector element difference vi,j − vi,k = 0 before any integration 1 takes place. Hence, the term relating to the zero-valued eigenvalue will vanish from Equation (41) and (42). In contrast to the case of a two-fluid counterflow heat exchanger, the matrix in Equation (33) is not singular even in the case when Ch = C1 = C2. In the latter case of equal heat capacities, it can be found from Equation (35) that α1 = 0, α2 = −α3, so the system is not degenerate.

13 Equation (41) and (42) constitutes the general solution to the enthalpy transfer in a three-way heat exchanger. Any difference in order or direction of the cold streams and hot stream will simply add or remove minus signs in the heat balance in Equation (33), whether we go along or against the dx element. One of the three-fluid heat exchangers in the FREIA liquefier cycle resembles to Figure (5), but there is also one three-fluid heat exchanger where the cold flow 2 is parallel with the central hot flow, but is still anti-parallel to the cold flow 1. Consequently, due to the fact that we move along dx, the minus sign will vanish in Equation (32) and the CX temperatures are instead described by

 C0 C0    1 − 1 0   Tc1 C1 C1 Tc1 d  0 0 0 0    C1 (C1+C2) C2   Th  =  −  Th  . (43) dx    Ch Ch Ch     C0 C0  Tc2 0 2 − 2 Tc2 C2 C2

We must not forget to adjust the boundary condition such that Tc2(x = 0) = Tc2,i, and the conditions for Tc1 and Th remain unchanged. However, the final solution will still be of the form expressed in (37). The two-fluid and three-fluid cases are compared in Figure (6) with numerical test values and length L = 1 m. The left-most and the central plot represent the systems as illustrated in Figure (4) and (5) respectively. The right-most plot corresponds to Figure (5), with the difference that the central hot flow is only anti-parallel to cold flow 1 and parallel to cold flow 2. All of these occur in the FREIA liquefaction cycle.

Figure 6: Example plot of temperatures from two-fluid and three-fluid counterflow heat ex- changers of length L = 1 m, with corresponding layout above.

0 0 For the three-fluid heat exchangers, we considered C1 = 300, C2 = 300, C1 = 200, C2 = 500 and Ch = 500 as test values (in [J/K]). The incoming cold temperatures are 200 K and the incoming hot temperature is 300 K. For the two-fluid heat exchanger, the values from the three-fluid case

14 0 0 are kept but the second cold flow is simply removed, so C = C1, Ca = Ch and Cb = C1. The hot and the cold input temperatures are also kept. A much larger temperature decrease for the hot flow is achieved with two cold flows with respect to a single cold flow. Maximum cooling occurs in the central plot, when the hot flow is opposing both cold flows.

3.3 Turboexpander

Turboexpanders (TXP), or expansion engines, are devices allowing the gas to perform work on a spinning rotor and expand. This expansion results in large temperature reductions, so turboexpanders act as very efficient means of refrigeration. The process occurs ideally isentrop- ically, so ∆S = 0. In real processes, there will however be a small change in entropy. For the mathematical background on turboexpanders for ideal gases, we consult Flynn [2]. A schematic is presented in Figure (7). The gas first enters at lower speed at the inlet (point 1) before it is accelerated at the nozzles (point 2), then working its way through the rotor into the exhaust (point 3). The gas typically enters via the inlet and is directed tangentially by the turbine nozzles, accelerated by the peripheral ends of the rotor blades. The gas gradually has to work its way up to the exhaust, against the centrifugal force it experiences inside the rotor.

Figure 7: Schematic of a turboexpander.

For a loss-free turbine operating at sonic speed vc, the kinetic energy EK per mole of gas leaving the nozzle is

1 E = Mv2, (44) K 2 c where M is the molar weight. By energy conservation, the work to expel one mole from the 2 nozzle is the difference in the specific enthalpy: h1 − h2 = ∆h = Mvc /2 [2]. We also recall that

∆h = cP ∆T = cP (T1 − T2), (45) where cP is the heat capacity at constant pressure. The next step in the turboexpander is for the gas to overcome the centripetal potential energy barrier between point 2 and 3. We know 2 that the centripetal force F is expressed as F = Mvc /r. Employing the relation vc = ωcr, we find that the work W needed to overcome the spinning rotor of total radius R at sonic angular velocity ωc is

15 Z r=R Z r=R 2 1 2 2 1 2 W = F dr = Mωc rdr = Mωc R = Mvc , (46) r=0 r=0 2 2 assuming constant angular velocity of the turbine. The work done by the gas has to originate from somewhere for the gas to work against the centrifugal force. Thus, the deposited energy 2 in the shaft of the rotor is once again the difference in the specific enthalpy: h2 − h3 = Mvc /2. This is true if the exhaust velocity is very small. Thus, the energy absorbed from one mole of 2 gas at sonic velocities is Mvc /2. With the same argument as in Equation (45) between point 2 and 3, we obtain in total for the whole turboexpander process between point 1 and 3

1 1 c (T − T ) = c (T − T ) + c (T − T ) = Mv2 + Mv2 = Mv2. (47) P 1 3 P 1 2 P 2 3 2 c 2 c c

For an ideal gas, we can take this reasoning one step further. We use the well-known thermo- dynamic relations for isentropic processes

P V γ PV γ = constant ⇒ 1 = 2 , (48) P2 V1 and for the speed of sound in an ideal gas

PV v2 = γ , (49) c M where γ = cP /cV [2]. From the equation of state for one mole of an ideal gas in Equation (2), we obtain between point 1 and 2

V P T 1 = 2 1 . (50) V2 P1T2

From Equation (50) in (48), we get

P T γ/(γ−1) 1 = 1 , (51) P2 T2 which can also be applied between 1 and 3. Plugging in the ideal gas law Equation (2), together with (47) and (49), we see that

T T γR 1 − 1 = 1 − 3 = T2 T2 2cP 1 + γR (52) T1 2cP ⇒ = γR . T3 1 − 2cP

5 For a monoatomic ideal gas such as helium, cP = 2 R and γ = 5/3, so from Equation (52) and (51) we have

16 T P 1 = 2 and 1 = 5.64, (53) T3 P3

where 1 and 3 are the initial and final stages of the turboexpander. In most cases, it is essential that the gas does not undergo too much cooling and liquefy, which can damage the turbine. In addition, supersonic speeds can cause other unwanted effects that reduce the efficiency of the turboexpander. Here below is a code snippet, exemplifying how the CoolProp library can ˙ be used to describe a turboexpander for helium and calculate its output work We, if the input temperature T1, pressure P1 and mass flowm ˙ are known. The PropsSI function provided by CoolProp takes an input pair of properties and returns a third property from the equation of state. In this case, the input pair is P and T and the returned property is the specific enthalpy h, although it is capitalized in the code.

1 %Turboexpander for helium 2 h1= py.CoolProp.CoolProp.PropsSI( 'H','P',P1, 'T',T1, 'Helium '); 3 T3= T1/2; 4 P3= P1/5.64; 5 h3= py.CoolProp.CoolProp.PropsSI( 'H','P',P3, 'T',T3, 'Helium '); 6 deltah= h1- h3; 7 We=m*deltah;

3.4 Joule-Thomson Valve

An important phenomenon for liquefaction cycles is the Joule-Thomson (or throttling) process. It describes the temperature change of a when it is forced through a porous plug or valve. This process is isenthalpic, meaning that ∆H = 0 and no heat is exchanged with its environment. For ideal gases, the Joule-Thomson (JT) expansion does not change PV , meaning that U is unchanged and the temperature is constant. For real gases however, the PV factor does change. The rate of change of temperature is described by the Joule-Thomson coefficient µJT , defined as

∂T  µJT = . (54) ∂P H=const

In a gas expansion, ∂P is negative by definition. Hence, if µJT < 0, the change in temperature is positive upon Joule-Thomson expansion, and conversely µJT > 0 means that the gas experiences a temperature drop. The cooling produced by this effect is often used for the liquefaction of gases. The temperature at which µJT changes sign is called the inversion temperature of a gas. Several examples of µJT at atmospheric pressure can be seen in Figure (8). At room temperature, only hydrogen, helium and increase their temperature upon expan- sion, and require lower temperatures for throttling to act as cooling. Helium has the lowest inversion temperature of all gases, around 40 K depending on the pressure [2]. Therefore, in order to achieve liquefaction of helium, temperatures below this limit are needed.

If the initial temperature T1, the pressure P1 before and the pressure after P2 are known, we can easily find the final temperature T2 as we know the isenthalpic character of the throttling process. In the code snippet below, the convenient use of CoolProp for the purpose of quickly switching between these quantities is illustrated. To find the specific inlet enthalpy h1 we use

17 Figure 8: Joule-Thomson coefficient µJT values for some gases at atmospheric pressure. The inversion temperature for each gas at this pressure is where the x-axis is intersected. Image courtesy: Hankwang, Wikimedia Commons.

the PropsSI function provided by CoolProp, with P1 and T1 as the input pair. As we know that enthalpy and mass flow are conserved, we simply use PropsSI again with h2 = h1 and P2 as the input pair.

1 %JT-valve- isenthalpic process 2 h1= py.CoolProp.CoolProp.PropsSI( 'H','P',P1, 'T',T1, 'Helium '); 3 h2= h1; 4 T2= py.CoolProp.CoolProp.PropsSI( 'T','P',P2, 'H',h2, 'Helium ');

4 Classical Liquefaction Cycles

In this section, some of the classical liquefaction cycles and the theory behind are presented by gradual build-up. They also include some results from simulations of the theoretical model of Claude and Collins, with example input values of e.g. P and T similar to those in the FREIA Liquefier.

4.1 Linde-Hampson Cycle

The Linde-Hampson (or sometimes only Linde) cycle was successfully carried out in 1895 [13]. It set a benchmark for liquefaction processes as the first of its kind, and has virtually remained unchanged ever since. An illustration of the Linde-Hampson cycle can be seen in Figure (9), with marked in cyan. The gas with mass flowm ˙ at ambient temperature enters the compressor (CMP) in an , emitting heat to a coolant. At 1, the gas enters a recuperative counterflow heat exchanger (CX) that cools down the gas further to 2. The Joule-Thomson expander (JT) is an isenthalpic throttling valve. If the incoming gas is below its inversion temperature, the Joule-Thomson effect leads to cooling of the gas. As observed in Figure (8), the inversion temperature is around 40 K for helium at atmospheric

18 pressures. However, the inlet temperature of the JT valve needs to be even lower for liquefaction to take place. In the steady state, a portion of the gas in 3 is then liquefied and collected from the phase separator. The phase separator is the device in the liquefaction cycle preceded by the Joule-Thomson expansion valve, typically operating at lower pressures. If the inlet temperature in the throttling process is low enough, the temperature reduction will be enough to liquefy part of the gas.

Figure 9: Illustration of the Linde-Hampson cycle with initial mass flowm ˙ and output fluid mass flowm ˙ f after point 3.

What amount of liquid comes out of the process? We define the yield y as the outgoing fluid mass flowm ˙ f divided by the total mass flowm ˙ . The return gas in 4 is then heated up again by the counterflow heat exchanger and enters the compressor at 5. In order to derive y analytically, we set up a control volume confined to the dashed cyan box. Applying the first law of thermodynamics, the sum of the ingoing enthalpies is equal to the outgoing enthalpies of the volume

mh˙ 1 =m ˙ f hf + (m ˙ − m˙f )h5, (55) where hi is specific enthalpy and Hi =m ˙ ihi is the total enthalpy, for i = 1, 5, f (f stands for “fluid”). Solving for y we get

m˙ f h1 − h5 m˙ (h1 − h5) =m ˙ f (hf − h5) ⇒ y ≡ = (56) m˙ hf − h5

Equation (56) tells us that the proportion of the total mass flowm ˙ is simply a function of the specific enthalpies at various points. In addition, this crucial equation states exactly how much of the incoming mass flow in the phase separator that is locally turned into liquid. Below the critical temperature, we are within the saturation dome with mixed phases. The main purpose of the phase separator is to discharge all remaining gas back into the liquefaction cycle and deliver the liquid separately into its cryogenic storage dewar, a well-isolated vessel for the liquid. The following code snippet illustrates how we use y to simulate what happens inside the phase separator. If T < Tcritical, parts of the gas will be turned into liquid. We use the concept of vapour quality Q, where Q = 1 means fully saturated gas and Q = 0 means fully saturated liquid, together with T as input pair in the PropsSI function. In this way, we find the specific enthalpy of the fully saturated liquid hf and the specific enthalpy of the fully saturated

19 gas hgas. The yield y is found from Equation (56), and the total gas enthalpy Hgas is simply Hin − Hf = Hin − ymh˙ f , as we know that the outgoing liquid mass flowm ˙ f = ym˙ .

1 %Phase separator 2 Hin=m*hin; 3 if Tin < 5.1953%criticalT of helium 4 hf= py.CoolProp.CoolProp.PropsSI( 'H','T',Tin, 'Q' ,0,'Helium ');%Q= vapour quality 5 hgas= py.CoolProp.CoolProp.PropsSI( 'H','T',Tin, 'Q' ,1,'Helium '); 6 y=(hgas-hin)/(hgas-hf); 7 y=min(1,max(0,y));%to ensure0

4.2 Claude Cycle

In 1902, Georges Claude further improved the Linde-Hampson cycle by adding a piston, even though turboexpanders are often used nowadays [2]. The Claude cycle combines isentropic and isenthalpic expansions to achieve liquefaction. As the gas performs work in the rotor of the turboexpander isentropically, greater pre-cooling is achieved and also a higher yield y. The Claude cycle is displayed in Figure (10), with control volume marked in cyan. The Claude cycle relies on the same principles as the Linde-Hampson cycle, with the important addition of the isentropic expansion in the turboexpander (TXP). Some of the gas between point 2 and 3 from the main path is led through the turboexpander, and then returned in the mixer between point 8 and 9, where they merge again. This deviation of gas from the main flow is also illustrated in step 5 to the right in Figure (2). We also have three counterflow heat exchangers instead of one, as in the Linde-Hampson cycle.

Figure 10: Illustration of Claude cycle with initial mass flowm ˙ entering at point 1, mass flow m˙ e through the turboexpander, and output fluid mass flowm ˙ f after point 6.

20 ˙ The output work of the turboexpander We is the result of the isentropic expansion of the gas. m˙ e We define x as the fraction x = m˙ , wherem ˙ e is the mass flow through the expander andm ˙ is the total incoming mass flow at 1. The output fluid mass flow from the cycle after point 6 in Figure (10) is denotedm ˙ f . Applying once again the first law of thermodynamics in the control volume, we have that the ingoing enthalpy must sum up to the total outgoing enthalpy

˙ mh˙ 1 = We + (m ˙ − m˙ f )h11 +m ˙ f hf . (57)

˙ We take into account that the expander work output is We =m ˙ eh2 − m˙ ehe =m ˙ e∆h, where he is the specific enthalpy of the expanded gas that has passed through the turboexpander. We therefore have, solving for the yield y

mh˙ 1 =m ˙ e∆h + (m ˙ − m˙ f )h11 +m ˙ f hf

mh˙ 1 +m ˙ e∆h − mh˙ 11 =m ˙ f (hf − h11) m˙ h − h ∆h (58) ⇒y ≡ f = 11 1 + x m˙ h11 − hf h11 − hf

as long as x + y < 1. If we compare Equation (58) to Equation (56) from the Linde-Hampson cycle, we observe that there is an extra term depending on the proportion x of the mass flow that enters the turboexpander, and a higher y can be achieved with respect to the Linde-Hampson cycle. However, we need to be aware of what now happens in the phase separator. As the liquefaction occurring in the phase separator is purely local, the turboexpander flow xm˙ also reduces the mass flow into the JT valve and the phase separator tom ˙ 0 = (1 − x)m ˙ . We therefore introduce the concepts local and global yield. By local, we mean at the point precisely after the JT valve, where liquefaction takes place on a molecular level. On the other hand, global means over the whole cycle, including the separate turboexpander flows. The global yield y2 for the Claude cycle is the yield we saw from Equation (58). For the local yield however, we keep our focus on point 6 and 7 in Figure (10). By looking at the conservation of enthalpy and mass locally around the phase separator, we see that what comes in must also come out:

0 0 m˙ h5 =m ˙ f hf + (m ˙ − m˙f )h7

m˙ f h5 − h7 (59) ⇒y1 ≡ 0 = m˙ hf − h7

Consequently, the local yield y1 is simply obtained from Equation (59), at first sight similar to the case of the Linde-Hampson cycle in Equation (56). The difference is that Equation (59) depends on the specific enthalpies just around the phase separator and not at the inlet/outlet points of the whole cycle, as is the case in Equation (56). The amount liquefied in the phase separator is thus the local yield times the local mass flow: y1(1 − x)m ˙ . No matter how com- plicated the liquefaction cycle may be, y1 will always be of the simple form in Equation (59). On a microscopic level, the proportion of gas particles turned into liquid must obey this local formula. At the end of the process however, as much liquid must come out locally as globally. This enforces Ny1 = y2, where N is a normalization factor to adjust for the difference between

21 m˙ andm ˙ 0. As we later shall see for numerical iterative simulations in MATLAB, first solving for y1 locally is crucial to find the global yield y2 for the whole cycle. Results from the simulations of the theoretical model can be seen in Figure (11a) and (11b), where the points on the x-axis correspond to the points in Figure (10). In Figure (11a), the temperature and gas flow profile of the Claude cycle is displayed. The top diagram shows the temperature T at that point, and the bottom diagram shows the gas flow Q at the same point. The gas flow Q has the same unit [kg/s] as mass flowm ˙ and has identical meaning - not to be confused with vapour quality that is also denoted Q! All the red boxes correspond to the heat exchangers, where T (the black line) gradually decreases or increases. The steep temperature drop occurs in the Joule-Thomson valve (dark-green box). The kink in the gas flow Q between point 6 and 7 in the cyan-coloured phase separator corresponds to the gas that has been liquefied. Step 12-13 correspond to the before and after the turboexpander (light-green box), respectively connected (marked by dashed lines) to the division of the flow between point 2 and 3, and the mixer between point 8 and 9 (small dark-blue box). The mixer is simply where the main gas flow and the turboexpander flow merge.

In Figure (11b), the local yield y1, the normalized local yield (1 − x)y1 and the global yield y2 are shown for each iteration. The x-axis describes the iterative process towards equilibrium conditions, and not the temporal evolution of the system. In particular, the initial spike is purely numerical. The normalized local yield and global yield actually overlap entirely to form one line, which they should if global and local calculations agree. Without any additional pre- cooling from ambient temperature, the global yield y2 is about 2.3% with a fraction x = 0.65 going into the turboexpander flow.

(a) Temperature and gas flow profile of the Claude cycle. (b) Global and local yields of the Claude cycle, where the close-up in the red box shows how the global and normalized local yield overlap.

Figure 11: Temperatures, gas flows and yields of the Claude cycle.

22 4.3 Collins Cycle

The Collins cycle is an extension of the Claude cycle, but with two turboexpanders instead of one and two additional heat exchangers, as seen in Figure (12), with the control volume marked in cyan. The extra turbine and heat exchangers lead to further pre-cooling before liquefaction, meaning higher yields. It was invented by Samuel Collins in 1946, which revolutionized the commercially available production of liquid helium [14].

Figure 12: Illustration of the Collins cycle, with mass flowm ˙ entering at point 1 and mass flows m˙ e1 andm ˙ e2 through the respective turboexpanders. The output fluid mass flowm ˙ f occurs after point 9.

˙ ˙ The output work of the turboexpanders TXP1 and TXP2 are denoted We1 and We2, respectively with mass flowsm ˙ e1 andm ˙ e2. Turboexpander flow 1 starts after point 2 and is reunited with the main path again after point 14, whereas turboexpander flow 2 starts after point 5 and merges with the main path again after point 11. We also know that

˙ We1 =m ˙ e1∆he1 (60) ˙ We2 =m ˙ e2∆he2,

where ∆he1 and ∆he2 are the drops in specific enthalpy across the respective turboexpanders. Just like for other liquefaction cycles, we apply the first law of thermodynamics in the control volume marked by the dashed cyan line in Figure (12), so the ingoing enthalpy must sum up to the outgoing enthalpies

23 mh˙ 1 =m ˙ e1∆he1 +m ˙ e2∆he2 + (m ˙ − m˙ f )h17 +m ˙ f hf . (61)

Dividing bym ˙ and rearranging, we get

m˙ m˙ m˙ f (h − h ) = h − h + e1 ∆h + e2 ∆h m˙ 17 f 17 1 m˙ e1 m˙ e2 m˙ f h17 − h1 ∆he1 ∆he2 (62) ⇒y ≡ = + x1 + x2 , m˙ h17 − hf h17 − hf h17 − hf

m˙ e1 m˙ e2 where x1 = m˙ and x2 = m˙ . As can be seen in the final expression of Equation (62), we have two additional turboexpander-related terms that contribute to increased global yield. Results from the simulations of the theoretical model can be seen in Figure (13a) and (13b). In Figure (13a), the temperature and gas flow profile of the Collins cycle is displayed, where the points on the x-axis correspond to the points in Figure (12). The top diagram shows the temperature T at that point, and the bottom diagram shows the gas flow Q at the same point. All the red boxes correspond to the heat exchangers, where T gradually decreases or increases, just like for Claude but with two more heat exchangers. The steep temperature drop occurs in the Joule-Thomson valve. The kink in the gas flow between point 9 and 10 in the cyan-coloured phase separator corresponds to the gas that has been liquefied. Some of the gas from point 2.5 goes through TXP1 and is then returned to point 14.5. This separate mass flow is denoted step 18-19 in the graph. Similarly some of the gas from point 5.5 goes through TXP2, and is returned at point 11.5. This step is marked 20-21.

(a) Temperature and gas flow profile of the Collins cycle. (b) Global and local yields of the Collins cycle.

Figure 13: Temperatures, gas flows and yields of the Collins cycle.

In Figure (13b), the local yield y1, the normalized local yield (1 − x1)(1 − x2)y1 and the global yield y2 are shown for each iteration. The x-axis describes the iterative process towards

24 equilibrium conditions, and not the temporal evolution of the system. In particular, the initial spike is purely numerical. Also here, the normalized local yield and global yield actually overlap entirely to form one line, which they should if global and local calculations agree. Without any additional pre-cooling from ambient temperature, the maximum global yield y2 is about 5.2% with fractions x1 = 0.45 and x2 = 0.35 of the gas flow going into the respective turboexpander flows.

5 The FREIA Helium Liquefier

The liquefier Linde L140 in the cryogenic facility of the FREIA Laboratory has been installed by the Linde Group, and is capable of producing 140 l/h of liquid helium [8]. The liquefied helium is then collected in a 2000 l storage dewar. It is an important part of the research infrastructure to ensure a steady supply of coolants, needed for instance at the experiments in the low-temperature cryostats, but also at other institutions of the Uppsala University. A technical schematic of the system when not in operation is shown in Figure (14). The cycle starts with the compressor at the very top right, and then goes clock-wise in the schematic. High-pressure gas from the compressor is led through the first heat exchanger E3110, where the red loop corresponds to the liquid nitrogen pre-cooling system. The gas then goes through more heat exchangers and turboexpanders (central right), before reaching the JT-valve and then the phase separator (bottom left). The gas either goes in the return flow back to the compressor, or through the purification system located in the whole top left. Temperature sensors are the small boxes in red containing numbers, whereas the pressure sensors are the boxes coloured in blue. In its structure, the FREIA liquefier is a hybrid of the Claude and Collins liquefaction cycles. A simplified thermodynamic cycle drawing is shown in Figure (15). Just like the Collins cycle, it has two turboexpanders for additional pre-cooling of the gas. However, the crucial distinction is that a single mass flow goes through both turboexpanders. As in the Claude cycle, there is only one separate mass flow going through the turboexpanders. In the case of the FREIA cycle, this intermediate step between the turboexpanders is connected to a three-fluid heat exchanger CX3. It is worth to point out that the turboexpander flow is parallel to the incoming hot flow on the high-pressure side, but anti-parallel to the outgoing cold flow on the low-pressure side of CX3. We denote Mixer 1 as the point between 2 and 3 that separate the mass flows, and Mixer 2 that reunite the flows between point 11 and 12.

Another important feature of the FREIA liquifier is the possibility of liquid nitrogen (LN2) pre-cooling at around 77 K, connected to the three-fluid heat exchanger CX1. The mass flow of the liquid nitrogen over CX1 ism ˙ N . As the nitrogen used as a coolant is heated up from the hot flow, there is a specific enthalpy gain ∆hN . Differently to CX3, here both the LN2 flow and the cold return flow are anti-parallel to the incoming hot flow. In addition, some part of m˙ pur the mass flow xpur = m˙ between point 6 and 7 may be discharged to cool the purification system. This helium gas is not purified itself, but cool down impure helium gas that has been extracted from the recuperative helium system. To derive the yield of the FREIA cycle, we once again look into the conservation of enthalpy in a control volume marked by dashed cyan lines in Figure (15). Just like for the Collins cycle, we assume a specific enthalpy drop ∆h1 and ∆h2 over TXP1 and TXP2 respectively, through which the mass flow ism ˙ e. We solve for the yield y

25 Figure 14: Schematic of FREIA liquefier cycle with purification system on the upper left.

m˙ 1h1 =m ˙ e(∆h1 + ∆h2) +m ˙ purh6 +m ˙ f hf +m ˙ N ∆hN + (m ˙ − m˙ f − m˙ pur)h16 m˙ m˙ m˙ m˙ f (h − h ) = e (∆h + ∆h ) + pur (h − h ) + N ∆h + h − h m˙ 1 16 m˙ 1 2 m˙ 16 6 m˙ N 16 1 (63) m˙ h − h m˙ ∆h + ∆h m˙ h − h m˙ ∆h ⇒y ≡ f = 16 1 + e 1 2 − pur 6 16 + N N . m˙ h16 − hf m˙ h16 − hf m˙ h16 − hf m˙ h16 − hf

26 Figure 15: Simplified drawing of the FREIA liquefaction cycle. Mass flowm ˙ enters at point 1, and mass flowm ˙ e goes through the turboexpanders. The output fluid mass flowm ˙ f occurs after point 9.

With respect to previous formulae for yield, Equation (63) contains a negative contribution from the purification process, and a positively contributing term from the LN2 pre-cooling. However, we will neglect any purification processes for now as it decreases performance of the liquefaction and only needs to be done for small time intervals on a regular basis.

In order to simulate the LN2 pre-cooling, we implement the theoretical model for the three-fluid heat exchanger as described in Section 3.2.2. We model the flow of liquid nitrogen as a heat bath, absorbing as much enthalpy as possible from the hot flow coming from the compressor. A heat bath, or thermal reservoir, is a part of a whose heat capacity C is large enough such that its temperature remains almost constant in contact with any other part of the system. The specific heat capacity hN of LN2 is known and can easily be found with CoolProp, so to achieve a heat bath we assume that the mass flow of LN2 is 100 times greater than the incoming hot flow of helium. How much enthalpy that is transferred across CX1 depends on the temperatures of the incoming flows, but also on the design of the heat 0 0 exchanger. We can adjust the heat exchanger design parameters C1 and C2, that determine the coupling in the heat equations between the hot flow and the cold return flow, and between the hot flow and the LN2 flow respectively. This theoretical model of FREIA aims at finding the unknown parameters not specified in the

27 manual of the manufacturer. We know for instance that the compressor in FREIA is designed for an initial mass flow of around 41 g/s operating at 14 bar, but the mass flow is slightly lower during normal operation at 12 bar. We also know that the low-pressure side of the cycle has a pressure of 1.12 bar. There are several pressure and temperature sensors in the liquefier that can give us guidance, but far from everywhere. The global yield of the actual liquefier while running with LN2 pre-cooling is around 10%, whereas it drops to around 5-6% without. Thus, there are several unknown parameters that we can adjust. First of all, we have to 0 entirely guess the design of the heat exchangers by adjusting the design parameters C1 and 0 C2 such that there is enough pre-cooling for liquefaction to occur. There are no mass flow sensors in the liquefier, so we do not know the turboexpander mass flow proportion x. The turbine expansion process was also assumed to be isentropic, which we do not know for the real liquefier. To imitate the real liquefier as well as possible, these degrees of freedom can be adjusted accordingly. Nevertheless, the theoretical model can also be used to simulate the hypothetical maximum efficiency of the liquefier.

5.1 Simulations and Results of the FREIA Model

Similar to the procedure of the other liquefaction cycles, we use the theoretical model based upon the assumption of enthalpy conservation in the cycle. A MATLAB function takes the input values of inlet pressure P1, gas flow Q1 and temperature T1. Q1 has the same unit [kg/s] as mass flowm ˙ and has identical meaning - not to be confused with vapour quality that is also denoted Q! This function then returns the temperatures and other parameter values at each point, which are iteratively used as input in a tester script for the next execution of the function. This process is then repeated until we have found numerical equilibrium, which we assume to correspond to the steady-state operation of the liquefaction cycle with no major changes in enthalpy flows. The temperature and gas flow profiles of the FREIA model simulations without and with LN2 pre-cooling are presented in Figure (16a) and (16b), where the points on the x-axis correspond to the points in Figure (15), except step 17-20 that describe the turboexpander flow. The top diagram shows the temperature T at that point, and the bottom diagram shows the gas flow Q at the same point. Just like in the temperature profile of Claude and Collins, there is a gradual decrease in T through the heat exchangers, a sudden drop in T in the JT-valve and then gradual reheating again in the heat exchangers. Some of the gas is led from point 2.5 to the unified turboexpander flow, participating in the three-fluid heat exchanger CX3 between TXP1 and TXP2, then returning into the main flow at point 11.5. Once again, step 17-20 do not exist in Figure (15) but we include them to describe the temperature and gas profile of the turboexpander flow. A larger kink in the gas flow between point 9 and 10 can be seen for the model with LN2 pre-cooling, meaning that the yield is higher.

The yields of the FREIA model simulations without and with LN2 pre-cooling can be seen in Figure (17a) and (17b) for each iteration. The local yield y1, the normalized local yield (1−x)y1 and the global yield y2 are shown for each iteration. The x-axis describes the iterative process towards equilibrium conditions, and not the temporal evolution of the system. In particular, the initial spike is purely numerical. Also here, the normalized local yield and global yield actually overlap entirely to form one line, which they should if global and local calculations agree. The turboexpander mass flow proportion was set to x = 0.6. The final value of the global yield without LN2 pre-cooling is 6.1%, and 10% with LN2 pre-cooling. The function and script related to the FREIA model with LN2 pre-cooling, including all parameter values

28 (a) Temperature and gas flow profile of the FREIA cycle without LN2 pre-cooling.

(b) Temperature and gas flow profile of the FREIA cycle with LN2 pre-cooling.

Figure 16: Temperature and gas flow profiles of the FREIA liquefier model simulations. for these results, can be found in Appendices 11.1 and 11.2. The in-vs-out difference in enthalpy ∆H˙ and missing gas flow ∆Q are displayed in Figure (18), as a function of the iteration number. Note the exponent on the y-axis, that ∆H˙ is oscillating

29 (a) Yields of the FREIA cycle without LN2 pre-cooling. (b) Yields of the FREIA cycle with LN2 pre-cooling. Figure 17: Yields of the FREIA liquefier model simulations.

around order of 10−12 J/s and ∆Q stays flat at 0 kg/s. Therefore, we can conclude that both the enthalpy and gas flow are conserved over the cycle. This difference acts as a sanity check to ensure that no enthalpy or mass flow “disappears” in the cycle.

Figure 18: In/out difference in gas flow ∆Q and enthalpy ∆H in the FREIA model.

A temperature-entropy (TS) diagram of the results with LN2 pre-cooling in Figure (16b) and (17b) is presented in Figure (19), with the points from Figure (15). This is a very useful tool to visualize the heat transfer that takes place over the whole cycle. T and S drop steadily from the compressor at point 1 to point 8 at constant pressure. The path of the gas through the turboexpanders is also marked out with its intermediate interaction with heat exchanger CX3. The path between point 8 and 9 describes the isenthalpic process in the JT valve, until the gas reaches the critical point. The gas of the main cycle will then go along the saturated vapour line of the saturation dome, whereas some of it is left as liquid. Note that point 11 has a higher T than point 12, as the cooled gas from the turboexpanders is mixed with the

30 main path in Mixer 2. Point 9 to 16 represent the return flow of the gas, which is reheated isobarically. Compare the TS diagram of FREIA in Figure (19) to the liquefaction cycle sketch to the right in Figure (2).

Figure 19: TS diagram of the FREIA cycle with LN2 pre-cooling. The main path of the gas in the FREIA cycle is marked out, with all points in Figure (15).

We also compared our simulation results to the actual sensor values inside the FREIA liq- uefaction cycle. The sensor values of the turboexpander path during liquefaction with LN2 pre-cooling can be seen in Figure (20a) and (20b). The average inlet temperature to TXP1 under operation was 40 K, and the average outlet temperature after TXP2 was 9.3 K, whereas our simulation results in Figure (16b) gave 49 K and 7.4 K respectively. However, we did observe a big discrepancy in the pressure drop over TXP1 in FREIA. The average value of P went from 12 bar to 5.8 bar over TXP1, a reduction by slightly more than a factor 2. For the isentropic expansion, we had assumed a pressure reduction of a factor 5.64. On the other hand, the average value of P decreases by a factor 5.18 over TXP2 if we consider the P = 1.12 bar of the return flow. This decrease factor is closer to our estimate. The sensor values, especially in pressure, wiggled in a periodic way. For instance, there is a clear drop at around 24 minutes into the cycle for the pressure sensors PI3130 and PI3150. This is due to the fact that a small portion of the gas is regularly used to cool the purification circuit, and the large drop in pressure occurs when this purification has finished. For the comparison with our simulation results, we took the average sensor values for TXP1 and TXP2 above. In our calculations for the turboexpanders in FREIA, the total difference in entropy over both turboexpanders is ∆S = 2900 [J/(kg K)]. If we assume isentropic expansions in both turboexpanders, the enthalpy transfer ∆H˙ from the turbine flow to the hot flow in CX3 needs to be 1660 J/s, but in our simulation this enthalpy transfer was 1300 J/s at steady state. This discrepancy means that TXP1 probably adds some entropy to the process, so it is very likely that TXP2 does so too. We can thus state that the real turboexpanders are not entirely isentropic, but almost. On the other hand, if we are interested in using the simulations to find the maximum yield possible, we can adjust various parameters. The maximum yield can be seen in Figure (21).

31 (a) Sensor data of pressures before TXP1 (PI3130) and (b) Sensor data of temperatures before TXP1 (TI3130) before TXP2 (PI3150). and after TXP2 (TI3155).

Figure 20: Example data from sensors in the FREIA liquefier during operation, here from the turboexpander section.

We found a maximum yield of 17.6% by setting the fraction x = 0.62 into the turboexpander flow and add a strong coupling between the hot incoming flow and the cold return flow in CX1 0 (i.e. increase design parameter C1), and slightly weakening the coupling between the hot flow 0 0 and the LN2 pre-cooling (i.e. decrease C2). We also increased the design parameter C for all the other heat exchangers. We found that the maximum global yield y2 = 17.6%. This was done by varying the degrees of freedom until the maximum value of y at equilibrium was found. The exact parameter values can be found in Appendix 11.1 in the commented code, right next to the three-fluid heat exchangers.

Figure 21: Maximum yield obtained with simulations of the theoretical model of the FREIA liquefier.

32 The final results also indicated that the helium did not always behave like an ideal gas. De- pending on the pressure, the heat capacity at constant pressure cP is no longer constant below roughly 20 K, as we saw in Figure (1). In our theoretical model for FREIA, this affects in particular the last two heat exchangers: CX4 and CX5. Surprisingly enough, the ideal gas approximation also holds for the liquefaction temperature at point 10 in Figure (15). However, the only point where cP actually is relatively far off from the ideal gas approximation is on the 5 high-pressure side at point 7. This deviation is about 33% from cP = 2 R. On the other hand, this effect can be compensated for in the design of the heat exchanger, as the heat exchanger design parameter C0 and length L are unknown and can be chosen freely in the model.

6 Discussion

In this study, a theoretical model of the FREIA helium liquefaction cycle has been constructed on the same foundations as the classical liquefaction cycles of Linde-Hampson, Claude and Collins. Despite the simplicity of enthalpy conservation, the interplay of the numerous thermo- dynamic components in the FREIA model is not always trivial. In the theoretical model, we had to ensure that not only enthalpies must be conserved, but especially that the processes were reasonable and physical: heat should not flow from cold to hot only by itself, the gas should not be liquefied inside the turboexpanders, the model must start with room temperature, and so on. The list of physical demands can be made long. The simulations of the theoretical model must converge to steady-state values at the equilibrium of the liquefaction process. Surprisingly enough, it turns out that a major part of the interactions, especially in the heat ex- changers, are linear and can be solved relatively easily. As was shown in Section 3.2 and 3.3, the relation between the inlet and outlet temperatures of all heat exchangers and turboexpanders are purely linear. Concerning the theoretical background of the heat equations, we consulted Flynn [2] for the two-fluid heat exchangers and Sekulic et al. [12] for the three-fluid heat ex- changers. Flynn was also consulted for the turboexpanders. Our approach of solving systems of linear first-order homogeneous differential equations differed from the Effectiveness - Num- ber of Transfer Units (NTU) method used by Flynn and Sekulic, but the results of both heat exchanger types are identical. Our solution with eigenvectors and eigenvalues with boundary conditions turned out to be more mathematically digestible, with a consistent add-on strategy of the matrix describing the heat equations, no matter the number of flows. In addition, we can easily generalize our heat exchanger model to any three-dimensional shape by replacing our heat exchanger design parameter C0 with the heat transfer coefficient times the contact area UA, as mentioned in Section 3.2. The three-fluid heat exchangers may result in long analytical expressions, but the heat equations governing the interactions are nonetheless linear with a unique solution. In all cycles, the only non-linear interaction is the liquefaction process in the phase separator. These are governed by the equations for the yield y, that in turn depends on the specific enthalpies hi at various points. At this stage, CoolProp [9] is an invaluable tool for easily switching between thermodynamic quantities even when they are not linearly related. The thermodynamic cycles as entities are thus non-linear, but this non-linearity is very weak as most components are in fact linear with a unique solution. Therefore, the convergence to a steady-state liquefaction should be unique with no other stable points. Nevertheless, this reasoning of uniqueness is important to keep in mind, especially since our theoretical model is solved numerically. The real liquefaction process in the FREIA liquefier reaches a global yield y of around 10% with liquid nitrogen pre-cooling, and around 5-6% without. Adjusting our model parameter

33 values, such as the heat exchanger design parameter C0, we can swiftly change the output yield as desired. From the configuration presented in Figure (16b), (16a), (17b) and (17a), our simulations result in slightly more than 10% with LN2 pre-cooling, whereas it drops to 6.1% by simply removing the coupling to the LN2 flow. We used 12 bar for the high-pressure side in the simulations, just like the real liquefier does. However, the cycle inlet gas flow Q1 of 41 g/s of gaseous helium from the compressor manufacturer’s guide is specified for 14 bar, a slightly higher pressure than at which the real liquefier in FREIA operates. Thus, the real gas flow is slightly lower than 41 g/s. As no gas flow sensors are installed in the liquefier, we do not know this quantity. However, by operating the liquefier compressor at different pressures and investigate the liquid output, one could in theory interpolate what initial mass flowm ˙ corresponds to 12 bar. In addition, the fact that the real turboexpanders are not entirely isentropic, as we assumed in the model, may also contribute to discrepancies. Nonetheless, the yields of the simulations could be adjusted from design parameters and agree with the real liquefier, within less than one percentage point. Not only did the simulations agree with real liquefaction yields, but also demonstrated an upper limit y = 17.6% without making the processes non-physical or technically infeasible. We observed that the major improvement in yield could be achieved by setting the turboexpander flow fraction x of the initial mass flow to 0.62. This also includes adding a strong coupling between the hot incoming flow and the cold return flow in CX1, and slightly weaken the coupling 0 between the hot flow and the LN2 pre-cooling. We also increased C for all heat exchangers. Even though the real liquefier does not reach 17% yield, this may act as a guidance for what to focus on in improving the performance of the machine. Even though heat exchangers are expensive to replace, it may also indicate where possible future hardware upgrades of the liquefier may have the largest impact. Throughout this study, several approximations of real physical phenomena had to be made. In our theoretical model, we assumed isentropic expansion of monatomic gas in the turboex- panders. In reality, the turbines in use inside the FREIA liquefier are not entirely isentropic. Due to the lack of sensors at some points in the liquefier, we cannot verify this. As can be seen in the schematic in Figure (14), temperature sensors are not placed anywhere between CX2 and CX4, nor between the turboexpanders. This means that even though we know the difference in entropy between the inlet to TXP1 and the outlet of TXP2, we do not know how much enthalpy is transferred in CX3. For the turboexpanders in FREIA to be isentropic, more enthalpy had to go through the heat exchanger CX3 than allowed for in our simulations, which shows that they are not fully isentropic. In order to investigate this further, we would need more detailed manufacturing information and design. Another approximation was to assume that helium behaves like an ideal gas, with specific heat 5 capacity at constant pressure cP = 2 R. As we saw in Figure (1), this approximation holds for higher temperatures and precisely at liquefaction temperature inside the FREIA liquefier. The sole large discrepancy from the ideal gas approximation occurred at point 7 in Figure (15), but this effect is small and can be considered in the heat exchanger design, as the heat exchanger design parameter C0 is unknown. The important principle of enthalpy conservation 0 remains. For instance, a small increase in cP for the return flow simply means that C decreases slightly. As we can adjust C0 freely in the model, this effect is probably due to numerics. The main flaw of the model is probably the fact that we assume cP to be constant inside the heat exchangers, which we know is not the case for temperature intervals spanned by CX5. However, this correction might belong to the higher order. An important aspect of the report is to self-assess the project from a societal and ethical per- spective, and to estimate the impact of this type of research. First of all, as was mentioned

34 in the introduction, the market size of cryogenics is rapidly growing as more applications are discovered. Medical equipment, organ transplantation, food storage, power transmission, super- conductors, electronics and many interdisciplinary scientific experiments all require cryogenic temperatures. Liquid nitrogen at 77 K suffices in many cases, but many experiments that require lower temperatures must use liquid helium. To better understand the liquefaction pro- cess, not only of helium but also of other gases, is thus crucial for an efficient production. In addition, an optimized liquefaction cycle allows for electricity savings and lower maintenance costs. For instance, a slight change to the heat exchanger design may allow the compressor to work at lower power, or to reduce the amount of liquid nitrogen needed for cooling, while keeping high liquefaction yields. Theoretical models and simulations allow , big and small, to better understand and take the command of the thermodynamic processes in their own facilities. Hopefully, these types of simulations may also lead to improved methods to increase the yield and maintain higher liquefaction rates. As we showed with the inclusion of LN2 pre-cooling, a great increase in yield was obtained as the helium gas could be cooled even further before reaching the Joule-Thomson valve, where the temperature-dependent liquefaction process oc- curs. Adjusting the design heat exchanger CX1 that contained the pre-cooling suddenly led to yet another increase in yield. Before changing the hardware of the liquefier itself, it is faster and less expensive to optimize the design in a proper theoretical model. Benchmarking a first version of cryogenic code for the FREIA liquefier is hopefully a step in the right direction.

7 Future Prospects

There are several aspects of the model that can be improved or extended. As we saw for the heat capacity at constant pressure cP of helium, it is not constant for lower temperatures. This affected mostly the high-pressure inlet at the last heat exchanger, and could probably be considered in the heat exchanger design. In our theoretical approximation for the heat exchangers, we assumed cP as constant and that of an ideal gas. Even though this would be more accurate for the last heat exchanger, a theoretical model with non-constant cP would probably only provide a higher-order correction and be very complicated. It would be interesting to investigate how the Linde Group deals with heat exhangers for helium spanning over this domain of irregular cP and if the design is drastically different. Another outlook for our theoretical model is to install further sensors in the FREIA liquefier, especially for mass flows and temperatures between the turboexpanders, still a terra incognita. For the maximum yield of liquefaction, we saw that a slight change in the heat exchanger design parameter C0 led to an increased yield of several percentage points. This was especially true for the third heat exchanger in FREIA connected to the turboexpander flow. If possible, after theoretical optimization with our model, one could try to adapt this design to see if the actual liquefaction increases.

8 Conclusion

In this report, we developed a theoretical model of the helium liquefier in the FREIA labora- tory, implemented in MATLAB with the help of the CoolProp library. The main objective of the theoretical model of the FREIA liquefaction cycle was to find the unknown parameters not specified in the manual of the manufacturer, starting from the principle of enthalpy conserva-

35 tion. CoolProp allowed us to consider the behaviour of real gases to a very good approximation, and use our model in real systems. We started with a mathematical analysis of the classical liquefaction cycles of Linde-Hampson, Claude and Collins. We also developed mathematical models of the cycle components such as heat exchangers, Joule-Thomson valves and turboex- panders. The models turned out to be linear with the exception of the actual liquefaction in the phase separator. We then implemented the liquefaction model for the FREIA cycle in a MATLAB function that iterated until thermodynamic equilibrium of liquefaction was reached. We found liquefaction yields similar to those in the real FREIA liquefier, with and without liquid nitrogen pre-cooling. In addition, temperature and pressure sensor values showed similar values to our model results, even though they were not installed everywhere. A maximum yield was also found by adjusting the parameter values, especially around the first heat exchanger. A future possible improvement is to further account for the irregularity of the helium heat capacity, and to implement the model to augment the actual liquefaction yield in the FREIA laboratory.

9 Popular Science Summary

Liquid helium is often used as coolant to achieve very low temperatures, a few degrees Kelvin above the absolute zero. It is used in many areas of science and industry, including the cool- ing of superconducting magnets in Functional Magnetic Resonance Imaging (fMRI) machines. However, the liquefaction of helium requires large machinery with many thermodynamic steps. In the FREIA Laboratory at the Uppsala University, many experiments in instrumentation and accelerator physics require liquid helium. The liquefier inside the FREIA Laboratory has been installed by the Linde Group, but still contains many unknown quantities, such as tempera- tures and mass flows, not specified in the manual of the manufacturer. The purpose of this project is to develop a theoretical model and simulate the helium liquefaction of the FREIA liquefier in MATLAB, in order to find these unknown parameters. We started from the prin- ciple of enthalpy conservation, meaning that energy must be conserved in closed systems such as liquefaction cycles. We developed a rather simple mathematical model for cycle components such as turboexpanders and heat exchangers, two types of devices whose main purpose is to cool down gas. We devel- oped a slightly more complex model for the liquefaction in the phase separator, where gas and fluid are separated. We put these components together into a cycle and gradually increased the complexity of the model, starting from the historically important liquefaction cycles of Linde-Hampson, Claude and Collins. The FREIA liquefaction cycle, as illustrated in Figure (15), turned out to be similar to Collins. The liquefaction was simulated in iterative processes until the cycle had reached thermodynamic equilibrium, that is when no major changes in en- thalpy flows occur. In our simulations, the proportion of the initial gas flow that was liquefied - a value called yield - was similar to that of the real liquefier. Liquid nitrogen can be used in the real FREIA liquefier to further cool down the helium gas to increase liquefaction. We also extracted a temperature-entropy diagram, shown in Figure (19) - a type of diagram often used to illustrate steps in thermodynamic cycles. Entropy is a thermodynamic quantity that measures the disorder in a system, and can easily be converted to other quantities such as temperature and pressure. If two of these thermodynamic quantities are known, we know the state of the gas. Thus, every point in Figure (19) represents a unique of the gas, illustrating what happens to the gas as it goes through the cycle. In addition, we observed an increase of more than 50% in yield after adjustments of the heat

36 exchanger design in the model. Even though the real liquefier cannot liquefy this much, these adjustments tell us which parts of the cycle that affect the performance of the simulated lique- fier. In order to optimize the real liquefier, these simulations play an important role in targeting the possible upgrades with the largest possible impact. For instance, running the liquefaction cycle at lower power while keeping the same helium liquefaction rate allows for electricity sav- ings. In the future, we could potentially synchronize the simulations with the real liquefier even further by adding only a few temperature sensors in chosen locations.

10 Acknowledgements

When I started this project, I hoped to learn a bit more about the instruments and control system in the FREIA Laboratory, and possibly some about the thermodynamics behind helium liquefaction in classical cycles. This enterprise turned out to be as theoretical as practical, covering everything from solutions systems of heat equations to sensor value read-off. It included many hours of frustration over debugging MATLAB functions and implementing seemingly simple thermodynamics, when enthalpy seemed to be missing somewhere. Nevertheless, it also gave many satisfactory moments when the parameter values of the final model were set just right and a kaleidoscope of results emerged. It led to even more joy to see that many of these results actually agreed with the not entirely documented liquefier. For a physics student like me at the end of the bachelor, this project meant constructing something with my own hands and with the help of many, to find models and explanation of physical phenomena. Not only did I get to know the FREIA liquefier and laboratory better, but also its people. First of all, I want to sincerely express my gratitude to my supervisor Volker Ziemann, whose enthusiasm spread from the very start. No matter how many new projects and ideas you were manoeuvring for the moment, your eagle eye often quickly helped me to spot the tiniest bug in the model. There was always time for me, and I really enjoyed our long discussions wherever the topics would lead us. I want to thank Roc´ıoSantiago Kern, Konrad Gajewski and Lars Hermansson for very helpful consultation on the cryosystem in FREIA. I am very grateful towards Esat Pehlivan for taking time to retrieve the sensor data needed, and towards Roger Ruber for useful advice on the project and for providing invaluable information about the liquefier. In addition, I also want to thank my co-sailor Sveva Castello for always being the muse of the moment, for supporting me in every struggle and for helping me to look beyond the horizon.

37 References

[1] S. Widmalm, “Anders Celsius.” Nationalencyklopedin Website. http://www.ne.se/ uppslagsverk/encyklopedi/lang/anders-celsius. [Online; accessed 05-May-2020].

[2] T. Flynn, Cryogenic engineering, revised and expanded. CRC Press, 2004.

[3] J. Wilks, The properties of liquid and solid helium. Clarendon Press, 1967.

[4] S. Ulmer and O. Jansen, fMRI: Basics and Clinical Applications. Springer, 2010.

[5] MarketsAndMarkets, “Industrial gases market by type, by function, by storage, trans- portation and distribution, by end use industry, by region: Trends and forecast to 2021.” https://www.marketsandmarkets.com/Market-Reports/industrial-gases- market-143368202.html/, 2020. [Online; accessed 18-April-2020].

[6] CERN Official Website, “Cryogenics: Low temperatures, high performance.” https:// home.cern/science/engineering/cryogenics-low-temperatures-high-performance. [Online; accessed 18-April-2020].

[7] S. Hayes, “Erratic helium prices create research havoc.” Physics Today 70, 1, 26. https: //physicstoday.scitation.org/doi/pdf/10.1063/PT.3.3424, 2017. [Online; accessed 13- March-2020].

[8] R. Ruber, V. Ziemann, K. Gajewski, V. Goryashko, K. Fransson, R. Wedberg, M. Jacewicz, M. Olveg˚ard,L. Hermansson, R. Yogi, et al., “The new FREIA laboratory for accelerator development,” 2014.

[9] I. H. Bell, J. Wronski, S. Quoilin, and V. Lemort, “Pure and pseudo-pure fluid thermophys- ical property evaluation and the open-source thermophysical property library Coolprop,” Industrial & Engineering Chemistry Research, vol. 53, no. 6, pp. 2498–2508, 2014.

[10] F. Mandl, Statistical Physics. John Wiley & Sons, 2008.

[11] Y. Cengel and M. A. Boles, Thermodynamics: An Engineering Approach 8th Edition. McGraw-Hill Education, 2002.

[12] D. Sekuli´cand R. Shah, “Thermal design theory of three-fluid heat exchangers,” in Ad- vances in Heat Transfer, vol. 26, pp. 219–328, 1995.

[13] C. Linde, “Process of producing low temperatures, the liquefaction of gases, and the sep- aration of the constituents of gaseous mixtures.,” May 12 1903. US Patent 727,650.

[14] R. Johnson, S. Collins, and J. Smith, “Hydraulically operated two-phase helium expansion engine,” in Advances in Cryogenic engineering, pp. 171–177, Springer, 1971.

38 11 Appendices

11.1 FREIA LN2 Enthalpy Model Function

The MATLAB function below contains the theoretical model of the FREIA Liquefier with liquid nitrogen pre-cooling, including enthalpies, gas flows and cycle components described in Section 3. The composition of the liquefaction cycle is described in Figure (15). The function takes the gas flow Q1 and pressure P1 at the inlet points as input parameters, but also temperatures around heat exchangers and yields from the previous iterations.

1 %Freia_liquefier.m- version using enthalpy conservation for the 2 %Freia cycle, witha 3-fluid heat exchanger and LN2 pre-cooling 3 %Updated 2020-04-28 4 %distinction between extensive and intensive quantities --> h_i is specific ethalpy[J/kg*s], H_i enthalpy[J/s] 5 function[y1,y2,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,deltaH, deltaQ,... 6 Q2,Q3,Q4,Q5,Q6,Q7,Q8,Q9,Q10,Q11,Q12,Q13,Q14,Q15,Q16,St11,St12,St21,St22, H8] = ... 7 Freia_liquefier_Elias_enthalpies_LN2(y,Plow,P1,Q1,T1,T5,T7,T10,T11,T12, T13,T14,T15); 8 globalx Tt12 Tt21 Tt22%input values forHE return flows 9 10 %Initial set-up 11 %Remember[P]= Pa and[H]=J/kg for Coolprop 12 %Mass rate fraction into turboexpanders1 and2(same flow): 13 x = 0.6;%maximum yield at 0.62 14 xpur = 0;%Rate going into purifier 15 L=0.5; Cprime=36.5*10e2;%heat exchanger design parameter[Cprime]=W/(K*m ) 16 Phigh= P1; 17 H1= Q1*py.CoolProp.CoolProp.PropsSI( 'H','P',Phigh*1e5, 'T',T1, 'Helium '); 18 19 %Collins mass flow at various points(mass has to be conserved) 20 Q2= Q1; 21 Q3 = (1-x)*Q2; 22 Qexp=x*Q2; 23 Q4= Q3; 24 Q5= Q4; 25 Q6= Q5; 26 Q7 = (1-xpur)*Q6; 27 Q8= Q7; 28 Q9= Q8; 29 Q10 = (1-y)*Q9;%as we use localy= y1 30 Q11= Q10; 31 Q12= Q11+x*Q2; 32 Q13= Q12; 33 Q14= Q13; 34 Q15= Q14; 35 Q16= Q15; 36 37 %Heat capacity c_p for monoatomic gas like He: c_p= 5/2*R= 5.19287e3[J/( kg*K)] 38 % so ifQ~m thenC=m*c_p 39 %Remember: these are total heat capacities 40 C1 = 5.19287e3*Q1; 41 C3 = 5.19287e3*Q3;

39 42 C4= C3; 43 C5= Q5*5.19287e3; 44 C7= Q7*7.75e3;%from Coolprop with values of T7, closer to real heat capacity 45 C11= Q11*5.19287e3; 46 C12 = 5.19287e3*Q12; 47 C13= C12; 48 C14= C13; 49 C15 = 5.19287e3*Q15; 50 51 %1stHE, three-fluidHE with LN2 precooling 52 53 %For2ndHE: 54 if abs(C3-C14)< 1e-8 55 Ch2 = 1/(1/C3+1/(Cprime*L)); 56 else 57 tmp=Cprime*L*(1/C3-1/C14); 58 if tmp < 30, eaL=exp(-Cprime*L*(1/C3-1/C14)); else eaL=0; end 59 Ch2= abs((C3*C14*(1-eaL))/(C3*eaL-C14)); 60 end 61 62 %For the3rdHE: three-fluid heat exchanger, calculations below 63 64 %For4thHE: 65 if abs(C5-C12)< 1e-8 66 Ch4 = 1/(1/C5+1/(Cprime*L)); 67 else 68 tmp=Cprime*L*(1/C5-1/C12); 69 if tmp < 30, eaL=exp(-Cprime*L*(1/C5-1/C12)); else eaL=0; end 70 Ch4= abs((C5*C12*(1-eaL))/(C5*eaL-C12)); 71 end 72 73 %For5thHE: 74 if abs(C7-C11)< 1e-8 75 Ch5 = 1/(1/C7+1/(Cprime*L)); 76 else 77 tmp=Cprime*L*(1/C7-1/C11); 78 if tmp < 30, eaL=exp(-Cprime*L*(1/C7-1/C11)); else eaL=0; end 79 Ch5= abs((C7*C11*(1-eaL))/(C7*eaL-C11)); 80 end 81 82 %1st: Three-fluid heat exchanger with LN2 precooling------83 if T15 <=0 84 T15=T1/2; 85 end 86 87 %LN2(very high heat capacity- heat bath) 88 TN2 = 77; 89 QN2 = 100*Q1;%try 100 times higher mass flow than Q1 90 CN2= QN2*py.CoolProp.CoolProp.PropsSI( 'C','P' ,1e5, 'T',TN2, 'Nitrogen '); 91 hN2i= py.CoolProp.CoolProp.PropsSI( 'H','P' ,1e5, 'T',TN2, 'Nitrogen '); 92 HN2i= QN2*hN2i; 93 94 %BC for1st three-fluidHE 95 Tin1=[T15; T1; TN2]; 96 c1prime1 = 7400;%maximum yield at 19400,500 97 c2prime1 = 1100;%Adjust this coupling for with/without LN2 precooling 98 99 %Matrix for three-fluid system with hot flow anti-parallel to cold flows 100 AA=[c1prime1/C15,-c1prime1/C15, 0;

40 101 c1prime1/C1, -1/C1*(c1prime1+c2prime1), c2prime1/C1; 102 0, -c2prime1/CN2, c2prime1/CN2]; 103 104 %Eigenvalues ofA 105 [VV,DD] = eig(AA); 106 ee= diag(DD); 107 108 %Eigenvectors ofA 109 u1=VV(:,1); 110 u2=VV(:,2); 111 u3=VV(:,3); 112 113 %ImposeBC contained in matrixB for three-fluid 114 B1=[u1(1)*exp(ee(1)*L), u2(1)*exp(ee(2)*L), u3(1)*exp(ee(3)*L); 115 u1(2)*exp(ee(1)*0), u2(2)*exp(ee(2)*0), u3(2)*exp(ee(3)*0); 116 u1(3)*exp(ee(1)*L), u2(3)*exp(ee(2)*L), u3(3)*exp(ee(3)*L)]; 117 BB1= inv(B1); 118 A1= zeros(3,1); 119 A1= BB1*Tin1;%integration constants 120 121 %Calculate enthalpy transfer from hot flow to cold flows 122 %Enthalpy flow from hot flow to return flow 123 dH11=-c1prime1*(A1(1)*(u1(2)-u1(1))*(1-exp(ee(1)*L))/ee(1) + ... 124 A1(2)*(u2(2)-u2(1))*(1-exp(ee(2)*L))/ee(2) + A1(3)*(u3(2)-u3(1))*(1-exp( ee(3)*L))/ee(3)); 125 %Enthalpy flow from hot flow to LN2 flow 126 dH12=-c2prime1*(A1(1)*(u1(2)-u1(3))*(1-exp(ee(1)*L))/ee(1) + ... 127 A1(2)*(u2(2)-u2(3))*(1-exp(ee(2)*L))/ee(2) + A1(3)*(u3(2)-u3(3))*(1-exp( ee(3)*L))/ee(3)); 128 %final specific enthalpy of N2 129 HN2f= HN2i+ dH12; 130 hN2f= HN2f/QN2; 131 deltahN2= hN2f- hN2i; 132 H2= H1- dH11-dH12;%what is left after HE1, and h2= H2/Q1 133 T2= py.CoolProp.CoolProp.PropsSI( 'T','P',Phigh*1e5, 'H',H2/Q2, 'Helium '); 134 135 %------136 137 %Mixer1 that divides mass flow into main flow and turboexpander flow 138 H3 = (1-x)*H2; 139 T3= T2; 140 141 %Turboexpander1 142 %pressure drop from Phigh to Phigh/5.64 143 % suppose the temperature drops by half in turboexpander: 144 %See monoatomic gases on page 664 in Flynn 145 Ht11=x*H2;%enthalpy into turboexpander1 146 Tt11= T2; 147 St11= py.CoolProp.CoolProp.PropsSI( 'S','P',Phigh*1e5, 'T',Tt11, 'Helium ');% inJ/(kg*K) 148 Tt12= Tt11/2; 149 Pt12= Phigh/5.64; 150 ht12= py.CoolProp.CoolProp.PropsSI( 'H','P',Pt12*1e5, 'T',Tt12, 'Helium '); 151 St12= py.CoolProp.CoolProp.PropsSI( 'S','P',Pt12*1e5, 'T',Tt12, 'Helium '); 152 Ct12= Qexp*py.CoolProp.CoolProp.PropsSI( 'C','P',Pt12*1e5, 'T',Tt12, 'Helium ') ;%total heat capacity 153 Ht12= Qexp*ht12; 154 deltah1= H2/Q2- ht12; 155 W1= Ht11- Ht12; 156

41 157 %2ndHE 158 if T14 <=0 159 T14=T3/2; 160 end 161 dH2= Ch2*(T3-T14); 162 H4= H3- dH2; 163 T4= py.CoolProp.CoolProp.PropsSI( 'T','P',Phigh*1e5, 'H',H4/Q4, 'Helium '); 164 165 %3rdHE- three-fluid heat exchanger------166 if T13 <=0 167 T13=T4/2; 168 end 169 %BC for three-fluidHE 170 Tin=[T13; T4; Tt12]; 171 c1prime = 2000;%test values 172 c2prime = 2200; 173 174 %Matrix for three-fluid system 175 A=[c1prime/C13,-c1prime/C13, 0; 176 c1prime/C4, -1/C4*(c1prime+c2prime), c2prime/C4; 177 0, c2prime/Ct12,-c2prime/Ct12]; 178 179 %Eigenvalues ofA 180 [V,D] = eig(A); 181 e= diag(D); 182 183 %Eigenvectors ofA 184 v1=V(:,1); 185 v2=V(:,2); 186 v3=V(:,3); 187 188 %ImposeBC contained in matrixB for three-fluid 189 B=[v1(1)*exp(e(1)*L), v2(1)*exp(e(2)*L), v3(1)*exp(e(3)*L); 190 v1(2)*exp(e(1)*0), v2(2)*exp(e(2)*0), v3(2)*exp(e(3)*0); 191 v1(3)*exp(e(1)*0), v2(3)*exp(e(2)*0), v3(3)*exp(e(3)*0)]; 192 BB= inv(B); 193 C= zeros(3,1); 194 C=BB*Tin;%integration constants 195 196 %Calculate enthalpy transfer from hot flow to cold flows 197 %Enthalpy flow from hot flow to return flow 198 dH31=-c1prime*(C(1)*(v1(2)-v1(1))*(1-exp(e(1)*L))/e(1) + ... 199 C(2)*(v2(2)-v2(1))*(1-exp(e(2)*L))/e(2) +C(3)*(v3(2)-v3(1))*(1-exp(e(3) *L))/e(3)); 200 %Enthalpy flow from hot flow to turboexpander flow 201 dH32=-c2prime*(C(1)*(v1(2)-v1(3))*(1-exp(e(1)*L))/e(1) + ... 202 C(2)*(v2(2)-v2(3))*(1-exp(e(2)*L))/e(2) +C(3)*(v3(2)-v3(3))*(1-exp(e(3) *L))/e(3)); 203 %------204 205 %Enthalpy andT in hot flow after 206 H5= H4- dH31- dH32; 207 T5= py.CoolProp.CoolProp.PropsSI( 'T','P',Phigh*1e5, 'H',H5/Q5, 'Helium '); 208 209 %Turboexpander2 210 %pressure drop from Phigh to Phigh/5.64 211 % suppose the temperature drops by half in turboexpander: 212 %See monoatomic gases on page 664 in Flynn 213 Ht21= Ht12+ dH32;%enthalpy into turboexpander2 after HE3(three-fluid) 214 Tt21= py.CoolProp.CoolProp.PropsSI( 'T','P',Pt12*1e5, 'H',Ht21/Qexp, 'Helium ')

42 ; 215 St21= py.CoolProp.CoolProp.PropsSI( 'S','P',Pt12*1e5, 'T',Tt21, 'Helium '); 216 ht21= py.CoolProp.CoolProp.PropsSI( 'H','P',Pt12*1e5, 'T',Tt21, 'Helium '); 217 Tt22= Tt21/2; 218 Pt22= Pt12/5.64; 219 ht22= py.CoolProp.CoolProp.PropsSI( 'H','P',Pt22*1e5, 'T',Tt22, 'Helium '); 220 St22= py.CoolProp.CoolProp.PropsSI( 'S','P',Pt22*1e5, 'T',Tt22, 'Helium '); 221 deltah2= ht21- ht22; 222 Ht22= Qexp*ht22; 223 W2= Ht21- Ht22; 224 225 %4thHE 226 if T12 <=0 227 T12=T5; 228 end 229 dH4= Ch4*(T5-T12); 230 H6= H5- dH4; 231 T6= py.CoolProp.CoolProp.PropsSI( 'T','P',Phigh*1e5, 'H',H6/Q6, 'Helium '); 232 233 %Purifier 234 H7 = (1-xpur)*H6; 235 T7= T6; 236 237 %5thHE 238 if T10 <=0 239 T10=T7/2; 240 end 241 dH5= Ch5*(T7-T10); 242 H8= H7- dH5; 243 T8= py.CoolProp.CoolProp.PropsSI( 'T','P',Phigh*1e5, 'H',H8/Q8, 'Helium '); 244 245 %JT-valve- isenthalpic process 246 H9= H8; 247 T9= py.CoolProp.CoolProp.PropsSI( 'T','P',Plow*1e5, 'H',H9/Q9, 'Helium '); 248 T10=T9; 249 250 if T9 > 5.1953% stays in gas phase 251 y1=0; y2=0; 252 H10= H9; 253 H11= H10+ dH5; 254 T11= py.CoolProp.CoolProp.PropsSI( 'T','P',Plow*1e5, 'H',H11/Q11, 'Helium '); 255 H12= H11+ Ht22;%from TXP1 and TXP2 256 T12= py.CoolProp.CoolProp.PropsSI( 'T','P',Plow*1e5, 'H',H12/Q12, 'Helium '); 257 H13= H12+ dH4; 258 T13= py.CoolProp.CoolProp.PropsSI( 'T','P',Plow*1e5, 'H',H13/Q13, 'Helium '); 259 H14= H13+ dH31;%from three-fluidHE 260 T14= py.CoolProp.CoolProp.PropsSI( 'T','P',Plow*1e5, 'H',H14/Q14, 'Helium '); 261 H15= H14+ dH2; 262 T15= py.CoolProp.CoolProp.PropsSI( 'T','P',Plow*1e5, 'H',H15/Q15, 'Helium '); 263 H16= H15+ dH11; 264 T16= py.CoolProp.CoolProp.PropsSI( 'T','P',Plow*1e5, 'H',H16/Q16, 'Helium '); 265 deltaH= H1-H16-W1-W2-dH12; 266 deltaQ= Q1- Q16; 267 else% enters liquid phase 268 hliq= py.CoolProp.CoolProp.PropsSI( 'H','T',T9, 'Q' ,0,'Helium ');%specific heat capacity 269 hgas= py.CoolProp.CoolProp.PropsSI( 'H','T',T9, 'Q' ,1,'Helium '); 270 y1=(hgas-H8/Q8)/(hgas-hliq); y1=min(1,max(0,y1));% local withoutHE 271 Hgas= H9- y1*Q9*hliq; 272 %Now gas flows have to be updated for the newy= y1;

43 273 Q10 = (1-y1)*Q9; Q11= Q10; Q12= Q11+x*Q2; Q13= Q12; 274 Q14= Q13; Q15= Q14; Q16= Q15; 275 H10= Hgas; 276 H11= H10+ dH5; 277 T11= py.CoolProp.CoolProp.PropsSI( 'T','P',Plow*1e5, 'H',H11/Q11, 'Helium '); 278 H12= H11+ Ht22;%from TXP1 and TXP2 279 T12= py.CoolProp.CoolProp.PropsSI( 'T','P',Plow*1e5, 'H',H12/Q12, 'Helium '); 280 H13= H12+ dH4; 281 T13= py.CoolProp.CoolProp.PropsSI( 'T','P',Plow*1e5, 'H',H13/Q13, 'Helium '); 282 H14= H13+ dH31;%from three-fluidHE 283 T14= py.CoolProp.CoolProp.PropsSI( 'T','P',Plow*1e5, 'H',H14/Q14, 'Helium '); 284 H15= H14+ dH2; 285 T15= py.CoolProp.CoolProp.PropsSI( 'T','P',Plow*1e5, 'H',H15/Q15, 'Helium '); 286 H16= H15+ dH11; 287 T16= py.CoolProp.CoolProp.PropsSI( 'T','P',Plow*1e5, 'H',H16/Q16, 'Helium '); 288 deltaH= H1-H16-W1-W2-hliq*y1*Q9-dH12;%Check enthalpy conservation 289 deltaQ= Q1- Q16- y1*Q9;%Check mass flow conservation 290 %global yield with HEs and turboexpander, usey forFREIA: 291 y2=(H16/Q16-H1/Q1)/(H16/Q16-hliq)+x*(deltah1+deltah2)/(H16/Q16-hliq)- ... 292 xpur*(1-x)*(H16/Q16-H6/Q6)/(H16/Q16-hliq)+QN2/Q1*deltahN2/(H16/Q16-hliq); y2=min(1,max(0,y2)); 293 end 294 end

11.2 FREIA LN2 Enthalpy Model Tester Script

The MATLAB model tester script below works iteratively together with the function displayed in Section 11.1, using values found in previous iteration i − 1 as input for the next iteration i. The value of local yield y is employed with a moving average, weighting the previous yield yi−1 with a factor 50 and the new yield yi with a factor 1, in order to avoid heavy fluctuations. This can be seen in line 71. The script also calculates S at all points in Figure (15) for the TS diagram in Figure (19).

1 %FREIA_liqefier_test_Elias_enthalpies_LN2.m 2 %Version testing the pre-cooling with LN2 3 clear all; close all; 4 globalx Tt12 Tt21 Tt22%all inletT for HEs 5 6 %Initial start values 7 T5=0; 8 T7=0; 9 T11=0; 10 T10=0; 11 T12=0; 12 T13 =0; 13 T14 = 0; 14 T15 =0; 15 P1=12; 16 Phigh= P1; 17 Plow = 1.12; 18 %InFREIA: 140l/h LHe(with nitrogen cooling), mass density of LHe: 0.125 kg/l 19 %Data from compressor: 41[g/s]= 0.041[kg/s] 20 Q1=0.041;%Say gas flow~ mass flow, so[kg/s]

44 21 T1=300; 22 23 %Simulation steps towards equilibrium, with timer 24 Nstep=200; 25 data=zeros(Nstep,37); 26 y=0.0; 27 tic 28 fork=1:Nstep 29 [y1,y2,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,deltaH,deltaQ,... 30 Q2,Q3,Q4,Q5,Q6,Q7,Q8,Q9,Q10,Q11,Q12,Q13,Q14,Q15,Q16,St11,St12,St21,St22, H8] = ... 31 Freia_liquefier_Elias_enthalpies_LN2(y,Plow,P1,Q1,T1,T5,T7,T10,T11,T12, T13,T14,T15); 32 data(k,1)=y1; 33 data(k,2)=y2; 34 data(k,3)=T2; 35 data(k,4)=T3; 36 data(k,5)=T4; 37 data(k,6)=T5; 38 data(k,7)=T6; 39 data(k,8)=T7; 40 data(k,9)=T8; 41 data(k,10)=T9; 42 data(k,11)=T10; 43 data(k,12)=T11; 44 data(k,13)=T12; 45 data(k,14)=T13; 46 data(k,15)=T14; 47 data(k,16)=T15; 48 data(k,17)=T16; 49 data(k,19)=deltaH; 50 data(k,20)=deltaQ; 51 data(k,21)=Q2; 52 data(k,22)=Q3; 53 data(k,23)=Q4; 54 data(k,24)=Q5; 55 data(k,25)=Q6; 56 data(k,26)=Q7; 57 data(k,27)=Q8; 58 data(k,28)=Q9; 59 data(k,29)=Q10; 60 data(k,30)=Q11; 61 data(k,31)=Q12; 62 data(k,32)=Q13; 63 data(k,33)=Q14; 64 data(k,34)=Q15; 65 data(k,35)=Q16; 66 data(k,36)=St11; 67 data(k,37)=St12; 68 data(k,38)=St21; 69 data(k,39)=St22; 70 %y=y1; 71 y = (50*y+ y1)/51; 72 end 73 toc 74 75 %Plot various quantities 76 k=1:Nstep; 77 T1prim=T1*ones(Nstep,1); 78 figure(1)

45 79 plot(k,data(:,1), 'k- ',k,(1-x)*data(:,1), 'r-- ',k,data(:,2), 'b: '); ylabel( ' Yield '); 80 xlabel( 'Iteration nr '); 81 title( 'FREIA yields: local and global with LN_2 precooling ') 82 legend( 'Local: y_1 ',' Normalized local: (1-x)*y_1 ','Global: y_2 ') 83 grid 84 figure(2) 85 plot(k,data(:,19), 'k',k,data(:,20), 'b'); ylabel( '\DeltaH[J/s],\DeltaQ[kg/ s] '); 86 legend( '\DeltaH ','\DeltaQ ') 87 title( 'Enthalpy and Mass Flow Missing(in vs out) ') 88 xlabel( 'Iteration nr '); 89 grid 90 figure(3) 91 title( ' Temperatures around HEs ') 92 hold on; 93 plot(k,data(:,3), 'k'); 94 plot(k,data(:,5), 'r'); 95 plot(k,data(:,6), 'b'); 96 plot(k,data(:,8), 'c'); 97 plot(k,data(:,9), 'y'); 98 plot(k,data(:,10), 'k: '); 99 plot(k,data(:,11), 'k-- '); 100 plot(k,data(:,16), 'b-- ') 101 ylabel( 'T[K] '); 102 xlabel( 'Iteration nr '); 103 grid 104 legend( 'T_2 ','T_4 ','T_5 ','T_7 ','T_8 ','T_{10} ','T_{11} ','T_{16} ') 105 hold off; 106 107 108 %Plot temperature profile of system at each point 109 points = [1:8 8.499 8.511 9 9.499 9.511 10:20];%11 points+2 points around eachTXP, with step atJT andPS 110 pointsprime = [1:8 8.499 8.511 9 9.499 9.511 10:16];%profile of He path 111 TXPpoints = 17:20;%profile for TXP1 and TXP2 112 Tdata= zeros(1,24); 113 Tdata(1) = T1; 114 fori=2:8 115 Tdata(i) = data(end,i+1); 116 end 117 %We want step drop inJT 118 Tdata(9) = Tdata(8);%partIJT 119 fori=10:14 120 Tdata(i) = data(end,10);%partIIJT and wholePS= T9 121 end 122 fori=15:20 123 Tdata(i) = data(end,i-3);%rest of main path 124 end 125 %TXP1 and TXP2 Temperatures: Tt11= T2 126 Tdata(21) = Tdata(2); 127 Tdata(22) = Tt12; 128 Tdata(23) = Tt21; 129 Tdata(24) = Tt22; 130 Tdataprime= zeros(1,20); 131 fori = 1:20 132 Tdataprime(i) = Tdata(i); 133 end 134 TXPtdata= zeros(1,4); 135 fori=1:4

46 136 TXPtdata(i) = Tdata(20+i); 137 end 138 %Gas flow data 139 Qdata= zeros(1,16); 140 QdataTXP= zeros(1,4); 141 Qdata(1) = Q1; 142 fori=2:8 143 Qdata(i) = data(end,19+i); 144 end 145 fori=9:12 146 Qdata(i) = data(end,27);%gas flow Q8=Q9 half-way into phase separator 147 end 148 Qdata(13) = data(end,29);%gas flow after liquied is poured out 149 fori=14:20 150 Qdata(i) = data(end,i+15); 151 end 152 fori=1:4 153 QdataTXP(i) =x*Q2; 154 end 155 156 %Plot temperature profile with objects 157 %use"uisetcolor" in command window for color code 158 figure(4) 159 subplot(2,1,1) 160 title( ' Temperature and Gas Flow Profile:FREIA with LN_2 precooling ') 161 hold on 162 axis([0.5 16.5 0 T1+1]) 163 %HE1 164 rectangle( 'Position ' ,[1 Tdata(2) 1 abs(Tdata(1)-Tdata(2))], ... 165 'FaceColor ' ,[1, 0.41, 0.31], 'LineStyle ','none '); 166 text(1.00, Tdata(2)-7.8, 'CX1 ','FontSize ' ,9); 167 rectangle( 'Position ' ,[15 Tdata(19) 1 abs(Tdata(20)-Tdata(19))], ... 168 'FaceColor ' ,[1, 0.41, 0.31], 'LineStyle ','none '); 169 text(15.00, Tdata(19)-5.8, 'CX1 ','FontSize ' ,9); 170 %HE2 171 rectangle( 'Position ' ,[3 Tdata(4) 1 abs(Tdata(4)-Tdata(3))], ... 172 'FaceColor ' ,[1, 0.41, 0.31], 'LineStyle ','none '); 173 text(3.00, Tdata(3)+16.8, 'CX2 ','FontSize ' ,9); 174 rectangle( 'Position ' ,[14 Tdata(18) 1 abs(Tdata(18)-Tdata(19))], ... 175 'FaceColor ' ,[1, 0.41, 0.31], 'LineStyle ','none '); 176 text(14.00-0.1, Tdata(19)+7.8, 'CX2 ','FontSize ' ,9); 177 %HE3 178 rectangle( 'Position ' ,[4 Tdata(5) 1 abs(Tdata(5)-Tdata(4))], ... 179 'FaceColor ' ,[1, 0.41, 0.31], 'LineStyle ','none '); 180 text(4.00-0.15, Tdata(5)-2.8, 'CX3 ','FontSize ' ,9); 181 rectangle( 'Position ' ,[13 Tdata(17) 1 abs(Tdata(18)-Tdata(17))], ... 182 'FaceColor ' ,[1, 0.41, 0.31], 'LineStyle ','none '); 183 text(13.00, Tdata(17)-1.9, 'CX3 ','FontSize ' ,9); 184 %HE4 185 rectangle( 'Position ' ,[5 Tdata(6) 1 abs(Tdata(5)-Tdata(6))], ... 186 'FaceColor ' ,[1, 0.41, 0.31], 'LineStyle ','none '); 187 text(5.00+0.1, Tdata(5)+3.8, 'CX4 ','FontSize ' ,9); 188 rectangle( 'Position ' ,[12 Tdata(16) 1 abs(Tdata(16)-Tdata(17))], ... 189 'FaceColor ' ,[1, 0.41, 0.31], 'LineStyle ','none '); 190 text(12.00-0.1, Tdata(17)+3.8, 'CX4 ','FontSize ' ,9); 191 %HE5 192 rectangle( 'Position ' ,[7 Tdata(8) 1 abs(Tdata(8)-Tdata(7))], ... 193 'FaceColor ' ,[1, 0.41, 0.31], 'LineStyle ','none '); 194 text(7.00, Tdata(7)+3.8, 'CX5 ','FontSize ' ,9); 195 rectangle( 'Position ' ,[10 Tdata(14) 1 abs(Tdata(15)-Tdata(14))], ...

47 196 'FaceColor ' ,[1, 0.41, 0.31], 'LineStyle ','none '); 197 text(10.00, Tdata(15)+3.8, 'CX5 ','FontSize ' ,9); 198 %JT Valve 199 rectangle( 'Position ' ,[8 Tdata(10) 1 abs(Tdata(10)-Tdata(9))], ... 200 'FaceColor ' ,[0.15,0.8,0.01], 'LineStyle ','none '); 201 text(8.33, Tdata(9)+1.8, 'JT ','FontSize ' ,9); 202 %Phase separator 203 rectangle( 'Position ' ,[9 Tdata(11)-1 1 2], ... 204 'FaceColor ' ,[0 ,1 ,1] , 'LineStyle ','none '); 205 %text(8.33, Tdata(5)+0.8, 'JT ',' FontSize ' ,9); 206 %Mixer 207 rectangle( 'Position ' ,[2.5 -0.15 Tdata(3)-5.15 0.3 10.3], ... 208 'FaceColor ','b','LineStyle ','none '); 209 xline(2.5, 'k-- '); 210 rectangle( 'Position ' ,[11.5-0.15 (Tdata(15)+Tdata(16))/2-1.35 0.3 2.7], ... 211 'FaceColor ','b','LineStyle ','none '); 212 xline(11.5, 'k-- '); 213 214 %TXP1 and TXP2 215 xline(16.5, 'k'); 216 xline(17, 'k-- '); 217 xline(20, 'k-- '); 218 rectangle( 'Position ' ,[17 Tdata(22) 1 abs(Tdata(22)-Tdata(21))], ... 219 'FaceColor ','g','LineStyle ','none '); 220 text(17.00, Tdata(21)+15.8, 'TXP1 ','FontSize ' ,9); 221 %Connected to CX3: 222 rectangle( 'Position ' ,[18 Tdata(23) 1 abs(Tdata(22)-Tdata(23))], ... 223 'FaceColor ' ,[1, 0.41, 0.31], 'LineStyle ','none '); 224 text(18.00+0.05, Tdata(4)+9.8, 'CX3 ','FontSize ' ,9); 225 %TXP2 226 rectangle( 'Position ' ,[19 Tdata(24) 1 abs(Tdata(24)-Tdata(23))], ... 227 'FaceColor ','g','LineStyle ','none '); 228 text(19.00, Tdata(23)+5.8, 'TXP2 ','FontSize ' ,9); 229 %Plot theT data of gas flow in main loop and turboexpanders 230 plot(pointsprime,Tdataprime, 'k'); 231 plot(TXPpoints,[Tdata(21) Tdata(22) Tdata(23) Tdata(24)], 'k'); 232 axis([0.5 20.5 3.0 310]); 233 xticks([1:20]); 234 grid minor; 235 yticks([4.4 7.5 15 25 50 100 200]); 236 ylabel( 'T[K] ') 237 set(gca, 'YScale ', 'log '); 238 hold off 239 subplot(2,1,2) 240 hold on; 241 plot(pointsprime,Qdata, 'b'); 242 plot(TXPpoints,QdataTXP, 'b'); 243 axis([0.5 20.5 0.001 0.045]); 244 text(4.15, 0.023, sprintf( 'Outgoing liquid flow y_2*Q_1=\n %6.2g[g/s] ' ,1000*y2*Q1), 'FontSize ' ,9); 245 ylabel( 'Q[kg/s] ') 246 xlabel( 'Cycle Point ') 247 grid minor; 248 xticks([1:20]); 249 xlim([0.5 20.5]) 250 xline(2.5, 'k-- '); 251 xline(11.5, 'k-- '); 252 xline(16.5, 'k'); 253 xline(17, 'k-- '); 254 xline(20, 'k-- ');

48 255 hold off; 256 257 %Entropy data 258 Tmain= zeros(1,16); 259 Tmain(1) = T1; 260 fori=2:16 261 Tmain(i) = data(end,i+1); 262 end 263 Tmain1= Tmain(1:8); 264 Tmain2=[Tmain(9:end) Tmain(1)]; 265 %Calculate entropies from lastT-values: 266 S1= py.CoolProp.CoolProp.PropsSI( 'S','P',Phigh*1e5, 'T',T1, 'Helium ');%J/(kg *K) 267 S2= py.CoolProp.CoolProp.PropsSI( 'S','P',Phigh*1e5, 'T',T2, 'Helium '); 268 S3= py.CoolProp.CoolProp.PropsSI( 'S','P',Phigh*1e5, 'T',T3, 'Helium '); 269 S4= py.CoolProp.CoolProp.PropsSI( 'S','P',Phigh*1e5, 'T',T4, 'Helium '); 270 S5= py.CoolProp.CoolProp.PropsSI( 'S','P',Phigh*1e5, 'T',T5, 'Helium '); 271 S6= py.CoolProp.CoolProp.PropsSI( 'S','P',Phigh*1e5, 'T',T6, 'Helium '); 272 S7= py.CoolProp.CoolProp.PropsSI( 'S','P',Phigh*1e5, 'T',T7, 'Helium '); 273 S8= py.CoolProp.CoolProp.PropsSI( 'S','P',Phigh*1e5, 'T',T8, 'Helium '); 274 S9= py.CoolProp.CoolProp.PropsSI( 'S','T',T9, 'Q' ,1,'Helium '); 275 Sf= py.CoolProp.CoolProp.PropsSI( 'S','T',T9, 'Q' ,0,'Helium '); 276 S10= py.CoolProp.CoolProp.PropsSI( 'S','T',T10, 'Q' ,1,'Helium '); 277 S11= py.CoolProp.CoolProp.PropsSI( 'S','P',Plow*1e5, 'T',T11, 'Helium '); 278 S12= py.CoolProp.CoolProp.PropsSI( 'S','P',Plow*1e5, 'T',T12, 'Helium '); 279 S13= py.CoolProp.CoolProp.PropsSI( 'S','P',Plow*1e5, 'T',T13, 'Helium '); 280 S14= py.CoolProp.CoolProp.PropsSI( 'S','P',Plow*1e5, 'T',T14, 'Helium '); 281 S15= py.CoolProp.CoolProp.PropsSI( 'S','P',Plow*1e5, 'T',T15, 'Helium '); 282 S16= py.CoolProp.CoolProp.PropsSI( 'S','P',Plow*1e5, 'T',T16, 'Helium '); 283 Smain1=[S1 S2 S3 S4 S5 S6 S7 S8]; 284 Smain2=[S9 S10 S11 S12 S13 S14 S15 S16 S1]; 285 Smain=[Smain1 Smain2]; 286 Stxp1=[St11 St12 St21]; 287 Stxp2=[St21 St22 S12]; 288 %Saturation dome: in range [2.0768K, 5.1953K] 289 Tsat = [2.08:0.01:5.19]; 290 Ssat1= zeros(1,length(Tsat)); 291 Ssat2= zeros(1,length(Tsat)); 292 fori=1:length(Tsat) 293 Ssat1(i) = py.CoolProp.CoolProp.PropsSI( 'S','T',Tsat(i), 'Q' ,0,'Helium '); 294 Ssat2(i) = py.CoolProp.CoolProp.PropsSI( 'S','T',Tsat(i), 'Q' ,1,'Helium '); 295 end 296 Svap=[Sf:Smain(9)]; 297 Tvap= Tmain(9)*ones(1,length(Svap)); 298 %JT-valve, isentalpic. We go from Phigh to Plow 299 Ptrans=[Plow:0.05:Phigh]; 300 Tjt= zeros(0,length(Ptrans)); 301 Sjt= zeros(0,length(Ptrans)); 302 fori=1:length(Ptrans) 303 %If-loop to handle values around saturation line,P may need to be djusted manually 304 if Ptrans(length(Ptrans)-i+1) < 2.272 305 Sjt(i) = py.CoolProp.CoolProp.PropsSI( 'S','P',Ptrans(length( Ptrans)-i+1)*1e5, 'Q' ,1,'Helium '); 306 Tjt(i) = py.CoolProp.CoolProp.PropsSI( 'T','P',Ptrans(length( Ptrans)-i+1)*1e5, 'Q' ,1,'Helium '); 307 else 308 Tjt(i) = py.CoolProp.CoolProp.PropsSI( 'T','P',Ptrans(length( Ptrans)-i+1)*1e5, 'H',H8/Q8, 'Helium '); 309 Sjt(i) = py.CoolProp.CoolProp.PropsSI( 'S','P',Ptrans(length(

49 Ptrans)-i+1)*1e5, 'T',Tjt(i), 'Helium '); 310 end 311 end 312 figure(5) 313 hold on; 314 plot(Smain1,Tmain1, 'b*- ',Stxp1,[Tdata(21) Tdata(22) Tdata(23)], 'k*-- ',Stxp2, [Tdata(23) Tdata(24) Tmain(12)], 'rd-. '); 315 plot(Ssat1,Tsat, 'r: ',Ssat2,Tsat, 'r: ') 316 plot(Sjt,Tjt, 'b- ') 317 plot(Sf,T9, 'b* ') 318 plot(Smain2,Tmain2, 'b*- ') 319 plot(Svap,Tvap, 'b- ') 320 text(Smain(1)-10, Tmain(1)-40.1, '1','FontSize ' ,10); 321 text(Smain(2)-1000, Tmain(2)+9.1, '2','FontSize ' ,10); 322 text(Smain(4)-1000, Tmain(4)+3.1, '4','FontSize ' ,10); 323 text(Smain(5)-1000, Tmain(5)+1.5, '5','FontSize ' ,10); 324 text(Smain(7)-1000, Tmain(7), '7','FontSize ' ,10); 325 text(Smain(8), Tmain(8)+1.1, '8','FontSize ' ,10); 326 text(Smain(9)+700, Tmain(9), '9: Gas ','FontSize ' ,9); 327 text(Sf, Tmain(9)-0.45, '9: Liquid ','FontSize ' ,9); 328 text(Smain(11)-500, Tmain(11)+1.4, '11 ','FontSize ' ,10); 329 text(Smain(12)-1500, Tmain(11)-0.12, '12 ','FontSize ' ,10); 330 text(Smain(13)+500, Tmain(13)-0.5, '13 ','FontSize ' ,10); 331 text(Smain(14)+400, Tmain(14)-1.1, '14 ','FontSize ' ,10); 332 text(Smain(15)-1200, Tmain(15)+6.1, '15 ','FontSize ' ,10); 333 text(Smain(16)-500, Tmain(16)-40.1, '16 ','FontSize ' ,10); 334 %Mixer2 inTS diagram 335 rectangle( 'Position ' ,[(Smain(12)+Stxp2(2))/2-250 Tmain(12)-0.75 500 1.1], ... 336 'FaceColor ','b','LineStyle ','none '); 337 text((Smain(12)+Stxp2(2))/2-750, Tmain(12)-1.45, 'Mixer2 ','FontSize ' ,8); 338 %HE3 inTS diagram 339 rectangle( 'Position ' ,[(Stxp1(2)+4*Stxp1(3))/5 abs(Tdata(23)*3+Tdata(22))/4 1500 abs(Tdata(23)-Tdata(22))/3], ... 340 'FaceColor ' ,[1, 0.41, 0.31], 'LineStyle ','none '); 341 text((Stxp1(2)+4*Stxp1(3))/5, abs(Tdata(23)*3+Tdata(22))/4+6, 'CX3 ',' FontSize ' ,8); 342 set(gca, 'YScale ', 'log '); 343 legend( 'Main cycle path ','TXP1 ','TXP2 ',' Saturation Dome ','Location ','Best ') 344 yticks([4.4 7.5 15 25 50 100 200]); 345 axis([-100 3e4 3.0 310]); 346 title( 'Entropy and Temperatures in theFREIA Cycle ') 347 ylabel( 'T[K] ') 348 xlabel( 'S[J/K] ') 349 grid 350 hold off; 351 352 %Entropy differences over expanders 353 fprintf( 'Deltas=%dJ/K for TXP1\nDeltas=%dJ/K for TXP2\n ',St12-St11, St22-St21)

50