<<

Application of a Model by Van-der-Waals for a Hydrogen Tank Filling Process

Application of a Real Gas Model by Van-der-Waals for a Hydrogen Tank Filling ApplicationProcess of a Real Gas Model by van der Waals for a Hydrogen Kormann, Maximilian and Krüger, ImkeTank Lisa Filling Process

665 Maximilian Kormann1 Imke Lisa Krüger2

1Dassault Systèmes, Germany, [email protected] 2Dassault Systèmes, Germany, [email protected]

Abstract should take less than 200 s for 5 kilogram (US DOE et al., 2009). For safety reasons, the inside the tank Hydrogen fuel tanks operate at high system lev- may not exceed 85 ◦C. els. In these regions effects occur, which cannot be han- Due to its small molecules, hydrogen shows a dif- dled by an model. One of these is the Joule- ferent behavior when compressed or expanded than e.g. Thomson effect. It describes an adiabatic throttling with- air. When air is expanded isenthalpic, temperature sinks out change in , but a change in temperature. The where as for hydrogen the temperature rises. This is due tank filling process can be simplified to a throttling valve, to the different signs of the Joule-Thomson coefficient, so the effect is of interest. In this investigation the van der that describes the temperature evolution during a pressure Waals equations are implemented in a real gas model for change. the Hydrogen Library and the Pneumatic Systems Library To design the tank filling processes and identify cooling (PSL) by Dassault Systèmes and the model is applied to needs during the injection, system simulation is the best a hydrogen tank filling process. Performance and accu- way. We will demonstrate in this paper that the van der racy are compared to the CoolProp fluid properties library, Waals approach can be used for hydrogen to evaluate tank which is imported with the ExternalMedia library. filling processes at an early stage of development. Keywords: Hydrogen, Pneumatic Systems Library, Tank Filling Process, Medium Models, Real Gas, van der 2 Thermodynamic background Waals, Joule-Thomson-Effect, CoolProp To describe the temperature change at an adiabatic throt- 1 Introduction tling some thermodynamic basics have to be given. 2.1 Ideal Gas The calculation of thermodynamic properties plays an im- portant role in simulating thermohydraulic systems. The The ideal gas model assumes the fluid to consist of dimen- specific behaviour we want to study as well as the pressure sionless particles which can move freely in the given vol- and temperature range define the exactness needed of the ume until they hit another particle or the wall. The thermal medium properties model. The ideal gas approach is only between the pressure p and temperature valid for low , complex approaches that cover the T is defined according to (Adkins, 1983; Tschoegl, 1983) liquid as well slow down the simulation speed. with the specific gas constant R: The van der Waals model gives a simplified analytical approach and it assumes the deviation to be acceptable for RT = pv (1) e.g. early stages of design or if only the qualitative be- and the specific havior should be shown. The Joule-Thomson effect that is to be examined in this paper can be analytically modeled V 1 v = = (2) and studied with the van der Waals approach. It results in m ρ simple equations for e.g. the internal pressure. The model has been implemented for the Hydrogen and 2.2 Real gas equation by van der Waals Pneumatic Systems Library by Dassault Systèmes. New gases can be easily added, the only parameters needed are The ideal gas model lacks two effects: Interactive forces the molar mass of the gas, the critical pressure and temper- between the fluid molecules and their dimension. For the ature, the sutherland constants and the table-based specific first effect, the pressure in the van der Waals model (der . Waals, 1967) is increased by the internal pressure of the gas. The influence of the dimension of the molecules is A recent application where this effect occurs is the hy- considered by reducing the specific volume by the volume drogen tank filling processes for fuel cell vehicles. Hy- of the fluid molecules: drogen has to be stored at high pressures e.g. 200 bar due  a  to the low energy density at low pressures. In order to RT = p + (v − b) (3) be competitive to conventionally fueled cars, tank filling v2

DOI Proceedings of the 13th International Modelica Conference 665 10.3384/ecp19157665 March 4-6, 2019, Regensburg, Germany Application of a Real Gas Model by Van-der-Waals for a Hydrogen Tank Filling Process

The two new parameters can be derived from the critical 2.4 Caloric equation of state state of the fluid (Weigand et al., 2008). The internal pres- sure is defined using the cohension pressure parameter: Assuming a constant amount of mass the total differential of the internal energy is (Weigand et al., 2008): 27(RT )2 a = c (4) 64pc  δu  δu du = dT + dv = cvdT + πT dv (16) The volume occupied by the molecules can be written di- δT v δv T rectly:

RTc For an ideal gas, the internal pressure is zero and thus the b = (5) 8pc internal energy only depends on the temperature with the specific capacity at constant volume c . 2.3 Internal Pressure v The internal pressure of a fluid is defined as the partial 2.5 Specific Enthalpy derivation of the specific internal energy u by the specific volume at constant temperature (Moore, 1986): The enthalpy describes the energy of a system. The en- thalpy can only change when energy is transferred over   δu the system border. The specific enthalpy of a fluid is de- πT = (6) δv T fined as (Weigand et al., 2008): It can be derived from the fundamental thermodynamic relation with the specific s under assumption of h = u + pv (17) a constant amount of mass (Callen, 1985) by deriving the internal energy partially by the volume at constant temper- For an ideal gas the expression simplifies to ature:

du = Tds − pdv (7) h = u + RT (18) δu  δs  = T − p (8) δv T δv T As described according to equation (16), for an ideal gas With the Maxwell-Relation (Weigand et al., 2008) the internal energy only depends on the temperature. In this case, also the enthalpy only depends on the inner en-  δs   δ p  = (9) ergy. This is not the case for a real gas. δv T δT v the expression for the internal pressure becomes: 2.6 The Joule-Thomson effect     δu δ p When a gas is expanded from a high pressure over an isen- πT = = T − p (10) δv T δT v thalpic valve, a change in temperature can be observed. For an ideal gas we get from equation (1): This behaviour cannot be described by an ideal gas model as it does not model a pressure dependency of the specific  δ p  R = (11) enthalpy as mentioned in section 2.5. The effect is de- δT v v scribed by the Joule-Thomson coefficient (Greiner et al.,  δ p  R 1993): πT = T − p = T − p = 0 (12) δT v v δT  As the ideal gas equation does not model forces between µJT = (19) the fluid molecules except elastic collisions, the internal δ p h pressure is zero. Thus the Joule-Thomson effect cannot be covered by an . In the real gas equation the To derive its equation, the total differential of the spe- van der Waals forces between the molecules are covered cific entropy under assumption of a constant amount of by the internal pressure term. From equation (3) we get: mass will be set into the fundamental thermodynamic re-  δ p  R lation from equation (7). It reduces the dependency of the = (13) change in enthalpy to pressure and temperature: δT v v − b   δ p R     πT = T − p = T − p (14) δs δs δT v v − b ds = dT + dp (20) δT p δ p T R  RT a  a = T − − = (15) dh = du + pdv + vdp (21) v − b v − b v2 v2  δs   δs  The internal pressure for a real gas modeled with the van dh = T dT + T dp +Vdp (22) der Waals equation is always positive. δT p δ p T

666 Proceedings of the 13th International Modelica Conference DOI March 4-6, 2019, Regensburg, Germany 10.3384/ecp19157665 Application of a Real Gas Model by Van-der-Waals for a Hydrogen Tank Filling Process

With the definition of the specific at con- As there is no easy-to-handle analytical expression for stant pressure cp and the Maxwell-Relation for the Gibbs cv and to avoid the use of polynomials, the temperature- energy we get: dependent part of the specific internal energy and the inter- nal pressure correction of the reference point (marked with  δs  an under-brace in equation (31)) is provided as a table- T = cp (23) δT p interpolation uT (T). Then we get the following equation for the specific enthalpy:  δs   δv  = − (24) δ p T δT p a h = uT (T) + pv + (33)  δv  v dh = cpdT − T dp +Vdp (25) δT p 3.3 Parametrization Now we can set dh = 0 and rearrange: Compared to ideal gas models, the additional parameters for creating a new gas model are pressure and temperature ! δT  1  δv  in the critical state as well as the tables for the specific = = T − v µJT (26) internal energy and heat capacity (see table1). As the δ p H cp δT p specific heat capacity is described by a look-up-table, the For v >> b and v >> a/RT the real gas equation (3) can degrees of freedom are no longer necessary for the van der be rewritten and solved by v (Greiner et al., 1993): Waals Real Gas Model. Table 1. Required parameters for the gas models. RT  b a abp  p = 1 + − + 2 2 (27) v v vRT vR T Gas model Ideal Real RT a abp v = + b − + (28) •• p RT R2T 2 Molar mass Dynamic viscosity at ref. point •• Then the inner differential from equation (26) can be for- Viscosity ref. point temperature •• mulated and put into the equation of the Joule-Thomson Sutherland constant •• coefficient: Degrees of freedom • Critical pressure •  δv  R a abp Critical temperature • = + − 2 (29) 2 2 3 Temperature table • δT p p RT R T Specific internal energy table • 1  2a abp  Specific heat capacity table • µJT = − b − 3 2 2 (30) cp RT R T

3 Implementation as a real gas model 4 Benchmark of the van der Waals The equations from section 2.2 and 2.4 are introduced as model an additional fluid model in the Hydrogen Library and the Pneumatic Systems Library (PSL). The dynamic viscosity To determine a range for the validity of the gas model, it is estimated by the law of (Sutherland, 1893). will be compared to generated values by the CoolProp li- brary (Bell et al., 2014) for pure Hydrogen gas. The open 3.1 Density source C++ library CoolProp provides equations of state The density is estimated according to the real gas model and transport properties for pure fluids and mixtures. The by van der Waals from equation (3). relative deviations of results for various fluid properties of hydrogen compared to the NIST Reference Fluid Ther- 3.2 Specific Enthalpy modynamic and Transport Properties Database (Lemmon To get a non-differential formulation of the specific en- et al., 2010) are in the range of 1 × 10−4 to 1 × 10−14. thalpy, equation (16) has to be integrated from a reference The CoolProp library is interfaced with the help of the Ex- point indicated by a subscript 0 and put into equation (17): ternalMedia library (Casella and Richter, 2008). The Ex- ternalMedia provides medium packages that can be used Z T Z v directly in the Pneumatic Systems Library and in the Hy- h = cvdT + πT dv + pv (31) T0 v0 drogen library. Z T a a h = cvdT − + + pv (32) 4.1 Density of hydrogen T0 v0 v | {z } In the following, the influence of the gas model on the uT (T) density will be outlined in the case of hydrogen.

DOI Proceedings of the 13th International Modelica Conference 667 10.3384/ecp19157665 March 4-6, 2019, Regensburg, Germany Application of a Real Gas Model by Van-der-Waals for a Hydrogen Tank Filling Process

300 4.2 Density of air 1.4 Though air is a mixture of several gases, it still can be 250 1.3 modeled by the van der Waals real gas approach. As stated 1.2 in section 2.5, only the critical state of the fluid has to be 200 known. This can be measured for air. Again, the density 1.1 of the gas model will be compared to the CoolProp library. CoolP rop

150 1.0 /ρ 300 0.9 1.4 Pressure [bar]

100 IdealGas 0.8 ρ 250 1.3

50 0.7 1.2 200 1.1 Critical Point 0.6 CoolP rop 50 100 150 200 250 300 350 400 150 1.0 /ρ Temperature [K] 0.9 Pressure [bar] Figure 1. Comparison of the density between the ideal gas 100 IdealGas ρ model and the CoolProp model for hydrogen. 0.8 50 0.7 Critical Point 0.6 The ideal gas model has a quite small range of valid- ity: To keep the error in the density below 5%, the pres- 50 100 150 200 250 300 350 400 Temperature [K] sure has to be below 50bar and the temperature has to be above 100K (see Figure1). As discussed in section 2.3, Figure 3. Comparison of the density between the ideal gas the Joule-Thomson effect can not be covered by the ideal model and the CoolProp model for air. gas law, as it does not consider intermolecular forces. The ideal gas model has quite small range of validity: To keep the error in the density below 5%, the pressure has 300 1.4 to be below 150bar and the temperature has to be above 250K (see Figure3). 250 1.3

1.2 300 1.4 200 1.1 250 1.3 CoolP rop

150 1.0 /ρ 1.2 0.9 200

Pressure [bar] 1.1 100 RealGas ρ 0.8 CoolP rop

150 1.0 /ρ 50 0.7 0.9 Pressure [bar] 100 RealGas Critical Point 0.6 ρ 0.8 50 100 150 200 250 300 350 400 Temperature [K] 50 0.7 Critical Point Figure 2. Comparison of the density between the van der Waals 0.6 gas model and the CoolProp model for hydrogen. 50 100 150 200 250 300 350 400 Temperature [K]

The van der Waals model has a much wider range of Figure 4. Comparison of the density between the van der Waals validity (see Figure2). Pressures up to 200bar and tem- gas model and the CoolProp model for air. peratures above 100K can be covered with an error in the density below 5%. For the same pressure and temperature The van der Waals air model has a slightly wider range the error is smaller than for the ideal gas model. Besides of validity (see Figure4). Pressures up to 200bar and tem- the wider range of application, the Joule-Thomson effect peratures above 170K can be covered with an error in the can be covered by the van der Waals air model, as dis- density below 5%. The benefit in application range by cussed in section 2.3. using the van der Waals model for air is smaller than for

668 Proceedings of the 13th International Modelica Conference DOI March 4-6, 2019, Regensburg, Germany 10.3384/ecp19157665 Application of a Real Gas Model by Van-der-Waals for a Hydrogen Tank Filling Process

hydrogen. Still low can be handled with a higher precision and the Joule-Thomson effect is covered. step PI tank 4.3 Joule-Thomson coefficient PI hydrogenSettings V=0.43 m³ In section 2.6 an analytic formulation for the Joule- startTime=1 s Thomson coefficient has been derived in equation (30). It m will be compared to the direct derivative of the enthalpy p,T massFlowSensor valve calculated in the PSL according to equation (19) for hy- hydrogenOutlet drogen: temp_der_T = der(gas.temperature, p); mu_jt_modelica = temp_der_T(p=p,h=h); Figure 6. Dymola model to simulate a tank filling process for mu_jt_analytical = 1 / hydrogen. gas.specificHeatCapacityAtConstantPressure (p=p,T=T) * ( 2 * gas.a / gas.R / T - gas.b - 3 * a * b * p / R^2 / T^2 ); (Modelica.Media.IdealGases.SingleGases.H2) strongly underestimates the maximum temperature as it only takes into account the temperature rise due to 2E-7 mu_jt_modelica // 1 bar translational from the pressure step at the inlet of the mu_jt_modelica // 50 bar tank. Both the CoolProp and the van der Waals Real Gas 0E0 mu_jt_modelica // 100 bar Model consider the additional temperature rise due to the mu_jt_modelica // 200 bar -2E-7 Joule-Thomson effect, while it is slightly overestimated mu_jt_analytical // 1 bar by the van der Waals Real Gas Model. In the use-case mu_jt_analytical // 50 bar -4E-7 mu_jt_analytical // 100 bar of the tank filling process the safer approach is to use mu_jt_analytical // 200 bar a model overestimating the temperatures, so the safety -6E-7 margin to the temperature limitation is increased.

-8E-7 300 400 1000 1100 100 T[K] 80 Figure 5. Analytical and Numerical Joule-Thomson coefficient for hydrogen. 60

The result for different pressures over the logarithmic 40 real_gas.tank.medium.T [°C] scaled temperature is shown in Figure5. For ambient pres- T [°C] coolprop.tank.medium.T [°C] sure both definitions show the same behaviour. For higher 20 pressures the assumption v >> b from equation (27) can- ideal_gas.tank.medium.T [°C] not be met anymore and the analytical description of µJT 0 recedes from the numerical derivative formulated in the 0 100 200 300 400 PSL. t [s]

5 Applications Figure 7. Results of the tank filling process simulation. 5.1 Hydrogen fuel tank To simulate the filling process of a hydrogen tank a simpli- 5.3 Performance fied model utilizing the Hydrogen Library as in Figure6 To compare the performance of the van der Waals gas is used. The fluid part consists of a pressure source at model, the fuel tank experiment has been conducted using 200bar, a variable orifice and a reservoir with a heat con- the Hydrogen Library ideal and van der Waals gas model nection to the environment. The mass flow rate should be as well as the CoolProp Library with the ExternalMedia kept constant over the filling process, so a PI controller is interface (Casella and Richter, 2008). The results are sum- used to set the valve opening. To restrict the maximum marized in table2. temperature in the tank during the filling process, the hy- drogen gas from the pressure source is assumed to be pre- Table 2. Results of the performance test. cooled at −10 ◦C. Fluid model Simulation time 5.2 Results Ideal gas model / Hydrogen 0.2 s The temperature in the tank during filling pro- van der Waals model / Hydrogen 1.06 s cess is plotted in Figure7 for different hy- CoolProp lib. / ExternalMedia 4.18 s drogen media models. The ideal gas model

DOI Proceedings of the 13th International Modelica Conference 669 10.3384/ecp19157665 March 4-6, 2019, Regensburg, Germany Application of a Real Gas Model by Van-der-Waals for a Hydrogen Tank Filling Process

The van der Waals model has a significant performance the internal energy. A van der Waals model can be easily advantage against the ExternalMedia approach at the cost adapted to different gases as the formulation only requires of lower accuracy. pressure and temperature at the critical state, the molar mass and a table for the temperature-dependent part of the 5.4 Excursus: Experiment of Gay-Lussac internal energy. The experiment of Gay-Lussac was conducted in 1807 and repeated by (Joule, 1845). A volume with a high pressure References ◦ at 22bar and environment temperature of 20 C is con- C. J. Adkins. Equilibrium Thermodynamics (3rd ed.). Cam- nected to an evacuated volume and the gas flows until both bridge University Press, Cambridge, UK, 1983. ISBN 0-521- pressures are equal. After reaching thermodynamic equi- 25445-0. librium, the same temperature as the start temperature was measured in both volumes. With the measurement accu- Ian H. Bell, Jorrit Wronski, Sylvain Quoilin, and Vincent Lemort. Pure and pseudo-pure fluid thermophysical prop- racy of that time the ideal gas law was proven. The model erty evaluation and the open-source thermophysical prop- shown in figure8 is an example model of the PSL. The two erty library coolprop. Industrial & Engineering Chemistry volumes are modeled as spheric tanks with a heat transfer Research, 53(6):2498–2508, 2014. doi:10.1021/ie4033999. connection. Between the pneumatic ports of the volumes URL http://pubs.acs.org/doi/abs/10.1021/ a V22 valve prevents air flow. After one second the valve ie4033999. opens and gas flows until the equilibrium is reached. H. B. Callen. Thermodynamics and an Introduction to Ther- mostatistics. John Wiley & Sons, New York, 1985. ISBN 978-0471862567. booleanStep Francesco Casella and Christoph Richter. Externalmedia: A li- brary for easy re-use of external fluid property code in mod- V V elica. Proceedings of 6th International Modelica Conference, pages 157–161, 2008. 1 s J. D. Van der Waals. The equation of state for gases and liquids. Nobel Lectures, Physics 1901-1921, pages 254–265, 1967. P A Walter Greiner, Ludwig Neise, and Horst Stöcker. Thermo- dynamik und statistische Mechanik. Verlag Harri Deutsch, Figure 8. Dymola model to simulate the experiment of Gay- Frankfurt am Main, 1993. ISBN 978-3808557082. Lussac. J.P. Joule. Liv. on the changes of temperature produced by the rarefaction and condensation of air. The London, Edinburgh, With more accurate measurement it was found that and Dublin Philosophical Magazine and Journal of Science, the temperature after reaching thermodynamic equilib- 26(174):369–383, 1845. doi:10.1080/14786444508645153. rium was 3 K below the initial temperature. As the exper- iment did not allow any change in enthalpy, this behavior Eric W. Lemmon, M. L. Huber, and M. O. McLinden. NIST Standard Reference Database 23: Reference Fluid Thermo- could only be explained by the real gas law. The results in dynamic and Transport Properties - REFPROP. National table3 show that the van der Waals model covers this real Institute of Standards and Technology, Standard Reference gas effect. Data Program, Gaithersburg, 9.0 edition, 2010. URL http: //www.nist.gov/srd/nist23.cfm. Table 3. Results of the experiment of Gay-Lussac. W. Moore. Grundlagen der Physikalischen Chemie. De Gruyter, Fluid model End temperature Berlin, 1986. ISBN 978-3110099416. Ideal gas model / PSL 20.0 ◦C W. Sutherland. The viscosity of gases and molecular force. van der Waals model / PSL 17.2 ◦C Philosophical Magazine 5, pages 507–531, 1893. ◦ CoolProp lib. / ExternalMedia 16.9 C N. W. Tschoegl. Fundamentals of Equilibrium and Steady-State Thermodynamics. Elsevier, Amsterdam, 1983. ISBN 0-444- 50426-5.

6 Summary Office of energy efficiency US DOE, Renewable energy, the The investigation shows that the van der Waals Real Gas FreedomCAR, and fuel Partnership. Targets for onboard hy- Model is a good compromise between accuracy and sim- drogen storage systems for light-duty vehicles. Technical re- ulation performance. A big advantage of the model is the port, 2009. possibility to describe the influence of the internal pres- B. Weigand, J. Köhler, and J. v. Wolfersdorf. Thermodynamik sure on the specific enthalpy fully analytical. Thus it can kompakt. Springer-Verlag, Berlin, 2008. ISBN 978-3-540- be reduced to a single additional term in the formulation of 71865-9.

670 Proceedings of the 13th International Modelica Conference DOI March 4-6, 2019, Regensburg, Germany 10.3384/ecp19157665