A topic highly related to the finite element method is computational fluid dynamics--CFD--
the study of gases and liquids with the help of the computer.
For instance, to find the optimum shape of an airfoil or the optimum shape of a car body
or to design hydraulic machinery.
I've titled this section "Why CFD is hard,"
so now let's look into that.
If we were looking at a single particle of mass m that is subject to a force F
Then the rate of change of the velocity would be proportional to that force.
That's one of Newton's laws--force equals mass times acceleration,
which is the rate of change of velocity,
the derivative of velocity with respect to time.
For the fluid, something similar has to happen,
but now we're not dealing with a single particle.
We're dealing with a virtually infinite amount of particles.
What we are working with is not the velocity of the particle.
It's the velocity field.
For every position in space, we specify the velocity,
so the velocity that we specify is the velocity of that particle
at that instant of time.
Before and after, most probably, this location is going to be occupied
by other particles at other times.
When we write down Newton's equation for this particle--
force equals mass times the derivative of velocity with respect to time--
We have to be a little careful.
Let's look at what happens after a very short time step.
It's mass times 1 over the time step,
and now we have to form the difference of the velocity after that time step
minus the velocity before that time step.
The before part is easy.
That's simply our velocity field at the current time and the current location.
The tricky thing is the after part.
It's the velocity field at the later time--t plus time step.
Now we have to take care of the fact that our particle has moved a little.
We don't need the velocity field at that later time.
At position x it has to be a slightly different position,
namely, how far did we advance?
We advanced by time step times velocity.
Now, this is going to make things ugly.
The velocity field of something that includes the velocity field.
A function applied to itself.
This is what makes things ugly and eventually leads to computational fluid dynamics
and eventually leads to computational fluid dynamics being hard.
If we do the math right, this becomes the following.
First we have to look into the change of the velocity field with time,
so we get its partial derivative with respect to time.
But then we also have to look into its change with position,
which is the partial derivative with respect to x, for instance.
The larger the velocity is, the more effect the spatial derivative has.
What we get in the end is the x component of the velocity times the partial derivative
of the velocity with respect to x.
Of course, the same happens with y and z.
This is going to be the acceleration,
and this is inherently nonlinear.
We have a product of a function that we're looking for--the velocity field--with itself.
This is going to make solving the differential equation that results from this really hard.
Finally, however, even though the resulting equation--
the so-called Navier Stokes equation--is going to look pretty complex,
it's nothing else but Newton's law applied to the velocity field.
