# Flux in three dimensions

Also known as a surface integral in a vector field, three-dimensional flux measures of how much a fluid flows through a given surface.

## Background

Not strictly required, but useful for analogy:

## What we are building to

• When you have a fluid flowing in three-dimensional space, and a surface sitting in that space, the flux through that surface is a measure of the rate at which fluid is flowing through it.
• Flux can be computed with the following surface integral:
\begin{aligned} \iint_\redE{S} \blueE{\textbf{F}} \cdot \greenE{\hat{\textbf{n}}}\, \redE{d\Sigma} \end{aligned}
where
• start color redE, S, end color redE denotes the surface through which we are measuring flux.
• start color blueE, F, left parenthesis, x, comma, y, comma, z, right parenthesis, end color blueE is a three-dimensional vector field, thought of as describing a fluid flow.
• $\greenE{\hat{\textbf{n}}(x, y, z)}$ is a function which gives a unit normal vector at each point on start color redE, S, end color redE.
• $\redE{d\Sigma}$ can be thought of as a tiny unit of area on the surface start color redE, S, end color redE.

## Changing fluid mass in a blob

Think of some three-dimensional vector field, represented by a vector-valued function start color blueE, F, left parenthesis, x, comma, y, comma, z, right parenthesis, end color blueE.
As we like to do with vector fields, imagine this is describing some three-dimensional fluid flow. And for this topic, it helps to just imagine what that flow looks like over a quick instant. Perhaps imagine fluid particles moving from the tail of each vector to its tip over a very short time delta, t.
Now think of some three-dimensional blob, with the fluid passing through its surface.
Let's name the surface of that blob start color redE, S, end color redE.
Key question: How much fluid is leaving/entering this blob as the fluid flows along the vector field defined by start color blueE, F, left parenthesis, x, comma, y, comma, z, right parenthesis, end color blueE?
To be precise, we could phrase this in terms of the mass leaving/entering the blob. For the sake of simplicity (who doesn't like simplicity, right?), let's assume the fluid has density 1, space, k, g, slash, m, start superscript, 3, end superscript. Here's a more quantifiable phrasing of our key question:
More rigorous phrasing: What is the rate of change of mass inside the blob, as a function of time? Assume the velocity of each fluid particle is given by the vector start color blueE, F, left parenthesis, x, comma, y, comma, z, right parenthesis, end color blueE, where left parenthesis, x, comma, y, comma, z, right parenthesis are the coordinates of the particle. Also assume that the fluid has a uniform density of 1, space, k, g, slash, m, start superscript, 3, end superscript throughout the surface.

## Flow through each tiny piece of the surface

Here's the essence of how to solve the problem:
• Step 1: Break up the surface S into many, many tiny pieces.
• Step 2: See how much fluid leaves/enters each piece.
• Step 3: Add up all of these amounts with a surface integral.

#### Step 1: Break up the surface

In principle, you should think of each piece as being infinitesimally small. After all, this is what we like to do with integrals. A common notation to use with surfaces is to denote the infinitesimal area of one of these pieces as "$d\Sigma$".
Also, since each piece is really small, and since we are thinking of the surface S as being smooth, you can treat these pieces as if they are flat.

#### Step 2: Measure fluid flow through each piece

Since each of these pieces is really tiny, all of the fluid flowing through it will basically be moving at the same speed and direction. Specifically, if you choose an arbitrary point left parenthesis, x, start subscript, 0, end subscript, comma, y, start subscript, 0, end subscript, comma, z, start subscript, 0, end subscript, right parenthesis on this piece, the fluid particles passing through it will have a velocity vector approximately equals, start color blueE, F, end color blueE, left parenthesis, x, start subscript, 0, end subscript, comma, y, start subscript, 0, end subscript, comma, z, start subscript, 0, end subscript, right parenthesis.
This means the fluid passing through it over a short time delta, t will form some kind of slanted prism:
The displacement vector for each one of these particles will be its velocity times the change in time:
Now let $\greenE{\hat{\textbf{n}}}$ denote the unit normal vector to our tiny piece of area:
Concept check: What is the volume of fluid which leaves the tiny piece over the time delta, t? (The tiny piece has area $d\Sigma$).
Velg ett svar:
Velg ett svar:

The second choice is correct:
\begin{aligned} \big(\blueE{\textbf{F}}(x_0, y_0, z_0) \cdot \greenE{\hat{\textbf{n}}}\big) \big(\Delta t\big) \big(d\Sigma\big) \end{aligned}
The slanted prism formed by the fluid leaving our tiny piece has a base with area $d\Sigma$. To get its volume, we must multiply this base area by the height of the prism.
The displacement start color blueE, F, end color blueE, left parenthesis, x, start subscript, 0, end subscript, comma, y, start subscript, 0, end subscript, comma, z, start subscript, 0, end subscript, right parenthesis, delta, t of a fluid particle does not quite give the height. What we want is the component of that vector which is perpendicular to the tiny piece, so we take the dot product between this vector and the unit normal vector:
$(\blueE{\textbf{F}}(x_0, y_0, z_0) \Delta t) \cdot \greenE{\hat{\textbf{n}}}$
I chose to rearrange this into the equivalent expression $(\blueE{\textbf{F}}(x_0, y_0, z_0) \cdot \greenE{\hat{\textbf{n}}}) \Delta t$ because the next thing to do involves dividing out that delta, t.
Notice, since we are assuming the density of the fluid is 1, this expression also gives the mass of fluid leaving the tiny piece. If you divide by the change in time delta, t, you can get the rate at which mass is passing through that tiny piece of area:
\begin{aligned} \big(\blueE{\textbf{F}}(x_0, y_0, z_0) \cdot \greenE{\hat{\textbf{n}}}\big) \big(d\Sigma\big) \quad \leftarrow \text{Flow of mass per unit time} \end{aligned}

#### Note: Orientation matters

Notice, if we had chosen the unit normal vector pointing in the opposite direction, the sign of this expression $\big(\blueE{\textbf{F}}(x_0, y_0, z_0) \cdot \greenE{\hat{\textbf{n}}}\big)\big(d\Sigma\big)$ would be flipped.
With closed surfaces, the convention is to choose an outward-facing unit normal vector. This means our expression for flow rate will be positive when fluid is flowing out of the region through the tiny piece, and negative if fluid is flowing into that region.

#### Step 3: Add it all together with an integral

The goal is to measure the rate at which fluid flows through the entire surface as a whole:
(Note, in this animation all fluid is going out of the surface. In general, it might be going into the region at some points).
To get this more global flow rate, add up the rate at which mass flows through each tiny piece of start color redE, S, end color redE. Since we are adding up quantities associated with tiny pieces of area on a surface, the appropriate tool is a surface integral. Take the result from the last section:
\begin{aligned} \big(\blueE{\textbf{F}}(x_0, y_0, z_0) \cdot \greenE{\hat{\textbf{n}}}\big) \big(d\Sigma\big) \quad \leftarrow \text{Flow rate through tiny piece} \end{aligned}
Now put it into a surface integral:
\begin{aligned} \iint_\redE{S} \blueE{\textbf{F}} \cdot \greenE{\hat{\textbf{n}}} \, \redE{d\Sigma} \end{aligned}
Notice, there are two functions inside this integral:
• start color blueE, F, end color blueE, left parenthesis, x, comma, y, comma, z, right parenthesis, which gives the velocity of a fluid particle at a point.
• $\greenE{\hat{\textbf{n}}}(x, y, z)$, which gives the outward facing unit normal vector at an arbitrary point on the surface.
Both of these are vector-valued functions, and their dot product is a scalar-valued function.
You might write this as the negative derivative of fluid mass in start color redE, R, end color redE; negative because the surface integral will be positive when fluid leaves the region.
In the next article, you can walk through an example computing one of these integrals. This involves finding an expression for the unit normal vector, reframing the integral in terms of a parameterization for start color redE, S, end color redE, etc.

## Flux

This measure of how much fluid is flowing through a surface is called flux. In the example above, this was framed in the context of a closed surface that is the boundary of a region, in which case flux was also a measure of the changing mass in that region. In principle, though, flux is something you can compute for any surface, closed or not.
Many things in physics can be thought of as a flow of some sort, not just fluid. Heat, and even in some sense forces, also flow through space. And as such, it is not uncommon to find yourself computing flux through a surface in a problem about heat or, say, electromagnetism.

## Summary

Given a three-dimensional fluid flow, the intuition for computing its flux through a surface goes as follows:
• Imagine cutting the surface up into many small pieces, small enough that each piece can be considered flat.
• Compute how much fluid flows through each piece as a function of the area $\redE{d\Sigma}$ of that piece, the unit normal vector $\greenE{\hat{\textbf{n}}}$ to that piece, and the fluid velocity start color blueE, F, end color blueE in that region.
• "Add up" all these flow rates with a surface integral to get the flux as a whole.
• If you change the orientation of your surface by choosing unit normal vectors facing the opposite direction, the sign of this integral will be flipped.