Laminar & turbulent flow

Laminar & turbulent flow.
For more related figures, please have a look at the Fluid Dynamics category.

fluid_dynamics_laminar-001.pngfluid_dynamics_laminar-002.pngfluid_dynamics_laminar-003.pngfluid_dynamics_laminar-004.pngfluid_dynamics_laminar-005.png

Edit and compile if you like:

% Author: Izaak Neutelings (November 2020)
\documentclass[border=3pt,tikz]{standalone}
\usepackage{physics}
\usepackage{tikz}
\usepackage[outline]{contour} % glow around text
\usetikzlibrary{patterns,decorations.pathmorphing}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{calc}
\tikzset{>=latex}
\contourlength{1.1pt}
\colorlet{mydarkblue}{blue!40!black}
\colorlet{myblue}{blue!70!black}
\colorlet{myred}{red!65!black}
\colorlet{myorange}{orange!90!black!90}
\colorlet{vcol}{green!45!black}
\colorlet{watercol}{blue!80!cyan!10!white}
\colorlet{darkwatercol}{blue!80!cyan!80!black!30!white}
\colorlet{metalcol}{blue!25!black!30!white}
\tikzstyle{piston}=[blue!50!black,top color=blue!30,bottom color=blue!50,middle color=blue!20,shading angle=0]
\tikzstyle{water}=[draw=mydarkblue,rounded corners=0.1,top color=watercol!90,bottom color=watercol!90!black,middle color=watercol!50,shading angle=20]
\tikzstyle{horizontal water}=[water,top color=watercol!90!black!90,bottom color=watercol!90!black!90,middle color=watercol!80,shading angle=0]
\tikzstyle{metal}=[draw=metalcol!10!black,rounded corners=0.1,top color=metalcol,bottom color=metalcol!80!black,shading angle=10]
\tikzstyle{vvec}=[->,very thick,vcol,line cap=round]
\tikzstyle{force}=[->,myred,very thick,line cap=round]
\tikzstyle{width}=[{Latex[length=4,width=3]}-{Latex[length=4,width=3]}]
\def\tick#1#2{\draw[thick] (#1)++(#2:0.12) --++ (#2-180:0.24)}
\begin{document}
% LAMINAR FLOW LAYERS
\begin{tikzpicture}
\def\L{5.0} % total length
\def\Rx{0.40} % big pipe vertical radius right
\def\Ry{0.90} % big pipe vertical radius right
\def\v{1.3} % velocity magnitude
\def\N{3} % velocity magnitude
% WATER
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Click to download: fluid_dynamics_laminar.texfluid_dynamics_laminar.pdf
Open in Overleaf: fluid_dynamics_laminar.tex

One Reply to “Laminar & turbulent flow”

  1. Great, well done Izaak.
    I was very happy when I came across these many beautiful TikZ examples by chance.
    I made a few changes to the first image about laminar flow because it didn’t seem to be entirely consistent.
    Here would be the adapted source code:

    % LAMINAR FLOW LAYERS
    \begin{tikzpicture}
    \def\L{5.0} % total length
    \def\Rx{0.40} % big pipe vertical radius right
    \def\Ry{0.90} % big pipe vertical radius right
    \def\v{1.3} % velocity magnitude
    \def\N{3} % velocity magnitude

    % WATER
    \draw[horizontal water,thick]
    (0,\Ry) — (0,-\Ry) coordinate (A1) –++ (\L,0) arc(-90:90:{\Rx} and \Ry) — cycle;
    % \draw[water]
    % (\L,0) ellipse({\Rx} and \Ry);
    \draw[water]
    (0,0) ellipse({\Rx} and \Ry);
    \foreach \i [evaluate={\x=(\i-0.5)/(\N+0.5)}] in {1,…,\N}{
    \draw[mydarkblue, dashed, dash pattern=on 2pt off 1pt]
    (0,0) ellipse({\x*\Rx} and \x*\Ry)
    (\L,0) ellipse({\x*\Rx} and \x*\Ry);
    \draw[mydarkblue ,dashed, dash pattern=on 2pt off 1pt]
    (0, \x*\Ry) –++ (\L,0)
    (0,-\x*\Ry) –++ (\L,0);
    \draw[mydarkblue,dashed, dash pattern=on 2pt off 1pt]
    (\L,-\Ry) arc(270:90:{\Rx} and \Ry);
    }
    \draw[mydarkblue,thick]
    (0,0) ellipse({\Rx} and \Ry);
    \foreach \i [evaluate={\x=(\i-0.5)/(\N+0.5)}] in {1,…,\N}{
    \draw[mydarkblue] (0,0) ellipse({\x*\Rx} and \x*\Ry);
    }
    \draw[vcol!70!black,dashed, dash pattern=on 2pt off 1pt,samples=100, smooth, variable=\y, domain=-1:1]
    plot({0.5*\L+\v*(1-0.8*\y*\y)},\y*\Ry);
    \draw[vvec] (0.5*\L,0) –++ (\v,0);
    \foreach \i [evaluate={\y=(\i)/(\N+0.5); \vy=\v*(1-0.8*\y^2);}] in {1,…,\N}{
    \draw[vvec] (0.5*\L, \y*\Ry) –++ (\vy,0);
    \draw[vvec] (0.5*\L,-\y*\Ry) –++ (\vy,0);
    \draw[vcol!70!black,dashed, dash pattern=on 2pt off 1pt]
    (\L/2,-\Ry) arc(270:-90:{\Rx} and \Ry);
    \draw[vcol!70!black]
    (\L/2,-\Ry) arc(-90:90:{\Rx} and \Ry);%
    }
    \foreach \i [evaluate={\x=(\i-0.5)/(\N+0.5)}] in {1,…,\N}{
    \draw[vcol!70!black ,dashed, dash pattern=on 2pt off 1pt]
    (0,0) ellipse({\x*\Rx} and \x*\Ry)
    (\L/2,0) ellipse({\x*\Rx} and \x*\Ry);
    }
    \end{tikzpicture}

    Thank you for sharing these source code examples with us. With best regards
    G. Stengert

Leave a Reply to G. Stengert Cancel reply

Your email address will not be published.