An Analytical Solution for Unsteady Laminar Flow in Tubes with a Tapered Wall Thickness

: Transient ﬂuid ﬂows through tubes are critical in such topics as water hammer, ram pumps and pipeline dynamics. While analytical solutions exist in the literature for simple geometries such as tapered and non-tapered tube diameters, one area that is lacking is the case where the wave speed changes along the length. An example of this is a ﬂexible pipe with a tapered wall thickness. In order to calculate the transient pressure response of such a system, this previously required a computationally expensive gridded method of characteristics (MOC) solution. This paper describes an analytical solution to the dynamic laminar ﬂow of liquid in a tube where the wave speed varies along its length. This frequency-domain solution includes frequency-dependent friction effects. A comparison to a method of characteristics (MOC) solution is used to verify the solution. The paper also discusses some numerical issues and provides an approximate method that can be used for high-frequency calculations where limited numerical precision can cause errors. Finally, a preliminary comparison of the computational performance is presented, in which the new method is an order of magnitude faster to calculate than an MOC solution.


Introduction
This paper describes an analytical solution for pressure and flow dynamics for laminar liquid flow within a circular tube with constant inner diameter and varying wave propagation speed along its length, as shown in Figure 1. Fluid wave speed inside a non-rigid tube is dependent on the mechanical properties and the geometry of the tube as well as the fluid properties. Considering the pressure wave propagation along a tube, mechanical defects such as erosion, corrosion, and leakage have significant effects on the dynamic response of the pressure and flow. The motivation for this research is the use of such dynamic effects to allow for estimation of the remaining wall thickness in an eroded pipe at a lower cost than existing inspection techniques such as ultrasonic inspection, fiber-optic monitoring or "smart pigs" [1][2][3]. Other applications of this model would include research into water hammer [4], ram pumps [5][6][7], switched inertance hydraulic converters [8][9][10][11] and transient flow measurement [12].
The frequency-domain solution method presented here is computationally faster than existing gridded methods (such as the method of characteristics [13]), as it only calculates pressure and/or flow at the end-points of the tube. It can also be expected to be more accurate than time-domain solutions, such as the transmission line method (TLM), that require an approximation for the frequency-dependent friction terms [13][14][15]. While frequency-domain analytical solutions exist for tubes with tapered and non-tapered geometries [16][17][18], the authors are not aware of any such solution for the case where the wave speed varies. This paper is organized with the preceding introduction, a development of the frequency-domain model and some sample results comparing the model to a conventional method, followed by conclusions.

Materials and Methods
Consider the laminar flow of a liquid through a tube, as shown in Figure 1. If the tube walls are not perfectly rigid, the wave speed is affected by the compliance of both the fluid and the containing tube walls. For example, if the tube is axially constrained, with expansion joints throughout, the elastic wave speed is given by where is the fluid bulk modulus (usually the adiabatic tangent bulk modulus), is the fluid density, is the inner radius of the tube, is the wall thickness and is the wall material's elastic modulus [4]. (Similar relationships are given in [4] for other anchoring conditions.) If the wall thickness changes along the length of the tube, then so too will the wave speed.
Zielke [19] gives the equations of continuity and motion for 1D laminar flow through a tube as follows (as restated using nomenclature from [20]) where is the position in the streamwise direction along the pipe, ( , ) is the pressure, ( , ) is the average volumetric flow rate, is the cross-sectional area and ℎ( ) is a friction function.
Following Johnston [20], if the fluid velocity is much less than the sonic velocity, then the terms can be neglected. Taking the Fourier transform then gives where ( ) is a friction function [20]. A common friction function [20,21] is This paper is organized with the preceding introduction, a development of the frequency-domain model and some sample results comparing the model to a conventional method, followed by conclusions.

Materials and Methods
Consider the laminar flow of a liquid through a tube, as shown in Figure 1. If the tube walls are not perfectly rigid, the wave speed is affected by the compliance of both the fluid and the containing tube walls. For example, if the tube is axially constrained, with expansion joints throughout, the elastic wave speed is given by where K is the fluid bulk modulus (usually the adiabatic tangent bulk modulus), ρ is the fluid density, r is the inner radius of the tube, e is the wall thickness and E is the wall material's elastic modulus [4]. (Similar relationships are given in [4] for other anchoring conditions.) If the wall thickness changes along the length of the tube, then so too will the wave speed.
Zielke [19] gives the equations of continuity and motion for 1D laminar flow through a tube as follows (as restated using nomenclature from [20]) ∂q ∂t ∂p ∂t where x is the position in the streamwise direction along the pipe, p(t, x) is the pressure, q(x, t) is the average volumetric flow rate, A is the cross-sectional area and h(q) is a friction function. Following Johnston [20], if the fluid velocity is much less than the sonic velocity, then the q A terms can be neglected. Taking the Fourier transform then gives where W(jω) is a friction function [20]. A common friction function [20,21] is where J is the Bessel function of the first kind. This function takes into account unsteady frequency-dependent friction, but not thermal effects.
We now diverge from Johnston [20] to assume that A is constant and that K (and therefore c) is a function of x. The fluid density, ρ, is still assumed to be constant. Solving Equation (5) for P and differentiating gives which can be substituted into Equation (4) to give the second order ODE We now assume that the wave speed's variation along the tube takes the form where and where c A and c B are the wave speeds at the inlet (x = 0) and outlet (x = L), respectively. As demonstrated in Figure 2, this nonlinear taper approximates a linear taper as long as the differences in c are small relative to its absolute value. If this assumption is broken, the tube can be divided into a number of shorter segments. For the nonlinear taper given above, the average velocity (as derived in Appendix A) is This taper has the nice property of 1 c 2 which allows Equations (11) and (14) to be substituted into Equation (10) to give then the ODE takes the form of which has an analytical solution: where J and Y are the Bessel functions of the first and second kind, and C 1 and C 2 are constants of integration. This can be substituted into Equation (5) to obtain the pressure solution Equation (5) for and differentiating gives which can be substituted into Equation (4) to give the second order ODE We now assume that the wave speed's variation along the tube takes the form and where and are the wave speeds at the inlet ( = 0) and outlet ( = ), respectively. As demonstrated in Figure 2, this nonlinear taper approximates a linear taper as long as the differences in are small relative to its absolute value. If this assumption is broken, the tube can be divided into a number of shorter segments.  We can then apply open or closed boundary conditions to obtain the transmission matrix in the form where P A and P B are the pressures at the inlet and outlet, Q A and Q B are the corresponding flow rates, and Z cA and Z cB are the characteristic impedances at the inlet and outlet: The transmission matrix terms are where By applying the Wronskian, the denominator can be simplified to The above equations are undefined at ω = 0, but steady state physical requirements can be used to find the values. For continuity in flow between inlet and outlet, and zero pressure drop for zero flow: For the proper steady state pressure drop where R is the Hagen-Poiseuille laminar resistance [22]. Note the relationship between t 12 and the dissipation number where Z c is the lumped characteristic impedance, defined for a lossless line by where L is the lumped inductance and C is the lumped capacitance [14,23]. For the tapered-wall tube defined in this paper, the dissipation number is Numerical issues exist for combinations of high frequency and small tapers. This is due to the transmission matrix numerators being a small difference of large numbers. This problem can be mitigated by using quadruple precision floating point representations. An alternative is to use high-frequency approximations of the Bessel functions [24]. In the limit as θ → ∞ This allows for the following simplifications of the transmission matrix We found that the approximation error of these equations is exceeded by the precision error of the original equations (for double precision floating point numbers) when the imaginary part of θ 2 is greater than about 15.

Results
In order to verify the equations, we compared the calculated responses to a method of characteristics (MOC) solution. The MOC solution divides the tube into N = 100 segments, each with a constant wave velocity, and uses an approximate frequency-dependent friction model from [13]. Since the analytical solution presented in our paper does not include these approximations, one should not view the MOC solution as the "true" solution as much as a sanity check to ensure that no blunders were committed in our development.
Frequency-domain solutions were calculated using the transmission matrix terms for frequencies scaled so that 100 time points would be calculated in the time required for the wave to transit the length of the tube, and the solution would span 8000 such cycles. These 800,000 frequency points are not strictly required, but the calculation is fast and it was desirable to ensure the entire response was captured for low dissipation numbers. Considerably fewer frequency points would be required for more damped responses. The inverse Fourier transform was used to calculate the time-domain response from the frequency-domain response.                      In order to provide a sense of the relative computational cost for the new frequency domain method, responses were calculated for the case of = 10 and = 1 while varying the number of frequency points in the solution. The method of characteristics solution was then calculated, with the grid selected to give results at the same time resolution. The computation time was recorded for each calculation, as implemented in MATLAB 2019b and run on a desktop computer with a i7-8700 processor with 32 GB RAM. In each case, the solution was calculated to an end time of four times the response's   In order to provide a sense of the relative computational cost for the new frequency domain method, responses were calculated for the case of = 10 and = 1 while varying the number of frequency points in the solution. The method of characteristics solution was then calculated, with the grid selected to give results at the same time resolution. The computation time was recorded for each calculation, as implemented in MATLAB 2019b and run on a desktop computer with a i7-8700 processor with 32 GB RAM. In each case, the solution was calculated to an end time of four times the response's In order to provide a sense of the relative computational cost for the new frequency domain method, responses were calculated for the case of β = 10 −3 and c A c B = 1 while varying the number of frequency points in the solution. The method of characteristics solution was then calculated, with the grid selected to give results at the same time resolution. The computation time was recorded for each calculation, as implemented in MATLAB 2019b and run on a desktop computer with a i7-8700 processor with 32 GB RAM. In each case, the solution was calculated to an end time of four times the response's settling time (defined as the point where transients reduce to 1% of the maximum value). The relative root mean squared error between the calculated response, p(t), and the highest where an overbar designates the mean [25]. Figures 11 and 12 shows the resultant calculation time and error as more terms are used in the solution. As expected, as the resolution is increased, the computation time and accuracy increase for both methods. However, for a given resolution, the new method is both faster (by around an order of magnitude) and more accurate. While the presented results are for a specific problem, we observed similar results across a wide range of dissipation numbers and taper ratios. It should be noted that neither the MOC solution nor the new frequency domain solution code was extensively optimized for speed, so these results should be viewed as a preliminary indication of relative computational speed.
One downside of the new method is that sufficient frequency points must be selected so that the transients have died out by the end of the corresponding time-domain response. Otherwise, the periodic nature of the Fourier transform will cause the response beyond the calculated end time to be added to the start of the response. If only the very beginning of a long response is of interest, the MOC method can be faster, as the computation can be halted early, while the new frequency-domain method must be fully calculated.
settling time (defined as the point where transients reduce to 1% of the maximum value). The relative root mean squared error between the calculated response, ( ), and the highest resolution frequency-domain method response calculated, ( ), normalized by the standard deviation, was calculated as where an overbar designates the mean [25]. Figures 11 and 12 shows the resultant calculation time and error as more terms are used in the solution. As expected, as the resolution is increased, the computation time and accuracy increase for both methods. However, for a given resolution, the new method is both faster (by around an order of magnitude) and more accurate. While the presented results are for a specific problem, we observed similar results across a wide range of dissipation numbers and taper ratios. It should be noted that neither the MOC solution nor the new frequency domain solution code was extensively optimized for speed, so these results should be viewed as a preliminary indication of relative computational speed.
One downside of the new method is that sufficient frequency points must be selected so that the transients have died out by the end of the corresponding time-domain response. Otherwise, the periodic nature of the Fourier transform will cause the response beyond the calculated end time to be added to the start of the response. If only the very beginning of a long response is of interest, the MOC method can be faster, as the computation can be halted early, while the new frequency-domain method must be fully calculated.

Summary and Conclusions
This paper presents an analytical solution for pressure and flow dynamics for laminar liquid flow within a tube, where the wave speed varies along the tube length in response to a change in compliance. This describes the situation of a tube with a flexible pipe wall where the wall thickness varies along the tube length but may also be applicable in other situations where the wave speed varies.
We have identified a numerical issue with standard double-precision floating point calculations and recommend two methods of mitigating these effects.
This paper also presents a comparison of the new method to a method of characteristics solution which agree well over a range of taper ratios and dissipation numbers, leading to confidence in the solution. A preliminary comparison of the calculation time and accuracy as the number of terms in the solution are varied is presented, which indicates that the new method is at least as accurate and much faster than the MOC solution.
Future work includes a more rigorous evaluation of the range of applicability of this new solution method, in terms of dissipation number and taper ratio, as well as an analysis of the number of frequency terms required for acceptable accuracy.

Summary and Conclusions
This paper presents an analytical solution for pressure and flow dynamics for laminar liquid flow within a tube, where the wave speed varies along the tube length in response to a change in compliance. This describes the situation of a tube with a flexible pipe wall where the wall thickness varies along the tube length but may also be applicable in other situations where the wave speed varies.
We have identified a numerical issue with standard double-precision floating point calculations and recommend two methods of mitigating these effects.
This paper also presents a comparison of the new method to a method of characteristics solution which agree well over a range of taper ratios and dissipation numbers, leading to confidence in the solution. A preliminary comparison of the calculation time and accuracy as the number of terms in the solution are varied is presented, which indicates that the new method is at least as accurate and much faster than the MOC solution.
Future work includes a more rigorous evaluation of the range of applicability of this new solution method, in terms of dissipation number and taper ratio, as well as an analysis of the number of frequency terms required for acceptable accuracy.

Appendix A
This appendix derives the average velocity for a wave whose velocity is defined by The position of a wave front that starts at x = 0 at t = 0 is given by the ODE dx dt = c A e Bx/2 (A3) whose solution is Therefore, the wave front arrives at x = L at time and, after some algebraic manipulation, the average velocity is