\documentclass{article}

\usepackage{Engineering}
\usepackage{multicol}
\usepackage{tcolorbox}
\usepackage{titlesec}
\usepackage{titling}
\usepackage{etoolbox}
\usepackage{tabularx}

% === METADATA ===
\pdftitle{EFPLab1 Cheatsheet}

% === HEADER/FOOTER ===
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\lhead{Matteo Frongillo}
\chead{\nouppercase{\leftmark}}
\rhead{\thepage}

\renewcommand{\sectionmark}[1]{\markboth{#1}{}}

% === CUSTOM BOX COMMANDS ===
\definecolor{BoxBG}{HTML}{F0F8FF}
\definecolor{BoxBorder}{HTML}{3B83BD}

\newtcolorbox{theorybox}[1]{
  colback=BoxBG,
  colframe=BoxBorder,
  fonttitle=\bfseries,
  left=1mm,right=1mm,top=1mm,bottom=1mm,
  boxrule=0.8pt,
  arc=1.5mm,
  title={\begingroup\intheoryboxtitletrue #1\endgroup\intheoryboxtitlefalse}
}

\newtcolorbox{examplebox}[1]{
  colback=gray!10!white,
  colframe=gray!80!black,
  coltitle=white,
  fonttitle=\bfseries,
  left=1mm,right=1mm,top=1mm,bottom=1mm,
  boxrule=0.8pt,
  arc=1.5mm,
  title={#1}
}

\newtcolorbox{formula}[1]{
  colback=red!10!white,
  colframe=red!90!black!75,
  fonttitle=\bfseries,
  left=1mm,right=1mm,top=1mm,bottom=1mm,
  boxrule=0.8pt,
  arc=1.5mm,
  title={#1}
}

% === SECTION TITLE FORMATTING ===
\newif\ifintheoryboxtitle
\intheoryboxtitlefalse

\titleformat{\section}
  {\ifintheoryboxtitle\color{white}\else\color{BoxBorder}\fi\Large\bfseries}
  {\thesection}{0.5em}{}

\titleformat{\subsection}
  {\ifintheoryboxtitle\color{white}\else\color{BoxBorder}\fi\bfseries}
  {\thesubsection}{0.5em}{}

\titleformat{\subsubsection}
  {\ifintheoryboxtitle\color{white}\else\color{BoxBorder}\fi\small\bfseries}
  {\thesubsubsection}{0.5em}{}

% === DOCUMENT ===
\begin{document}
\begin{multicols}{2}
\setlength{\columnsep}{1pt}

% === CONTENT ===
\section{Preambule}
\begin{theorybox}{Theory box}
    Lorem ipsum dolor sit amet.
\end{theorybox}

\begin{formula}{Formula box}
    Lorem ipsum dolor sit amet.
\end{formula}

\begin{examplebox}{Lab/examples box}
    Lorem ipsum dolor sit amet.
\end{examplebox}

\section{Fluids as energy carriers}
\subsection{Fluid state variables and properties}

\begin{theorybox}{Formulas}
    \subsubsection{State variables}
    \textbf{Density}
    \begin{equation}
        \rho \triangleq \dfrac{m}{V} \left[\dfrac{kg}{m^3}\right] 
    \end{equation}

    \textbf{Specific volume}
    \begin{equation}
        v \triangleq \dfrac{V}{m} = \dfrac{1}{\rho} \left[\dfrac{m^3}{kg}\right]
    \end{equation}

    \subsubsection{Viscosity}
    \textbf{Kinematic viscosity}
    \begin{equation}
        \nu \triangleq \dfrac{\eta}{\rho} \left[\dfrac{m^2}{s}\right]
    \end{equation}

    \textbf{Dynamic viscosity}
    \begin{equation}
        \eta \triangleq \nu\cdot\rho \left[Pa\cdot s = \dfrac{Ns}{m^2} = \dfrac{kg}{m \cdot s}\right]
    \end{equation}

    \subsubsection{Real and ideal fluid}
    \begin{tabularx}{\linewidth}{@{}X@{\hspace{.1766cm}}X@{}}
        \textbf{Real fluid} & \textbf{Ideal fluid} \\
        variable density $\left(\Delta \rho \neq 0\right)$ & incompressible $\left(\Delta \rho = 0\right)$ \\
        friction $\left(\eta > 0, \nu > 0\right)$ & frictionless $\left(\eta=0, \nu=0\right)$ \\
    \end{tabularx}
    \\
    \subsubsection{Compressibility}
    \textbf{Mach number}
    \begin{equation}
        M \triangleq \dfrac{u}{c}
    \end{equation}
    where:
    \begin{itemize}
        \item $M$ is the Mach number [-]\\
            $M \lesssim 0.3$: incompressible flow
        \item $u$ is the flow velocity [m/s]
        \item $c$ is the speed of sound in the fluid [m/s]
    \end{itemize}
    and:
    \begin{itemize}
        \item $c_{\text{w}}^{20^\circ} = 1484$ m/s
        \item $c_{\text{a}}^{20^\circ} = 343$ m/s
    \end{itemize}
\end{theorybox}

\vfill
\phantom{}
\columnbreak

\subsection{Laminar and turbulent flow}
\begin{formula}{Reynolds number}
    \begin{equation}
        Re = \dfrac{v\cdot L}{\nu} = \dfrac{\rho\cdot v\cdot L}{\eta} \left[-\right]
    \end{equation}
    where:
    \begin{itemize}
        \item $v$ is the mean flow velocity [m/s]
        \item $L$ is the characteristic length [m]
    \end{itemize}
    \begin{examplebox}{Re values}
    \begin{itemize}
        \item $Re < 2000$: laminar flow
        \item $Re \simeq 2300$: critical point
        \item $2000 < Re < 4000$: transitional regime
        \item $Re \geq 4000$: turbulent flow
    \end{itemize}
    \end{examplebox}
\end{formula}

\subsection{Pressure and velocity}
\begin{theorybox}{Pressure}
    \subsubsection{Total pressure}
    Added to the static pressure $p_{\rm stat}$, there is also the
    dynamic pressure $p_{\rm dyn}$ and the total pressure $p_{\rm tot}$:
    \begin{equation}
        p_{\rm tot} = p_{\rm stat} + p_{\rm dyn} = \rho\left(gh + \frac{v^2}{2}\right)
    \end{equation}

    \subsubsection{Absolute pressure}
    Absolute pressure $p_{\rm abs}$ refers to the pressure in a vacuum
    $p_{\rm vaacum}=0$ Pa, while relative pressure $p_{\rm rel}$ can refer to
    any chosen reference pressure $p_{\rm ref}$.
    \begin{equation}
        p_{\rm rel} = p_{\rm abs} - p_{\rm ref} \Longleftrightarrow p_{\rm abs} = p_{\rm rel} + p_{\rm ref} \geq 0
    \end{equation}

    \subsubsection{Velocity}
    Velocity is a vector quantity:
    \begin{equation}
        \vec{v} = \left(v_x v_y v_z\right)
    \end{equation}

    The magnitude is given by:
    \begin{equation}
        v = \sqrt{v_x^2 + v_y^2 + v_z^2}
    \end{equation}
\end{theorybox}

\subsection{Curvature pressure formula}
\begin{examplebox}{Deflection motion of a fluid element around a blunt body}
    \includegraphics[width=\textwidth]{media/pressure_curvatur.png}
    \vspace*{-0.6cm}
    \begin{equation}
        \dfrac{dp}{dn} = -\rho\cdot\dfrac{v^2}{R}
    \end{equation}
\end{examplebox}

\vfill
\phantom{}
\end{multicols}

\newpage
\begin{multicols}{2}
\setlength{\columnsep}{1pt}

\section{Mass conservation}
\subsection{Continuity equation / Mass conservation}
\begin{theorybox}{Continuity equation}
    \includegraphics[width=\textwidth]{media/ContinuityBild1.png}
    \subsubsection{Steady mass-flow}
    \begin{equation}
    \dot m_{\rm in} = \dot m_{\rm out}
    \end{equation}

    \subsubsection{Incompressible fluid}
    \begin{equation}
    \dot m = \rho\,\dot V
    \quad\Longrightarrow\quad
    \dot V_{\rm in} = \dot V_{\rm out}
    \end{equation}

    \subsubsection{Streamline theory}
    \begin{equation}
    \dot V = \bar v\,A
    \quad\Longrightarrow\quad
    \bar v_{\rm in}\,A_{\rm in} = \bar v_{\rm out}\,A_{\rm out}
    \end{equation}
\end{theorybox}

\section{Energy conservation}
\subsection{Fluid mechanical energy conservation}
\begin{theorybox}{Derivation of the Bernoulli equation}
\vspace*{-0.3cm}
    \begin{equation}
        \dot{m}_1 \left(\dfrac{p_1}{\rho} + \dfrac{v_1^2}{2} + gz_1\right) = \dot{m}_2 \left(\dfrac{p_2}{\rho} + \dfrac{v_2^2}{2} + gz_2\right)
    \end{equation}

    This derivation is based on the assumption that the system has:
    
    \begin{minipage}[t]{0.48\linewidth}
        \begin{itemize}
            \item steady flow
            \item ideal fluid
            \item adiabatic process
        \end{itemize}
    \end{minipage}
    \hfill
    \begin{minipage}[t]{0.48\linewidth}
        \begin{itemize}
            \item no work in or out of the system
            \item 1D streamline flow
        \end{itemize}
    \end{minipage}
\subsubsection{Energy flow}
\vspace*{-0.5cm}
    \begin{align}
        \frac{dE}{dt} =\ 
        &\underbrace{\sum P + \sum \dot{Q}}_{
            \substack{
                \text{Energy flow} \\ \text{across system boundary}
            }
        } \notag \\
        &+ \underbrace{\sum_{in} \left[\dot{m}^{\swarrow} \cdot \left(h^{\swarrow} + \frac{v^{2\swarrow}}{2} + g z^{\swarrow}\right)\right]}_{
            \substack{
                \text{Energy transfer} \\ \text{mass in}
            }
        } \notag \\
        &- \underbrace{\sum_{out} \left[\dot{m}^{\nearrow} \cdot \left(h^{\nearrow} + \frac{v^{2\nearrow}}{2} + g z^{\nearrow}\right)\right]}_{
            \substack{
                \text{Energy transfer} \\ \text{mass out}
            }
        }
    \end{align}

    \vspace*{-0.5cm}
    \subsubsection{Outflow formula according to Torricelli}
    \begin{equation}
        gz_1 = \frac{v_2^2}{2} \Longrightarrow v_2 = \sqrt{2g\Delta z}
    \end{equation}
\end{theorybox}

\columnbreak

\subsection{Bernoulli equation}
\begin{formula}{Specific energy equation}
    \begin{center}
        \includegraphics[width=0.95\textwidth]{media/Bernoulli.png}
    \end{center}
    \begin{equation}
        \dfrac{p_1}{\rho} + \dfrac{v_1^2}{2} + gz_1 = \dfrac{p_2}{\rho} + \dfrac{v_2^2}{2} + gz_2 = {\rm const.} \left[\dfrac{J}{kg}\right]
    \end{equation}

    \subsubsection{Alternative forms}
    \textbf{Pressure equation}
    \begin{equation}
        p_1 + \dfrac{\rho v_1^2}{2} + \rho g z_1 = p_2 + \dfrac{\rho v_2^2}{2} + \rho g z_2 = {\rm const.} \left[Pa\right]
    \end{equation}

    \textbf{Height equation}
    \begin{equation}
        \dfrac{p_1}{\rho g} + \dfrac{v_1^2}{2g} + z_1 = \dfrac{p_2}{\rho g} + \dfrac{v_2^2}{2g} + z_2 = {\rm const.} \left[m\right]
    \end{equation}
\end{formula}

\begin{theorybox}{True energy equation}
    The Bernoulli equation states that the sum of these energies is constant along a streamline.
    \subsubsection{Pressure energy}
    \begin{equation}
        E_p = m\cdot \frac{p}{\rho} \left[J\right]
    \end{equation}

    \subsubsection{Kinetic energy}
    \begin{equation}
        E_{\rm kin} = m\cdot \frac{v^2}{2} \left[J\right]
    \end{equation}

    \subsubsection{Potential energy}
    \begin{equation}
        E_{\rm pot} = m\cdot g\cdot z \left[J\right]
    \end{equation}

\subsubsection{Energy conservation}
\vspace*{-0.5cm}
\begin{align}
    E_{p,1} + E_{\rm kin,1} + E_{\rm pot,1} &= E_{p,2} + E_{\rm kin,2} + E_{\rm pot,2} \notag \\[1.5ex]
    m\left(\dfrac{p_1}{\rho}+\dfrac{v_1^2}{2}+gz_1\right) &= m\left(\dfrac{p_2}{\rho}+\dfrac{v_2^2}{2}+gz_2\right)
\end{align}
\end{theorybox}

\subsection{Hydrostatics}
\begin{formula}{Fundamental law of hydrostatics}
    \begin{equation}
        p = p_0 + \rho g h = {\rm const.} \left[\rm Pa\right]
    \end{equation}
    derived from:
    \begin{equation}
        p = p_0 + \dfrac{F_g}{A} = p_0 + \dfrac{mg}{A} = p_0 + \dfrac{\rho hAg}{A}
    \end{equation}
\end{formula}

\vfill
\phantom{}
\end{multicols}

\newpage
\begin{multicols}{2}
\setlength{\columnsep}{1pt}

\begin{examplebox}{Venturi effect}
    \subsection{Venturi effect experiment}
    \subsubsection{Height -- pressure difference at $\dot{V} = 6$ l/s}
    \includegraphics[width=\textwidth]{media/venturi.png}

    \subsubsection{Relative static pressure $p_{\rm rel}$}
    \includegraphics[width=\textwidth]{media/venturi_relative.png}
    \vspace*{-0.3cm}
    \begin{equation}
        p_{\rm rel} = p_{\rm hydro} = \rho g \left(h-h_{\rm ref}\right)
    \end{equation}
    \subsubsection{Dynamic pressure $p_{\rm dyn}$}
    \includegraphics[width=\textwidth]{media/venturi_dyn.png}
    \vspace*{-0.3cm}
    \begin{equation}
        p_{\rm dyn} = \rho\dfrac{v^2}{2}
    \end{equation}
    \subsubsection{Dynamic pressure $v$}
    \includegraphics[width=\textwidth]{media/venturi_velocity.png}
    \vspace*{-0.3cm}
    \begin{equation}
        v=\dfrac{\dot{V}}{A}
    \end{equation}
    \subsubsection{Pressure difference $\Delta p$}
    \includegraphics[width=\textwidth]{media/venturi_pressure.png}
    \vspace*{-0.3cm}
    \begin{equation}
        \Delta p = p_{\rm NoFric} - p_{\rm real} \Longrightarrow p_V \sim v^2
    \end{equation}
\end{examplebox}

\vfill
\columnbreak
\begin{examplebox}{Venturi effect}
    \textbf{Measurament points}\\[1ex]
    \includegraphics[width=\textwidth]{media/venturi_points.png}

    \textbf{Measurament shear flow}\\[1ex]
    \includegraphics[width=\textwidth]{media/venturi_flow.png}
\end{examplebox}

\begin{formula}{Just to not forget}
    \begin{equation}
        A_{\rm pipe} = D^2 \pi = \frac{r^2\pi}{4} \Longleftrightarrow D = 2\sqrt{\frac{A}{\pi}}
    \end{equation}
\end{formula}

\subsection{Contraction coefficient}
\begin{theorybox}{Outflow contraction coefficient $\alpha$}
    \begin{center}
        \includegraphics[width=.75\textwidth]{media/contraction.png}
    \end{center}
    \begin{equation}
        \alpha = \dfrac{A_{\rm actual}}{A_{\rm opening}} = \dfrac{\pi}{2 + \pi} \approx 0.611 [-]
    \end{equation}
\end{theorybox}

\subsection{Energy line diagram}
\begin{theorybox}{Ideal fluid energy line diagram}
    \includegraphics[width=\textwidth]{media/EGL_Duese_EN.PNG}
\end{theorybox}

\begin{theorybox}{Extended energy line diagram}
    \includegraphics[width=\textwidth]{media/04_energyLineDiagram_vGB.png}
\end{theorybox}

\vfill
\end{multicols}

\newpage
\begin{multicols}{2}
\setlength{\columnsep}{1pt}

\subsection{Extended Bernoulli equation}
\begin{formula}{Extension of the Bernoulli equation}
    \vspace*{-0.4cm}
    \begin{align}
        &\dfrac{p_1}{\rho} + \dfrac{v_1^2}{2} + gz_1 + e_A = \dfrac{p_2}{\rho} + \dfrac{v_2^2}{2} + gz_2 + e_V \left[\frac{J}{kg}\right] \notag \\
        &E_{p,1} + K_1 + U_1 + E_A = E_{p,2} + K_2 + U_2 + E_V \left[J\right]
    \end{align}
\end{formula}

\subsubsection{Additional terms}
\begin{theorybox}{Work term $e_A$}
    \begin{equation}
        e_A = \frac{p_A}{\rho} = gz_A = \frac{E_A}{m} = \frac{P_A}{\dot{m}} \left[\frac{J}{kg}\right]
    \end{equation}
    where:\\
    \begin{minipage}[t]{0.48\linewidth}
        $e_A$: work term [J/kg] \\
        $p_A$: pressure diff [Pa] \\
        $z_A$: height difference [m]
    \end{minipage}
    \hfill
    \begin{minipage}[t]{0.48\linewidth}
        $E_A$: energy difference [J] \\
        $P_A$: power difference [W]
    \end{minipage}\\[1.5ex]

    If energy is added to the fluid along a streamline from point 1 to point 2
    (eg. a pump), the total energy at point 2 becomes higher than at point 1.\\

    \textbf{Sign convention}\\
    $\mathbf{e_A > 0}$: work is done on the fluid\\
    \textrightarrow\ energy is added to the fluid (eg. pump);\\

    $\mathbf{e_A < 0}$: work is done by the fluid\\
    \textrightarrow\ energy is extracted from the fluid (eg. turbine).

    \begin{formula}{Pump and turbine work $Y$}
        In the pressure equation, the pressure $p_A$ increase (or decrease with a turbine) can
        be read directly at the working term, hence:
        \begin{equation}
            e_w = Y = \frac{W_A}{\dot{m}} = \frac{E_A}{m} = H\cdot g = \frac{p_A}{\rho} \left[\frac{J}{kg}\right]
        \end{equation}

        The hydraulic power $P_{\rm hyd}$ is then given by:
        \begin{equation}
            P_{\rm hyd} = \dot{m}\cdot Y = \dot{V}\cdot \rho\cdot Y = \rho\cdot \dot{V} \cdot g \cdot H \left[W\right]
        \end{equation}
    \end{formula}
\end{theorybox}

\begin{theorybox}{Specific loss term $e_V$}
    \begin{equation}
        e_V = \frac{p_V}{\rho} = gz_V = \frac{E_V}{m} = \frac{P_V}{\dot{m}} \left[\frac{J}{kg}\right]
    \end{equation}
    where:\\
    \begin{minipage}[t]{0.48\linewidth}
        $e_V$: loss term [J/kg] \\
        $p_V$: pressure diff [Pa] \\
        $z_V$: height loss [m]
    \end{minipage}
    \hfill
    \begin{minipage}[t]{0.48\linewidth}
        $E_V$: energy loss [J] \\
        $P_V$: power loss [W]
    \end{minipage}\\[1.5ex]

    The effects of a viscous fluid along a stramline from point 1 to point 2 are taken into
    account by $e_V$.

    \begin{formula}{Pressure loss $\Delta p_V$}
        \vspace*{-0.48cm}
        \begin{equation}
            \Delta p_V = e_V \cdot \rho = \frac{E_V\cdot \rho}{m} = g\cdot z_V \cdot \rho = \zeta\cdot \rho \cdot \frac{v^2}{2} \left[Pa\right]
        \end{equation}
    \end{formula}
\end{theorybox}

\vfill
\columnbreak

\subsection{Loss behavior in turbolent flows}
\begin{formula}{Zeta value}
    \begin{equation}
        \zeta = \frac{2\cdot \Delta p_V}{\rho\cdot v^2}
    \end{equation}
\end{formula}

\begin{theorybox}{Total pressure loss}
    If multiple losses occur in a system due to sequentially connected hydraulic components,
    the ttal loss $\Delta p_{V,\rm tot}$ is given by the sum of the individual losses:
    \vspace*{-0.3cm}
    \begin{align}
        \Delta p_{V,\rm tot} &= \sum_{i} \Delta p_{V,i} = \sum_{i} \zeta_i\cdot \rho\cdot \frac{v^2_i}{2} \left[Pa\right]\\
        \Delta p_{V,\rm tot} &= \rho \cdot \frac{v^2}{2} \cdot \sum_{i} \zeta_i = \rho\cdot \frac{v^2}{2} \cdot \zeta_{\rm tot} \left[Pa\right]
    \end{align} 
\end{theorybox}

\begin{theorybox}{Pressure head (prevalenza)}
    The pressure head $H$ is the (energy) height corresponding to its
    specific potential energy $e_A$:
    \begin{equation}
        H = \frac{e_A}{g} = \frac{\Delta p_A}{\rho\cdot g} \left[m\right]
    \end{equation}
\end{theorybox}

\begin{examplebox}{U-Tube manometer}
    \includegraphics[width=\textwidth]{media/venturi_ex.png}
    \begin{equation}
        h = \frac{\rho \left(v_ 2^2 - v_1^2\right)}{2g\left(\rho_{\rm Hg} - \rho_w\right)}
    \end{equation}
\end{examplebox}

\subsection{Efficiency}
\begin{theorybox}{Efficiency factor $\eta$}
    \begin{align}
        \eta &= \frac{P_{\rm out}}{P_{\rm in}} = \frac{\rm Benefit}{\rm Effort}\\[2ex]
        \eta_{\rm hyd} &= \frac{P_{\rm real}}{P_{\rm ideal}} = \frac{\dot{m} \cdot e_{\rm real}}{\dot{m} \cdot e_{\rm ideal}} = \frac{e_A - e_V}{e_A} \notag\\
        \eta_{\rm hyd} &= \left(= \frac{\Delta e_k + \Delta e_{\rm pot} + \Delta e_p}{e_A}\right)
    \end{align}

    \subsubsection{Volumetric efficiency $\eta_{\rm vol}$}
    \begin{equation}
        \eta_{\rm vol} = \frac{\dot{m}_{\rm real}}{\dot{m}_{\rm ideal}} = \frac{\dot{V}_{\rm real}}{\dot{V}_{\rm ideal}}
    \end{equation}
\end{theorybox}

\vfill
\phantom{}
\end{multicols}

\newpage
\begin{multicols}{2}
\setlength{\columnsep}{1pt}

\begin{theorybox}{Efficiency factor $\eta$}
    \subsubsection{Efficiency of a pump-driven system}
    \vspace{-0.3cm}
    \begin{gather}
        \eta_{\rm pump} = \frac{P_{\rm hyd}}{P_{\rm mech}} = \frac{\dot{m} \cdot Y}{M\cdot \omega}\\
        \eta_{\rm tot} = \underbrace{{\eta_{\rm el} \cdot \eta_{\rm mech} \cdot \eta_{\rm vol}}}_{\rm Pump} \cdot \eta_{\rm hyd}^{\rm system}
    \end{gather}

    In the case of an eletrically driven pump, the effective power transferred to the fluid is thus:
    \vspace*{-0.15cm}
    \begin{equation}
        P_{\rm eff} = P_{\rm el} \cdot \eta_{\rm tot} \Longleftrightarrow P_{\rm el} = \frac{P_{\rm pump}}{\eta_{\rm pump}}
    \vspace*{-0.15cm}
    \end{equation}

    \subsubsection{Efficiency of a turbine-driven system}
    \vspace{-0.3cm}
    \begin{gather}
        \eta_{\rm turbine} = \frac{P_{\rm mech}}{P_{\rm hyd}} = \eta_{\rm mech} \cdot \eta_{\rm hyd}\\
        \eta_{\rm tot} = \eta_{\rm turbine} \cdot \eta_{\rm el} = \eta_{\rm mech} \cdot \eta_{\rm hyd} \cdot \eta_{\rm el}
    \end{gather}
\end{theorybox}

\section{Pipe flows}
\subsection{Flow characteristics}
\begin{formula}{Reynolds number in pipes}
    \begin{equation}
        Re = \frac{v_m \cdot d}{\nu}
    \end{equation}
\end{formula}

\begin{theorybox}{Pipe flows}
    \subsubsection{Laminar pipe flow}
    The pressure loss of a laminar pipe flow is described by the Hagen-Poiseuille:
    \vspace*{-0.1cm}
    \begin{align}
        &v(r) = \frac{p_1 - p_2}{4\eta \cdot l}\left(R^2 - r^2\right)\\
        &v_m = \frac{v_{\rm max}}{2} = \frac{p_1 - p_2}{8\eta \cdot l}\cdot R^2 \notag \\
        &v_m = \frac{p_1 - p_2}{32\eta \cdot l}\cdot d^2 \notag \\
        &\Delta p = 32\eta \cdot v_m\cdot \frac{l}{d^2}
    \end{align}

    \vspace*{-0.1cm}
    \subsubsection{Turbolent flow / Pressure lost in pipelines}
    Flow losses in pipeline systems consist of pressure losses in straight
    or curved pipes as well as in fittings.
    \begin{equation}
        \Delta p = \lambda \cdot \frac{l}{d} \cdot \rho \cdot \frac{v_m^2}{2}
    \end{equation}
    \subsubsection{Resistance coefficient $\lambda$}
    \vspace*{-0.5cm}
    \begin{align}
        &\lambda \cdot \frac{l}{d} \cdot \rho \cdot \frac{v_m^2}{2} = 32\eta \cdot v_m \cdot \frac{l}{d^2} \notag \\[1.5ex]
        &\lambda = \frac{64\eta}{v_m \cdot d \cdot \rho} = \frac{64}{Re}
    \end{align}

    \subsubsection{Loss coefficient $\zeta$ of a pipe}
    \begin{equation}
        \zeta = \frac{l}{d}\cdot \lambda
    \end{equation}

\end{theorybox}

\vfill
\columnbreak

\subsection{Straight pipes}
\subsubsection{Moody diagram}
The resistance coefficient $\lambda$ depends on the flow characteristics
(quantified by the Reynolds number $Re$) and the relative wall roughness.

\includegraphics[width=\columnwidth]{media/Moody-Diagramm_en.png}

\begin{theorybox}{Pipe fittings}
    In pipeline systems, a portion of the pressure losses is caused by fittings:
    \begin{equation}
        \Delta p = e_v \cdot \rho = \zeta \cdot \rho \cdot \frac{v_m^2}{2}
    \end{equation}

    \subsubsection{Elbows}
    \begin{center}
        \includegraphics[width=.8\textwidth]{media/Sekundärströmung-Rohrkrümmer.jpg}
    \end{center}
    \begin{align}
        \Delta p = \zeta \cdot \rho \cdot\frac{v^2}{2}\\
        \zeta = f_{Re} \cdot \zeta_u
    \end{align}
    where (given from individual diagrams):
    \begin{itemize}
        \item $\zeta_u$ is the geometric resistance coefficient;
        \item $f_{Re}$ is the Reynolds correction factor.
    \end{itemize}
    
    \subsubsection{Diffuser}
    A diffuser is a section in a pipeline with a continuous increase in cross-sectional area.\\\\
    The frictional losses $\Delta p_v$ in a diffuser are given by:
    \begin{align}
        \Delta p_v &= \frac{\zeta\rho v_1^2}{2}\\
        \Delta p_{v,\rm ideal} &= \rho \frac{v_2^2-v_1^2}{2}
    \end{align}
\end{theorybox}
\vfill
\phantom{}
\end{multicols}

\newpage
\begin{multicols}{2}
\setlength{\columnsep}{1pt}
\begin{theorybox}{Pipe fittings}
    The diffuser efficiency $\eta_D$ according to Bernoulli:
    \begin{equation}
        \eta_D = \frac{p_2 - p_1}{\Delta p_B} = 1 - \zeta \frac{1}{1 - \left(\frac{A_1}{A_2}\right)^2} = \frac{c_p}{c_{p,\rm ideal}}
    \end{equation}

    The various coefficients are stated as:
    \begin{align}
        c_p &= \frac{2\left(p_2 - p_1\right)}{\rho v_1^2} = \eta_D \cdot c_{p,\rm ideal}\\
        c_{p,\rm ideal} &= 1 - \left(\frac{A_1}{A_2}\right)^2\\
        \zeta_1 &= c_{p,\rm ideal} - c_p
    \end{align}

    The opening angle of a diffuser can be calculated as:
    \begin{align}
        \tan(\theta) &= \frac{d_2 - d_1}{2L}\\
        \varphi &= 2\theta
    \end{align}
    The optimal angle $\varphi_{\rm opt}$ is between 6-20 degrees.

    \subsubsection{Inlets}
    When a stationary fluid is introduced from a large container into a
    pipe, losses occur due to acceleration and the formation of
    separation bubbles.
    \begin{itemize}
        \item sharp edge: $0.45 < \zeta < 0.50$
        \item broken edge: $\zeta = 0.20$
    \end{itemize}

    \subsubsection{Outlets}
    For an outlet into a large basin, the entire kinetic energy is
    converted into static pressure loss, meaning $\zeta = 1$ can be assumed.

    \subsubsection{Valves and fittings}
    $\zeta$-values are specified by different manufacturer.
\end{theorybox}

\section{Linear momentum theorem}
\begin{formula}{Linear momentum}
    \begin{equation}
        \vec{I} = m\cdot \vec{v} \left[Ns\right]
    \end{equation}
\end{formula}

\subsection{Linear momentum balance}
\begin{theorybox}{Momentum flux}
    The change in motion is a change in linear momentum over time:
    \begin{equation}
        \vec{F}_{\rm res} = \frac{d\vec{I}}{dt} = \dot{\vec{I}}  = \frac{d\left(m\cdot \vec{v}\right)}{dt}
    \end{equation}

    at constant mass:
    \begin{equation}
        \dot{\vec{I}} = m\cdot \vec{a} = \dot{m}\cdot \vec{v}
    \end{equation}
\end{theorybox}

\vfill
\columnbreak

\subsection{System of forces}
\begin{theorybox}{Force balance}
    The sum of all external forces on a control volume is the difference of momentum flow:
    \begin{equation}
        \vec{F}_{\rm res} = \sum_{i} \vec{F}_i = \dot{\vec{I}}_{\rm out} - \dot{\vec{I}}_{\rm in}
        \vspace*{-0.3cm}
    \end{equation}

    expanded to:
    \begin{equation}
        \dot{\vec{I}}_{\rm out} - \dot{\vec{I}}_{\rm in} = \dot{m}\left(\vec{v}_2 - \vec{v}_1\right) = \rho\cdot \dot{V}\cdot \left(\vec{v}_2 - \vec{v}_1\right)
    \end{equation}

    where:
    \vspace*{-0.3cm}
    \begin{align}
        m_1 &= \rho_1\cdot \dot{V}_1\cdot \Delta t = \rho_1\cdot v_1\cdot A_1\cdot \Delta t \notag\\
        m_2 &= \rho_2\cdot \dot{V}_2\cdot \Delta t = \rho_2\cdot v_2\cdot A_2\cdot \Delta t \\
        \vec{I}_{\rm in} = \vec{I}_1 &= m_1\cdot \vec{v}_1 = \rho_1\cdot v_1\cdot A_1\cdot \Delta t\cdot \vec{v}_1 \notag \\
        \vec{I}_{\rm out} = \vec{I}_2 &= m_2\cdot \vec{v}_2 = \rho_2\cdot v_2\cdot A_2\cdot \Delta t\cdot \vec{v}_2
    \end{align}

    \subsubsection{Momentum as vector}
    \vspace*{-0.3cm}
    \begin{align}
        \dot{\vec{I}}_{xyz} = \left(\dot{I}_x \dot{I}_y \dot{I}_z\right) \notag \\
        \dot{I} = \sqrt{\dot{I}_x^2 + \dot{I}_y^2 + \dot{I}_z^2}
    \end{align}

    The external forces can consist of pressure forces $F_P$, body forces (support forces) $F_B$, gravitational forces $F_G$, and frictional forces $F_F$:
    \begin{equation}
        \vec{F}_{\rm res} = \sum_{i} \vec{F}_i = \vec{F}_P + \vec{F}_B + \vec{F}_G + \vec{F}_F
    \end{equation}
\end{theorybox}

\subsection{Control volume}
\begin{examplebox}{Linear momentum calculation steps}
    \begin{enumerate}[label=\Roman*]
        \item Step:\ \ Select a suitable \textbf{coordinate system} and draw it
            in a sketch of the flow problem;
        \item Step:\ \ Select \textbf{control volume} sensibly and draw it in the sketch.
            The balance boundary should be set so that the external forces
            on its surface are knwon;
        \item Step:\ \ Draw in the \textbf{forces} $\vec{F}_P, \vec{F}_B, \vec{F}_G, \vec{F}_F$
            acting on the CV from the outside and calculate them from the known quantities.
        \item Step:\ \ Calculate the \textbf{linear momentum fluxes} at the
            outlet and inlet and insert them as the resulting force (eq. 72)
        \item Step:\ \ Dissolve the momentum balance equations according to the
            \textbf{sought quantity} or its components and calculate them.
        \item Step:\ \ If necessary, calculate the \textbf{magnitude} and the \textbf{direction} (eq. 75)
    \end{enumerate}

    \includegraphics[width=\textwidth]{media/CV1.png}
\end{examplebox}
\vfill
\end{multicols}

\newpage
\begin{multicols}{2}
\setlength{\columnsep}{1pt}
\begin{examplebox}{Linear momentum calculation steps}
    \subsubsection{Plates}
    \begin{center}
        \includegraphics[width=0.8\textwidth]{media/platte_bewegt.png}
    \end{center}
    \begin{equation}
        F_{kx} = \dot{m}\cdot v = \rho A v^2
    \end{equation}
\end{examplebox}

\subsection{Momentum on x-direction}
\begin{theorybox}{Wall shear stress}
    The shear stress $\tau_w$ is the force per unit area acting on the
    pipe's walls:
    \begin{equation}
        \tau_w = \frac{dv}{dn}\cdot \eta
        \vspace*{-0.3cm}
    \end{equation}
    where:
    \begin{itemize}
        \item $dv$ is the velocity difference;
        \item $dn$ is the distance from the wall
    \end{itemize}
    \begin{center}
        \includegraphics[width=0.85\textwidth]{media/Wandreibung.png}
    \end{center}
    \begin{equation}
        \left|F_{K,x}\right| = \left|A\left(p_{\rm in} - p_{\rm out}\right)\right| = \left|\tau_w \cdot A \cdot l\right|
    \end{equation}
\end{theorybox}

\subsection{Pelton turbine}
\begin{theorybox}{Pelton bucket}
    \begin{center}
        \includegraphics[width=.85\textwidth]{media/pelton.png}
    \end{center}
    \subsubsection{Velocities}
    \begin{itemize}
        \item {\color{red} $v_1$: absolute velocity} [m/s]
        \item {\color{blue} $u$: radial velocity} [m/s]
        \item {\color{darkgreen!80!black} $w_1$: relative velocity (turbine POV)} [m/s]
    \end{itemize}
    \begin{align}
        v_{\rm nozzle} &= \sqrt{2g\Delta h} = \sqrt{\frac{2\Delta p}{\rho}} \notag \\
        w_1 = v_{\rm nozzle} - u &= \sqrt{\frac{2\Delta p}{\rho}} - D_{\rm wheel}\cdot \pi \cdot n_{\rm wheel} \\
        u &= \frac{v_{\rm nozzle}}{2}
    \end{align}
\end{theorybox}

\vfill
\columnbreak
\begin{theorybox}{Pelton bucket}
    \subsubsection{Rotational speed}
    \begin{equation}
        k_u = \frac{u}{v_{\rm nozzle}}
    \end{equation}
    \subsubsection{Hydraulic power}
    \begin{equation}
        P_{\rm hyd} \approx \rho\cdot g\cdot H\cdot \dot{V} \approx \Delta p\cdot \dot{V} \left[W\right]
    \end{equation}
\end{theorybox}

\begin{formula}{Laminar pipe velocity (section 5)}
    \begin{equation}
        v(r) = \frac{\Delta p\cdot R^2}{4\eta \cdot l}\left(1-\left(\frac{r}{R}\right)^2\right)
    \end{equation}
\end{formula}

\subsection{Borda-Carnot diffuser}
\begin{examplebox}{Borda-Carnot diffuser}
    \includegraphics[width=\textwidth]{media/bordaCarnot.png}

    The continuity equation (eq 12, 13, 14) can be applied for the pipe expansion.

    \subsubsection{Pressure difference}
    \vspace*{-0.3cm}
    \begin{align}
        \sum F_x &= p_1A_1 - p_2A_2 = \dot{m}\left(v_2-v_1\right) \\
        p_1 - p_2 &= \rho \cdot v_2 \cdot \left(v_2 - v_1\right) = \rho \cdot v_2^2 \left(1-\frac{v_1}{v_2}\right) \notag \\
        &= \rho \cdot v_2^2\cdot\left(1-\frac{A_1}{A_2}\right) = \rho\cdot v_1^2 \cdot \frac{A_1^2}{A_2^2}\cdot \left(1-\frac{A_2}{A_1}\right)\notag
    \end{align}

    \begin{equation}
        p_1 - p_2 = \rho \cdot v_1^2\cdot \frac{A_1}{A_2}\cdot \left(\frac{A_1}{A_2}-1\right)
    \end{equation}

    \subsubsection{Maximum pressure}
    The maximum possible pressure increase can be archieved with an
    area ratio of $A_1 / A_2 = 0.5$. Thus:
    \begin{equation} 
        \left(p_2 - p_1\right)_{\rm max} = \frac{\rho\cdot v_1^2}{4}
    \end{equation}
    \subsubsection{Pressure loss in ideal diffusers}
    \begin{equation}
        \Delta p_{V,\rm id} = \frac{\rho}{2}\left(v_1 - v_2\right)^2 = \frac{\rho\cdot v_1^2}{2}\left(1-\frac{A_1^2}{A_2^2}\right)
    \end{equation}

    \subsubsection{Pressure loss in real diffusers}
    \begin{equation}
        \Delta p_V = \Delta p_{V,\rm id} - \zeta\frac{\rho \cdot v_m^2}{2} = \frac{\rho\cdot v_1^2}{2}\left(1-\frac{A_1^2}{A_2^2}-\zeta\right)
    \end{equation}
\end{examplebox}
\vfill
\end{multicols}

\newpage
\begin{multicols}{2}
\setlength{\columnsep}{1pt}

\begin{examplebox}{Borda-Carnot diffuser}
    \subsubsection{Flow losses}
    \vspace{-0.5cm}
    \begin{align}
        \frac{p_1}{\rho} + \frac{v_1^2}{2} = \frac{p_2}{\rho} + \frac{v_2^2}{2} + e_V \notag \\
        e_V = \frac{v_1^2}{2} \cdot \left(\frac{A_1}{A_2}-1\right)^2 = \frac{v_1^2}{2}\cdot \zeta
    \end{align}
    Hence:
    \begin{equation}
        \zeta = \left(\frac{A_1}{A_2}-1\right)^2
    \end{equation}
\end{examplebox}

\subsection{Analyze of momentum equation}
\begin{theorybox}{Momentum equation}
    for $A_2 > A_1 \Longrightarrow p_2 > p_1;\qquad 0 < \zeta < 1$\\[1ex]
    for $A_2 = A_1 \Longrightarrow p_2 = p_1;\qquad \zeta = 0$\\[1ex]
    for $A_2 \to \infty \Longrightarrow p_2 = p_1;\qquad \zeta = 1$\\[1ex]
    for $A_2 = 2A_1 \Longrightarrow p_2 - p_1$ becomes maximal\\[3ex]
    Assuming $r=A_2/A_1$, we know $\zeta = \left(1-r\right)^2:$\\[1ex]
    if $r = 0.5 \Longrightarrow \zeta = 0.5$\\[1ex]
    if $r = 0.25 \Longrightarrow \zeta = 0.5625$\\[1ex]
    if $r = 0.75 \Longrightarrow \zeta = 0.0625$
\end{theorybox}

\section{Angular momentum theorem}
\begin{theorybox}{Angular momentum equation}
    \subsection{Moment of inertia}
    Considering the moment of inertia as a scalar quantity of a point mass
    instead of a tensor:
    \begin{equation}
        J_{\rm PM} = r^2\cdot m = \int_m r^2\ dm \left[kg\ m^2\right]
    \end{equation}

    \subsubsection{Angular momentum $D$}
    The angular momentum $D$ of a mass $m$ is rotating around a point $O$ with an
    angular velocity $\omega$ is:
    \begin{equation}
        D = m\cdot v\cdot r = m\cdot r^2 \cdot \omega \left[Nm\cdot s\right]
    \end{equation}

    \subsection{Angular momentum flux balance}
    The sum of all ext. torques on a CV is equal
    to the difference of the in/out angular momentum flux:
    \vspace*{-0.3cm}
    \begin{align}
        \vec{M}_{\rm res} = \sum_i \vec{M}_i = \dot{\vec{D}}_{\rm out} - \dot{\vec{D}}_{\rm in}\\
        \dot{\vec{D}} = \vec{r} \times \dot{\vec{I}} = \vec{r} \times \left(\dot{m}\cdot \vec{v}\right)
    \end{align}

    \subsubsection{Angular momentum as vector}
    As (eq. 75), the angular momentum is a vector.
\end{theorybox}
\vfill
\columnbreak

\subsection{Angular momentum application}
\begin{examplebox}{Pelton turbine}
        \includegraphics[width=\textwidth]{media/peltonlaufrad_drall_en.png}

        \begin{enumerate}[label=\Roman*]
        \item Step:\ \ xy-coordinates and CV
        \item Step:\ \ Relevant forces $\vec{F}_P,\vec{F}_G,\vec{F}_F,\vec{F}_B$
            \begin{equation}
                M_{\rm res,z} = M_{B,z}
            \end{equation}
        \item Step:\ \ Angular momentum flux calculations:
            \begin{equation}
                \dot{D}_{{\rm out},z} - \dot{D}_{{\rm in},z} = M_{B,z} = -r\cdot \dot{m} \cdot v_1
            \end{equation}
    \end{enumerate}

    \subsubsection{Delivered power}
    \vspace*{-0.3cm}
    \begin{align}
        P&=\omega\cdot M_{B,z} = \underbrace{r\cdot \frac{v_1}{2}}_{r\cdot u}\cdot \underbrace{r\cdot\dot{m}\cdot v_1}_{M_{B,z}} \notag \\
        &= r^2\cdot\dot{m}\cdot\frac{v_1^2}{2} = r^2\cdot \rho \cdot \frac{v_1^3}{2}\cdot A_{\rm jet}
    \end{align}
\end{examplebox}

\begin{examplebox}{Lawn sprinkler}
    \includegraphics[width=\textwidth]{media/rasensprenger_orig.png}
    \subsubsection{Tangential (flat) jet exit}
    \vspace*{-0.3cm}
    \begin{gather}
        \dot{\vec{D}}_{{\rm out},z} - \dot{\vec{D}}_{{\rm in},z} = M_{B,z} \notag \\
        \dot{\vec{D}}_{{\rm out},z} = -2r\cdot \dot{m}\cdot v_1 = -2r\cdot \dot{m}\cdot \left(w_u - u\right)\\
        \dot{\vec{D}}_{{\rm in},z} = 0
    \end{gather}

    \subsubsection{Deflection $\alpha$ in plane, tilt $\beta$ out of plane}
    \vspace*{-0.3cm}
    \begin{gather}
        w_{xy} = \cos\beta w_1, \quad w_z = \sin\beta w_1 \\
        w_u = \cos\alpha w_{xy} = \cos\alpha\cos\beta w_1 \quad v_u = w_u - u
    \end{gather}
\end{examplebox}
\end{multicols}

\newpage
\thispagestyle{empty}
\includegraphics[width=\textwidth]{media/angular_formulas.png}






\end{document}