News

Classes just started again. I've been thinking about proteins in my research and preparing for grad apps.

Latest Posts

[August 29, 2025:] Economics of Efficiency
[June 6, 2025:] A New Era
[June 6, 2025:] Bourgain's Problem Resolved!

Notes

Started taking live LaTeX notes in classes again. I might be uploading stuff soon!

Sea 🌊

This is something I'm working on!

Orange Juice

Now my "professional" website.

Mlog


MECENG 106 Notes: Fluid Dynamics

Fall 2024
By Aathreya Kadambi
Expanding on Lectures by Professor Phil Marcus

This fall I’m taking a fluid dynamics class by Professor Phil Marcus at Berkeley! Coincidentally, I actually was really interested in his research on Jupyter’s red spot and these related problems in freshman year, although I ended up going down a different road for a while. Excited to learn fluid dynamics.

Chapter 1: Hydrostatics

Story 1: Dimensions

Relevant lectures: Lecture 1

The lecture notes have anything you need to succeed. You are also strongly recommended to work in teams on the homework. Homework are combination of graded and self-graded. Feel free to go to any discussion section.

When you write down equations, you should keep track of the dimensions of the quanities in the equation. If you are taking the sin⁑\sin or log⁑\log of something, it better be dimensionless.

Dimensional analysis is very important. In fact, people were able to find the energy in the atomic bomb (which was a well-kept secret) based on the speed of the shock wave.

Dimensions are things like length, time, mass, etc.. It is important to distinguish these things from units, which we use to measure these dimensions.

Remark. I’ll leave out the examples and discussion of dimensional analysis and units and things like that, since one can find good treatment of that subject in practically any thick science textbook. One thing I will mention is that apparently there’s actually a unit of temperature called β€œRankine”. I’ve never seen that before.

Story 2: Properties of Fluids

Relevant lectures: Lectures 1, 2

Our properties are going to be functions of space and time: x∈R3\textbf{x} \in \R^3 and t∈Rt \in \R. Here are some important properties:

The following properties live in Maps(R3Γ—R,R)\text{Maps}(\R^3\times \R, \R).

  • Temperature: Temp\text{Temp}.
  • Mass Density: ρ=massVolume\rho = \frac{\text{mass}}{\text{Volume}}. It has dimensions MLβˆ’3ML^{-3} in MLT units.
  • Pressure: P=forceareaP = \frac{\text{force}}{\text{area}}. It has dimensions MLβˆ’1Tβˆ’2ML^{-1}T^{-2} in MLT units.
  • Velocity: VV. It has dimensions LTβˆ’2LT^{-2}.

Remark. Notice how we are treating these quantities in a continuum. I was thinking about it, and I guess this means in terms of temperature for example, we can treat each particle or molecule as a Dirac function, and the temperature in a region is the expected value of the temperature in that region when one integrates. That feels somewhat nice because it gives this intutiion of temperature over a region being looking at space in a lower resolution.

In fluid dynamics, we will write the ideal gas law as:

P=RρTP = R\rho T
RR is called the gas constant, and the other quantities were discussed above.

In physics we generally use the form PV=nRTPV = nRT. So what is the relationship between these two forms? In physics one has to look up the molecular weights and stuff, and in MechE, we have to look up individual gas constants for each gas.

Ideal gas equation of state:

P=RρTP = R\rho T
or in physics,
PV=nRphysicsTPV = nR_{\text{physics}}T
Notice that
ρ=MV=νphysicsnV\rho = \frac{M}{V} = \frac{\nu_{\text{physics}}n}{V}
so solving for nn, n=ρVνphysicsn = \frac{\rho V}{\nu_{\text{physics}}}. Substituting this into the previous equation, we find that
P=RphysicsνphysicsρTP = \frac{R_{\text{physics}}}{\nu_{\text{physics}}} \rho T
so we’ve found that
R=RphysicsΞ½physics\boxed{R = \frac{R_{\text{physics}}}{\nu_{\text{physics}}}}

Story 3: Viscosity

Viscosity is about roughly how well things flow. Physically, it is a diffusion coefficient of momentum.

In fluid dynamics, we have so called boundary conditions. For a Newtonian fluid, the boundary conditions are that the fluid at any surface in the direction that is parallel to the surface must move at the same velocity as the surface. This is called the no-slip boundary condition. The zeroness of momentum diffuses into the middle so that for honey, where that diffusion would happen very quickly for example, the momentum in the middle will also be close to zero. For water on the other hand, the momentum in the middle might be high even if the momentum at the surface is zero.

So far what we have discussed is called the kinematic viscosity. There is another viscosity called dynamic viscosity, which satisfies Ξ½dyn=ρνkin.\nu_{\text{dyn}} = \rho \nu_{\text{kin}}. From now on, Ξ½\nu will refer to kinematic viscosity. There is a dimensionless quantity called the Reynold’s number, defined: Re=[V][L]Ξ½\text{Re} = \frac{[V][L]}{\nu} where we are using brackets here to indicate β€œcharacteristic values”. When Re≀103\text{Re} \le 10^3, we call it laminar, when it is β‰₯105\ge 10^5 we call it turbulent, and in between this, we call it transitional.

For 3D flows, it is extremely difficult to make calculations in the transitional region without approximations. That’s why you need to take MECENG 106, because that is one of the hardest places to calculate flows.

Example. Consider water out of a tap. The characteristic volume and length are 5β€…β€Šcm/s5\; cm/s and 1β€…β€Šcm1\; cm, and the viscosity is 0.01β€…β€Šcm2/s0.01 \;cm^2/s. As such,

Re=5β‹…10.01=500\text{Re} = \frac{5\cdot 1}{0.01} = 500
so tap water flows are fairly laminar. Consider now a hurricane. There, the characteristic velocity is 104β€…β€Šcm/s10^4 \; cm/s, the characteristic length is 107β€…β€Šcm10^7 \; cm, and the viscosity is 0.1β€…β€Šcm2/s0.1 \; cm^2/s. Thus the Reynolds number is Re=1012\text{Re} = 10^{12} so this flow is clearly very turbulent.

Remark. You can compute the transition point for smoke flowing up, when it transitions through different types of flow. Why do we define the Reynold’s number like that?

Story 4: Pressure

Relevant Lectures: Lecture 2

Consider an area. This vector has normal inward vector. We might write: dF=n^PdAdF = \hat n P dA so that the integral is ∫df=∫n^PdA\int df = \int \hat n P dA A question is, if we change our orientation, then do we get a different force or something? It turns out that the magnitude is independent.

We will show this in the static case, namely where

  • V≑0V \equiv 0
  • βˆ‚βˆ‚t=0\frac{\partial}{\partial t} = 0

Now let’s imagine a little piece of swiss cheese (proceeds to draw an inclined plane with angle theta).

Chapter 2: Go with the Flow

Story 1: Towards Continuity and Conservation

In the following, we’re going to pretend we know some information: the density ρ\rho (a distribution on R3\R^3 representing mass), FM\mathbf{F}_M (an idea of flux), and QQ (another distribution on R3\R^3 representing creation/destruction of mass).

Consider any fixed region (volume) V∈R3V \in \R^3, and imagine R3\R^3 filled with a fluid. The density of this fluid is given by ρ(x,y,z,t)\rho(x,y,z,t). Then we can obtain a fwe quantities directly:

  • Total Mass of Fluid in Container: ∫VΟβ€…β€ŠdV\int_V \rho \;dV (summing up the density function)
  • Time Rate of Change of Total Mass of Fluid in Container: dM(t)/dt=∫Vβˆ‚Οβˆ‚tdVdM(t)/dt = \int_V \frac{\partial \rho}{\partial t} dV
  • Flux Through The Boundary/Surface (Rate of transport of mass from outside to inside): MΛ™transport=βˆ«βˆ‚VFMβ‹…n^β€…β€ŠdA=:βˆ«βˆ‚VFMβ‹…dAβƒ—=βˆ’βˆ«Vβˆ‡β‹…FMβ€…β€ŠdV\dot{M}_{\text{transport}} = \int_{\partial V} \mathbf{F}_M \cdot \hat{n}\; dA =: \int_{\partial V} \mathbf{F}_M \cdot d\vec{A} = -\int_V \nabla \cdot \mathbf{F}_M\;dV
    • FM\mathbf{F}_M is defined so that (FMβ‹…n^)β€…β€ŠdA(\mathbf{F}_M \cdot \hat{\mathbf{n}}) \; dA is the time rate at which mass passes through the surface element

Then we find that the change in the total mass of the region can only change when mass is created or destroyed within the region, or when it flows in through the boundary. This gives us: ∫Vβˆ‚Οβˆ‚tdV=βˆ’βˆ«Vβˆ‡β‹…FM+Qβ€…β€ŠdV\int_V \frac{\partial \rho}{\partial t} dV = -\int_V \nabla \cdot \mathbf{F}_M + Q\;dV and since this holds for all regions VV, we find that

βˆ‚Οβˆ‚t=βˆ’βˆ‡β‹…FM+Q.\boxed{\frac{\partial \rho}{\partial t} = -\nabla \cdot \mathbf{F}_M + Q}.

Story 2: Mass and Momentum Go with the Flow

We theorize that mass β€œgoes with the flow” in the sense that, as Professor Marcus puts it, β€œtransport of mass in a fluid is due to the fluid velocity”. Mathematically,

FM=ρv.\mathbf{F}_M = \rho \mathbf{v}.
This sort of makes sense in a dimensional-analysis sort of way, and also intuitively: mass flows at a rate dictated by the velocity. Substituting this into our equation, and considering the case in which mass cannot be created nor destroyed (so Q=0Q = 0),
βˆ‚Οβˆ‚t=βˆ’βˆ‡β‹…(ρv)=βˆ’Οβˆ‡β‹…vβˆ’βˆ‡Οβ‹…v.\frac{\partial \rho}{\partial t} = -\nabla \cdot (\rho \mathbf{v}) = -\rho \nabla \cdot \mathbf{v} - \nabla \rho \cdot \mathbf{v}.
which is called the continuity equation or the conservation of mass. We rewrite this as:
βˆ‚Οβˆ‚t+(vβ‹…βˆ‡)ρ=βˆ’Ο(βˆ‡β‹…v).\boxed{\frac{\partial \rho}{\partial t} + (\mathbf{v}\cdot \nabla)\rho = -\rho(\nabla \cdot \mathbf{v})}.
In the special case where ρ\rho is constant, we find that this is the same as βˆ‡β‹…v=0\boxed{\nabla \cdot v = 0}.

In general, if we make the assumption that a quantity β€œgoes with the flow” and know the density of the quantitiy, we can write an expression for F\mathbf{F} and get an appropriate continuity or conservation law. Another important example is momentum. In the case of momentum, the density is something like β€œmass times velocity”. Since velocity is a vector quantity though, and we want a scalar density field, we instead choose a particular direction called the β€œaccounting direction”, which we will use to study momentum flow in that direction. If we take a certain direction d^\hat{d}, and write vd=vβƒ—β‹…d^v_d = \vec{v} \cdot \hat{d}, then we can take the scalar density field ρvd\rho v_d, and end up with the expression:

FMOMd=ρvdv.\mathbf{F}_{MOM_d} = \rho v_d \mathbf{v}.
Plugging this into our conclusion from the last story,
βˆ‚Οβˆ‚t=βˆ’βˆ‡β‹…(ρvdv)+QMOMd.\frac{\partial \rho}{\partial t} = -\nabla \cdot (\rho v_d \mathbf{v}) + Q_{MOM_d}.
Note that unlike for mass, it is harder to say that momentum cannot be created nor destroyed. In fact, by Newton’s laws, forces are β€œsources” of momentum. Now for simplicity I’ll take my accounting direction d^\hat{d} to be z^\hat{z}, but this can be applied in any direction. By definition, βˆ’βˆ‡Pβ‹…z^-\nabla P \cdot \hat{z} is the force per unit volume due to pressure of our fluid. We may also have external forces, for example due to gravity, which would contribute βˆ’gρz^-g\rho \hat{z}. Substituting this in for QMOMzQ_{MOM_z}, we get:
βˆ‚(ρvz)βˆ‚t=βˆ’βˆ‡β‹…(ρvzv)βˆ’βˆ‚Pβˆ‚zβˆ’gρ\frac{\partial (\rho v_z)}{\partial t} = -\nabla \cdot (\rho v_z \mathbf{v}) - \frac{\partial P}{\partial z} - g\rho.
which is the zz-component of Euler’s equation. In the static case, this reduces to our usual hydrostatic equation!

Now if we simplify this equation and also use the conservation of mass equation from before, we can actually simplify this into the form:

βˆ‚vzβˆ‚t+(vβ‹…βˆ‡)vz=βˆ’1Οβˆ‚Pβˆ‚zβˆ’g\frac{\partial v_z}{\partial t} + (\mathbf{v} \cdot \nabla)v_z = -\frac{1}{\rho}\frac{\partial P}{\partial z} - g
And similar equations in the xx and yy directions can be combined to give the overall Euler’s equation:
βˆ‚vβˆ‚t+(vβ‹…βˆ‡)v=βˆ’1Οβˆ‡Pβˆ’gz^.\boxed{\frac{\partial \mathbf{v}}{\partial t} + (\mathbf{v}\cdot \nabla)\mathbf{v} = -\frac{1}{\rho}\nabla P - g\hat{z}}.

We actually have a special name for the βˆ‚βˆ‚t+vβ‹…βˆ‡\frac{\partial}{\partial t} + \mathbf{v}\cdot \nabla operator: it is called the Lagrangian time derivative, or the material or advective or convective derivative. This is kind of like the total time derivative from the perspective of someone who is moving, taking their motion into account via chain rule. A Lagrangian particle is a particle which β€œgoes with the flow”, so the Lagrangian derivative is the rate of change in time as observed by a Lagrangian particle.

To summarize, the Euler equation and continuity equation can be written:

DvDt=βˆ’1Οβˆ‡Pβˆ’gz^\frac{D\mathbf{v}}{Dt} = -\frac{1}{\rho}\nabla P - g\hat{z}
DρDt=βˆ’Ο(βˆ‡β‹…v)\frac{D\rho}{Dt} = -\rho(\nabla \cdot \mathbf{v})

Story 3: Vorticity and Bernoulli’s Theorem

We call the curl of the velocity vector field vorticity: Ο‰=βˆ‡Γ—v\mathbf{\omega} = \nabla \times \mathbf{v}. This satisfies the following identity:

vΓ—Ο‰βˆ’12βˆ‡βˆ₯vβˆ₯2β‰‘βˆ’(vβ‹…βˆ‡)v\mathbf{v} \times \mathbf{\omega} - \frac{1}{2}\nabla\|v\|^2 \equiv -(\mathbf{v} \cdot \nabla)\mathbf{v}
(I’ll leave this as an exercise to the reader). Then substituting into Euler’s equation gives:
βˆ‚vβˆ‚t=vΓ—Ο‰βˆ’12βˆ‡βˆ₯vβˆ₯2βˆ’1Οβˆ‡Pβˆ’βˆ‡Ο•\frac{\partial\mathbf{v}}{\partial t} = \mathbf{v}\times \mathbf{\omega} - \frac{1}{2}\nabla \|v\|^2 - \frac{1}{\rho}\nabla P - \nabla \phi
where Ο•=gz\phi = gz is the gravitational potential.

Now there are a few important definitions:

  • Streamline: a continuous curve tangent to v\mathbf{v} everywhere
    • Cannot be visualized in an experiment
  • Pathline: path of a particle that β€œgoes with the flow”
    • When velocity is independent of time, pathlines and streamlines are the same
  • Streakline: path created by a bunch of particles released at every time up to a certain point

Finally, we can discover Bernoulli’s equation by dotting our expression with s^=vβˆ₯vβˆ₯\hat{\mathbf{s}} = \frac{\mathbf{v}}{\|\mathbf{v}\|} and noting that (s^β‹…βˆ‡)Q=βˆ‚Qβˆ‚s(\hat{\mathbf{s}}\cdot \nabla)Q = \frac{\partial Q}{\partial s}, and considering the case of a steady flow so that βˆ‚vβˆ‚t=0\frac{\partial \mathbf{v}}{\partial t} = 0:

βˆ‚βˆ‚s[12βˆ₯vβˆ₯2+1ρP+gz]=0\boxed{\frac{\partial}{\partial s}\left[\frac{1}{2}\|v\|^2 + \frac{1}{\rho} P + gz\right] = 0}
so 12βˆ₯vβˆ₯2+1ρP+gz\frac{1}{2}\|v\|^2 + \frac{1}{\rho} P + gz is constant along streamlines.

Remark. In what we have done so far, we have not accounted for viscous effects. As such, we should be wary of applying Bernoulli’s equation or Euler’s equation to situations where viscous effects matter.

Story 4: Energy and the Breakdown of Bernoulli

Remark. This story is motivated by my trauma from midterm 2. I knowingly used Bernoulli in a place it probably wasn’t applicable to avoid the possible pains and time stress of a control volume approach, but to my horror and demise, this wasn’t a valid approximation.

At the time, my deluded justification was that for a propeller, there should be points in time where air above and below the propeller are connected spatially (there isn’t a propeller fan in the way) although to be fair they are always connected spatially. I used this idea of path connectedness to justify having a streamline and applying Bernoulli. After all, streamlines are curves that are at all points tangent to the velocity field, so there should be some time t0t_0 where we can find a streamline there, when the propeller isn’t in the way. Yeah… I was a fool and got cooked on that midterm as a result.

So in this story, we will learn from my mistakes and learn where the ideas of Bernoulli functions break down.



As a fun fact, it might seem like this website is flat because you're viewing it on a flat screen, but the curvature of this website actually isn't zero. ;-)

Copyright Β© 2024, Aathreya Kadambi

Made with Astrojs, React, and Tailwind.