welcome back in the last video we derived gauss's divergence theorem which is an extremely powerful
equality in vector calculus that allows us to derive partial differential equations so in
particular what gauss's theorem allows us to do is equate the flux of a quantity through some surface
s given by let's say i have a fluid flow given by this vector field f and that fluid flow is moving
material mass and energy and momentum around in space and if i want to compute how much of that
quantity is passing through this surface s i can compute that one of two ways i can either compute
that by integrating this vector field f dot it into the normal direction and integrate that
along the surface that would essentially add up how all of the stuff is moving through the surface
or equivalently and this is gauss's divergence theorem i can compute the divergence of f
everywhere in this volume and integrate up all of those divergences over the entire volume
so it essentially gives us a way of equating a volume integral of divergences
that equals a surface integral of this f dotted into the normal and we used it in the last lecture
to derive this mass conservation equation this this mass continuity partial differential equation
assuming that we have uh some some fluid flow carrying mass you know that has some density rho
so rho is the density of my fluid in all of space and time it's a scalar function
and this vector field f is moving mass around it's just moving air or water around let's say in the
in the atmosphere or in the ocean or something like that and so we could write that the total
rate of change of mass in my volume is equal to the amount of mass that is being carried
in and carried out of that volume by the fluid so if i have a total net amount of fluid leaving the
volume so f dot n is positive if i have a total amount of fluid leaving the volume through the
surface of this then that would correspond to a negative rate of change of mass inside the volume
this is just basic accounting and again gauss's divergence theorem says that i can take this
surface integral integrating up around the surface and i can write that as a volume integral for the
divergence of that quantity that i'm computing and so maybe i'll just make this very explicit
this step here is where we used gauss's theorem okay so this step from the surface integral to
this volume integral is how we used gauss's divergence theorem that allowed us to take
this quantity here which is in a volume integral and get another expression under a volume integral
so i can have them kind of under the same volume integral and what we said is that this is true for
all volumes v and so essentially if this is true for all volumes you get this partial differential
equation so the thing inside has to equal 0 if this integral is equal to 0 for all volumes v
that's just kind of a nice physical argument now i want to do a few things here
I want to point out that these conservation laws are extremely powerful
if you draw a volume... a sufficiently large volume V
this is called a control volume sometimes in fluids or in physics.
This can include things like: if there is a nuclear bomb going off in that, or if I have
...I don't know, some death star creating some focused laser that explodes a planet.
Okay if my control volume is large enough that it includes all of those effects and it's kind of you
know large enough that it includes that, then this basic conservation is still going to be true
inside of this volume. So it's a very powerful idea is to compute these integrals
over these volumes. A couple things I want to point out that I did not include in my last lecture and
I want to make this a little more general. So the total rate of change of mass in my volume is equal
to the amount of mass carried out of the volume or into the volume but you can also have plus
a source term, some volume integral of a source term dv. So for example if I actually detonated a
nuclear bomb inside of my control volume I'm actually converting mass purely into energy
and so I actually would have a negative Q very locally at this point i would have a negative Q
and I'd have to integrate that up over the volume. So technically speaking my expression here is only
true if mass is neither created nor destroyed if the quantity I'm conserving is not created
or destroyed but if you can have a source of Q either you know maybe you create mass
from energy or maybe you destroy mass and it turns into energy then you can
have these source terms added to this equation and it would basically be this equation equals
a source term. There would be some source term in space and time forcing this partial differential equation.
So that's that's one important thing is that
uh we need to think about is the assumption of mass conservation really true for a simple fluid
flow if i just follow you know the fluid flow in the ocean absolutely mass is not being created or
destroyed if i follow you know the air in the atmosphere even if a jet's flying through it
mass is not being created or destroyed but sometimes when i have a complicated enough
physical process like you know i'm actually fusing atoms or splitting atoms then i might
actually have to have these source terms here but that's the really cool thing about kind of partial
differential equations and control volumes and gauss's theorem is that you can still apply these
arguments if you're careful even you know if your control volume has really gnarly physics going on
uh now everything is always true in the control volume sense this is always true
this expression here okay the one that i've written here and i'm highlighting with my hand
always true when we convert it into this expression here using gauss's divergence theorem
and when we say that this is true for all volumes v to get this partial differential
equation that step relies on the quantity where we're saying is conserved mass momentum energy
and the fluid flow that's carrying it around f being sufficiently smooth or continuous
that i can kind of take the limit over any volume and still have this be true and remember that
picture i showed with the divergence where we uh we kind of split this into a bunch of boxes and
we had a bunch of local divergences that cancelled out if i have a abrupt enough change in my vector
field so it abruptly changes like that if i have a shock function you know a step function in f or
i have a shock wave so i have an instantaneous change in rho then that argument that pillbox
argument that gauss's theorem is derived on that these are essentially canceling each other out
that kind of breaks down okay and so that just gives you some idea that if your f or your row
if the thing you're carrying around and if the vector field that's carrying it around
if those are discontinuous then you can't kind of take this step here the gauss's theorem step
and you can't remove this volume integral because if i have a discontinuous row or f
these will kind of blow up to infinity i can't compute the derivative of a step function and have
it still be finite so this doesn't really make sense for discontinuous functions like shock waves
and so that's actually why if we look at you know supersonic jets i really need to think
about it in a control volume setting it's harder to think about it using using these pdes okay so
that's i think something i really wanted to to point out just so that you know you can
include kind of other physics like sources and sinks you know creation and destruction of mass
through these source terms and the step where we go from a volume integral to a partial
differential equation relies on things being smooth this doesn't work for shock waves and
discontinuous dynamics you kind of have to work in the control volume if that's if that's the case
and you can still compute these things approximately numerically and so that's okay
we can still compute you know what happens but we we sometimes have to use different
computational strategies good now what i want to point out is if
rho is constant so if rho is constant then we have an incompressible flow literally means like if you
if you take liquid water liquid water is very very hard to to compress it's very hard to change the
density of your water you can smash it you can you know accelerate it you can do all this stuff
the density of your water is not going to change much okay and so that's an incompressible fluid
air the air that is around us if i just wave my arms or move
you know my mouth or whatever that air is also approximately incompressible on these time scales
if i just move my hand i can feel a breeze but that density is really not changing just because
i'm moving my hands you have to go you know close to the speed of sound so you have to go to like
mock point point 0.3 or 0.1 or you know some some appreciable uh fraction of the speed of sound
before you actually start stacking up and compressing the air and changing its density
uh in space and time so my point being that this equation is general enough to handle
fully compressible fluid flows where the density changes this is okay you know for
jets flying where the the density of the air is actually changing because they're kind of
ramming the air together and forming these these kind of density waves but if the air or the water
is incompressible if the density doesn't change at all then we can derive special conditions on this
differential equation so that's what i want to do now and this is kind of an exercise to get you
thinking about how you can manipulate these things with more physical knowledge so here we only use
mass conservation but again if we know something extra like we have constant density we can do even
more we can simplify this even more so let's do that what i'm going to do is i am going to
actually compute what this term looks like so if i have uh del dot
f and again we're going to assume that f has three components let's say that this is um f1 f2 f3
and these are all functions of x y and z and time okay so this is an unsteady flow in space and time
then this is equal to partial partial x of
rho f1 plus partial uh partial y of row f2 plus partial partial z of rho
f3 and i feel like i'm going to make a typo so just please follow along carefully and make sure
that you agree with with this now if rho can vary then i actually have to compute this derivative
using the chain rule this would be partial row partial x f1 plus rho partial f1 partial x and
so i'm actually going to write this out maybe i'll change colors here so this equals and i'm going to
use subscript to denote partial derivative so this would equal rho sub x f1 plus rho
f 1 sub x that's the partial of f1 with respect to x okay that's the first term plus
same thing rho sub y f2 plus rho f2 sub y and now the third term is rho sub z f3
plus rho f3 sub z partial of f3 with respect to z and i can collect my terms here i can
collect my like terms i can take all of my rows that have no partial derivatives
and i can take all of my rows that do have partial derivatives
and i can bring those into into two different expressions and so what this equals is um
this equals all of my let's let's take my yellow terms first here so this is rho times
the divergence of f this is rho times div dot f okay that's you know partial of f1 with respect
to x plus partial of f2 with respect to y plus partial of f3 with respect to z that's
the divergence of f so these yellow terms are just row times the divergence of f the pink terms are
the gradient of rho literally grad rho rho sub x rho sub y rho sub z dotted with f so rho sub x
times the first component of f rho sub y times the second component of f rho sub z times the third
component of f that's the gradient of rho dotted with f and so so i'm just showing you kind of what
we do when we when we kind of do the chain rule to this expression here my divergence of rho times
f the the momentum the mass that's being carried through with f gives me these two terms here
so here's where it gets interesting okay if i got to giving myself a place to live if
the fluid is incompressible incompressible fluid like water liquid water is a great example or i
don't know if mercury is incompressible i guess it is if my fluid is incompressible
i guess liquids in general are incompressible typically if my fluid is incompressible then
rho is a constant the density is a constant the density can't be changed just by moving
the fluid around and if the density is constant then what that means is that partial rho partial t
is equal to zero like it can't change in time and uh the div sorry the gradient of row
is equal to zero rho doesn't change as i move along in x or y or z okay it's a constant and
so if my fluid is incompressible so if my density is a constant if rho is a constant
then these two things have to be true and what that means is that this term
is zero and when i split this into these two terms the pink term has to be 0 also
and so what i end up getting when i expand this out i have partial rho partial t plus
rho divergence of f plus gradient of rho dotted with f all of that equals again this
originally equaled zero when i uh didn't have uh you know when i didn't have some source term
this all equals zero but because of my incompressibility uh this term is zero and the
gradient of row is equal to zero and so and rho is a constant i can just divide both sides by row
and so what that means is that i have for an incompressible flow the divergence of my fluid
vector field f has to equal 0. again this is the mass continuity equation for incompressible flows
this means that my flows have to be divergence free so if i have the flow of liquid water you
know around the ocean kind of the gulf stream or whatever that flow has to be divergence free
to satisfy the incompressibility of rho and that's a really really powerful result again
we use gauss's theorem to derive the basic basic partial differential equation for how mass moves
around in a fluid and that can include all kinds of weird effects you know compressible effects
but if we know that our fluid is incompressible like liquid water so we know that rho is a
constant we can do things like kill off different terms in the equation and get a simpler expression
for that vector field f so this divergence free condition or this kind of continuity equation
the divergence of f equals 0 is a really really important equation for incompressible flows
this is a statement of conservation of mass for incompressible flows if my density doesn't change
this is how mass is conserved okay so that gives you an idea of kind of um some of the
caveats how you can extend this to include even more interesting physics when you can and cannot
go from a volume integral to a real honest-to-goodness partial differential
equation for example if you have shock waves in your flow or discontinuities
you know supersonic jets would be a case like that and then also how if you have extra knowledge
about your fluid if you know something about this this flow like the density is constant for
incompressible flows then you can get even simpler expressions like this is the exact same expression
for an incompressible flow so really cool stuff we can also use this kind of basic framework
instead of carrying around mass conservation in a volume we could keep track of the conservation
of momentum in a volume and we would derive instead of the continuity equation the navy
or stokes equations so the navy or stokes equations are kind of this exact procedure
for the conservation of momentum in a volume with a fluid carrying it around you could also do this
for the conservation of energy again if you had thermal flows or you know combusting flows or
you know nuclear blast flows you need an energy equation to keep track of kind of the
thermodynamics of the situation too but again as long as you know basic conservation laws
that stuff just doesn't come from nowhere you know there's source terms and sync terms maybe
you can derive these pdes and analyze them all right thank you