{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# The Material Derivative\n", "\n", "## Learning outcomes\n", "\n", "* Understand the chain rule and the material derivative\n", "\n", "The material derivative (or the substantive derivative) is an important concept in the analysis of fluid flow so it is worth taking some time to understand it.\n", "\n", "Consider a time invariant flow in a nozzle. The continuity equation tells us that for a given mass flow rate the velocity must increase as the area is reduced. However for an observer or a probe situated at a fixed point in the nozzle the velocity appears constant. The probe would have to move up or downstream to observe a change in the velocity — the streamwise velocity gradient.\n", "\n", "Similarly for a time-invariant flow such as that in a bending tube the point probe measurement will not detect the curvature of the velocity field and so the change in velocity direction, or the curvature of a pathline, is only apparent when moving the probe location and comparing differences in the observations.\n", "\n", "The material derivative is therefore a way to express this change in a quantity such a the velocity at a point in the flow. It maps the **Lagrangian trajectory** of a particle onto an **Eulerian point** in the flow.\n", "\n", "From another perspective consider a particle of fluid with some property such as temperature $T$ traveling along its pathline at a uniform velocity. The flow field will transport (or advect) the particle, but its temperature isn't changing — the Lagrangian derivative with respect to time is zero. However the Eulerian derivative will increase or decrease as the particle is advected across our fixed measurement location in particular as you increase or decrease the uniform velocity of the flow.\n", "\n", "Let's look at this in more detail.\n", "\n", "If we consider again a fluid particle moving along its pathline, i.e. the location of that particle relative to our coordinate system as a function of time, that particle undergoes acceleration as it changes direction or velocity. Acceleration being the time rate of change of velocity.\n", "\n", "For particle $p$ we can write an expression for its velocity as:\n", "\n", "\\begin{equation}\n", "\\vec{{}V_p}(r_p,t) = \\vec{{}V_p}[x_p(t), y_p(t), z_p(t),t]\n", "\\label{eq1}\n", "\\tag{1}\n", "\\end{equation}\n", "\n", "where $x_p = x_p(t)$, $y_p = y_p(t)$ and $z_p = z_p(t)$ define the Cartesian location of the particle at time $t$. As stated, a change in velocity may be due to a change in the speed of the particle or a change in the direction in which it is traveling. To take the derivative of equation \\ref{eq1} to obtain the acceleration of our particle we need to use the chain rule.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## The Chain Rule" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The chain rule is a formula to compute the derivative of compositions of functions, or functions within functions. In this case we have the derivative with respect to time and the derivative with respect to position which itself is dependent on time. That's why the variables in the square brackets in equation 1 all contain a $t$.\n", "\n", "To simplify, lets consider a composite function where some variable $z$ depends on $y$ which itself depends on $x$. We can expand the derivative of z with respect to x as follows: \n", "\n", "\\begin{equation}\n", "\\frac{dz}{dx} = \\frac{dz}{dy} \\cdot \\frac{dy}{dx}\n", "\\tag{2}\n", "\\end{equation}\n", "\n", "For partial derivatives (where we use $\\partial$) the chain rule can be understood as follows.\n", "If some function $u = u(x,y)$ and the independent variables $x$ and $y$ are each a function of $t$ such that $x = x(t)$ and $y = y(t)$ the derivative $du/dt$ can be obtained:\n", "\n", "\\begin{equation}\n", "\\delta{u} = \\frac{\\partial{u}}{\\partial{x}} \\delta{x} +\n", " \\frac{\\partial{u}}{\\partial{y}} \\delta{y}\n", "\\tag{3}\n", "\\end{equation}\n", "\n", "As $\\delta{x}\\rightarrow0$, $\\delta{y}\\rightarrow0$, and $\\delta{t}\\rightarrow0$ yielding:\n", "\n", "\\begin{equation}\n", "\\frac{d{u}}{d{t}} = \\frac{\\partial{u}}{\\partial{x}} \\frac{d{x}}{d{t}} +\n", " \\frac{\\partial{u}}{\\partial{y}} \\frac{d{y}}{d{t}}\n", "\\tag{4}\n", "\\end{equation}\n", "\n", "Here we have a mix of $\\partial$ and $d$. This is because $x$ and $y$ are functions of only one variable $t$, while $u$ is a function of $x$ and $y$.\n", "\n", "You can learn more about the chain rule here:\n", "\n", "https://www.khanacademy.org/math/ap-calculus-ab/ab-differentiation-2-new/ab-3-1a/v/chain-rule-introduction\n", "\n", "and here:\n", "\n", "https://www.youtube.com/watch?v=YG15m2VwSjA\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "So to differentiate equation 1:\n", "\n", "\\begin{equation}\n", "\\vec{{}a_p}(t) = \\frac{d\\vec{{V_p}}}{dt} = \n", " \\frac{\\partial\\vec{{V_p}}}{\\partial{t}}\\frac{dt}{dt} + \n", " \\frac{\\partial\\vec{{V_p}}}{\\partial{x}}\\frac{dx_p}{dt} +\n", " \\frac{\\partial\\vec{{V_p}}}{\\partial{y}}\\frac{dy_p}{dt} + \n", " \\frac{\\partial\\vec{{V_p}}}{\\partial{z}}\\frac{dz_p}{dt}\n", "\\label{eq5}\n", "\\tag{5}\n", "\\end{equation}\n", "\n", "Since the velocity components are $u_p = dx_p/dt$, $v_p = dy_p/dt$ and $w_p = dz_p/dt$ we obtain:\n", "\n", "\\begin{equation}\n", "\\vec{{}a_p} = \\frac{\\partial\\vec{{V_p}}}{\\partial{t}} + \n", " u_p \\frac{\\partial\\vec{{V_p}}}{\\partial{x}} +\n", " v_p \\frac{\\partial\\vec{{V_p}}}{\\partial{y}} +\n", " w_p \\frac{\\partial\\vec{{V_p}}}{\\partial{z}}\n", "\\label{eq6}\n", "\\tag{6}\n", "\\end{equation}\n", "\n", "or generally for any particle:\n", "\n", "\\begin{equation}\n", "\\vec{{}a} = \\frac{\\partial\\vec{{V}}}{\\partial{t}} + \n", " u \\frac{\\partial\\vec{{V}}}{\\partial{x}} +\n", " v \\frac{\\partial\\vec{{V}}}{\\partial{y}} +\n", " w \\frac{\\partial\\vec{{V}}}{\\partial{z}}\n", "\\label{eq7}\n", "\\tag{7}\n", "\\end{equation}\n", "\n", "The scalar components of the vector $\\vec{{}a}$ can be decomposed as:\n", "\n", "\\begin{align}\n", "a_x &= \\frac{\\partial{u}}{\\partial{t}} + \n", " u \\frac{\\partial{u}}{\\partial{x}} +\n", " v \\frac{\\partial{u}}{\\partial{y}} +\n", " w \\frac{\\partial{u}}{\\partial{z}} \n", "\\tag{8}\n", "\\end{align}\n", "\\begin{align}\n", "a_y &= \\frac{\\partial{v}}{\\partial{t}} + \n", " u \\frac{\\partial{v}}{\\partial{x}} +\n", " v \\frac{\\partial{v}}{\\partial{y}} +\n", " w \\frac{\\partial{v}}{\\partial{z}}\n", "\\tag{9}\n", "\\end{align}\n", "\\begin{align}\n", "a_z &= \\frac{\\partial{w}}{\\partial{t}} + \n", " u \\frac{\\partial{w}}{\\partial{x}} +\n", " v \\frac{\\partial{w}}{\\partial{y}} +\n", " w \\frac{\\partial{w}}{\\partial{z}}\n", "\\tag{10}\n", "\\end{align}\n", "\n", "We write equation \\ref{eq7} in shorthand notation as:\n", "\n", "\\begin{equation}\n", "\\vec{{}a} = \\frac{D \\vec{{}V} }{Dt} \\equiv \n", "\\frac{\\partial{\\vec{{}V}}}{\\partial{t}} + \\vec{{}V} \\cdot \\nabla{\\vec{{}V}}\n", "\\label{eq8}\n", "\\tag{11}\n", "\\end{equation}\n", "\n", "The symbol $\\nabla$, 'nabla' is used as short hand in vector calculus to represent the **gradient**.\n", "\n", "The Material Derivative of any variable (scalar or vector) is the rate at which that variable changes in time for a given particle in a Lagrangian frame of reference, i.e. along its pathline. We can use it to describe the temperature or momentum (or whatever we are interested in) of a particle, not just acceleration. To reiterate, it acts as a link between the Lagrangian and the Eulerian descriptions as it tells us how a property of a particle changes as it moves across the Eulerian grid." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.6" } }, "nbformat": 4, "nbformat_minor": 2 }