Turbulent flow in a pipe
Sergio de Campos Junior
Algorithmics for Engineering Modeling
Master of Marine Technology: Hydrodynamics for Ocean Engineering (M-TECH HOE)
The study of different flow regimes in pipelines is fundamental to understanding the behaviour of the velocity profile as a result of fluid transport. Predicting this profile makes it possible to understand the interaction of the flow with the pipeline and provide parameters, such as the mass flow rate, that make it possible to design the transport system—the power required for pumping and the thickness of the pipeline, for example. However, obtaining the velocity profile as a function of the pipeline radius requires understanding the flow regime—laminar, transient or turbulent—with which one expects to deal. Once the context is defined, it is possible to use the appropriate equation to estimate the velocity profile in the duct; this estimate, if compared with experimental data from an analogous regime, is inevitably subject to non-adherence.
This work aims to validate or not an estimate for the velocity profile in a duct whose turbulent flow is known experimentally. This estimate will be developed based on linear regressions made from a previously provided database containing data on the velocity profile collected in laboratory tests. The estimation itself comes from applying parameters to the equation that best describes the flow; these parameters, in turn, come from the interpolation prepared based on the regressions.
Finally, it is expected with this work to understand the importance of validating estimates with experimental data and practising computational techniques—such as linear regression, polynomial interpolation, and database parsing—viewed during classes, especially during the practical sessions.
Description of the problem
As exposed in the proposed problem statement, it is intended in this section to make clear the parameters and variables sufficient for the problem description. As already mentioned, turbulent flow is characterized by presenting chaotic behaviour, which implies the rapid variation of pressure and velocity in the field defined by the flow. A high Reynolds number characterizes such a chaotic regime—vide equation below—in this case, the instabilities are related to interactions between viscous terms and nonlinear inertial terms in the linear momentum equations.
Objective and procedure
The following section explains the code implemented in Python 3.9 according to the described procedure and provides some considerations for running it in the Deepnote environment.
Implementation of the algorithm routine
The algorithm implementation considered what was presented during the practical sessions taught in the academic semester, from how to create functions in Python to how to perform linear regression and polynomial interpolation. Therefore, to obtain the expected results, it can be stated that all the techniques taught was somehow undertaken for the algorithm to be written—some attention will be given to the algorithm that performs linear regression and interpolation since it is understood that both are fundamental within the scope of this course.
The script is organized as follows:
The following subsections further detail the algorithms used to perform linear regression and interpolation according to methods seen during the practical sessions.
Polynomial Interpolation: Lagrange method
The code: instructions and considerations
Since one is in Deepnote's environment, to execute the code, one needs to run the whole notebook or just the block that contains all the script—we chose in this work to keep the code agglutinated in a single executable block. If the script is executed in a compiler other than Deepnote, the argument of the Read(filepath) function, which is invoked right at the beginning of the main() function, must be modified since the files directory in another compiler will probably be different.
Considering this observation, all steps described in the section "Objective and procedure" should be executed, and all results should be "printed" on the screen so that it will be possible to validate or not the adherence of the estimated and experimental data—it is worth mentioning that the code is commented, which should facilitate its evaluation.
Coefficients of the linearized equation for Re = 5522.0 : A = 1/n = 0.194 and B = ln(U_max) = 1.77
Coefficients of the linearized equation for Re = 9906.0 : A = 1/n = 0.167 and B = ln(U_max) = 2.367
Coefficients of the linearized equation for Re = 21337.0 : A = 1/n = 0.154 and B = ln(U_max) = 3.212
Coefficients of the linearized equation for Re = 31793.0 : A = 1/n = 0.151 and B = ln(U_max) = 3.628
Coefficients of the linearized equation for Re = 39855.0 : A = 1/n = 0.134 and B = ln(U_max) = 3.827
Estimated values of n [adm] and U_max [m/s]: | n |U_max| [[ 5.16 5.87] [ 5.99 10.66] [ 6.49 24.82] [ 6.6 37.63] [ 7.45 45.93]]
With interpolation, we estimate for Re = 35061, U_max = 41.22128 m/s and n = 6.83221
The error found between the experimental velocity profile and the estimated one for Re = 35061 is: 5.188 %
The code above should print all the steps already mentioned on the screen. If the present file in ".pdf" format prevents the complete visualisation of the results, they can be found in the following section: "Results and conclusion".
Results and Conclusion
BERNHARD. Fluid dynamics - Reynolds number and inertial force - Physics Stack Exchange. 2013. Available at: <https://physics.stackexchange.com/questions/80070/ reynolds-number-and-inertial-force>.
SIMSCALE. What is Reynolds Number? | SimWiki | SimScale. 2021. Available at: <https: //www.simscale.com/docs/simwiki/numerics-background/what-is-the-reynolds-number/>.
AJAYAKUMAR, V. Parsing text with Python · vipinajayakumar. 2018. Available at: <https://www.vipinajayakumar.com/parsing-text-with-python/>.