Tuesday, September 23, 2008

Number Theory with Mathematica

[Download Mathematica notebook]



You can find the original post on the Dead Engineers Society.


Cite as:
Saad, T. "Number Theory with Mathematica". Weblog entry from Please Make A Note. https://pleasemakeanote.blogspot.com/2008/09/number-theory-with-mathematica.html

Saturday, September 20, 2008

CNN Videos and Firefox

For some reason, CNN videos do not play in Firefox 3.0. Ive done some search over this, but couldn't find the reason for this behaviour. However, it seems that clearing your Firefox cache makes things work!

Here's how
In Firefox, got to Tools/Clear Private Data
alternatively, if you want to control what is being cleared (i.e. clearing only the cache not the saved passwords etc..)
Tools/Options/Privacy and make sure you select "Aske me before clearing private data"
With this option enabled, every time you clear private data, you will get a popup window asking you what you want to clear.

Voila!

Cite as:
Saad, T. "CNN Videos and Firefox". Weblog entry from Please Make A Note. https://pleasemakeanote.blogspot.com/2008/09/cnn-videos-and-firefox.html

Tuesday, September 16, 2008

5. The Reynolds Transport Theorem

[Previous Article: The Material Derivative in Vector Form]

For completion purposes, I feel obliged to discuss the Reynolds transport theorem. Although I would like to derive the fluid flow equations from scratch, the Reynolds transport theorem provides an avenue for a simple way to derive them. Henceforth, I decided to use the many ways of deriving the conservation equations, whether in integral or differential form.

I will base the current derivation on the text by James A. Fay Introduction to Fluid Mechanics. I believe it is an excellent text on fluid mechanics that focuses on the essential physics of fluid flows.

We first have to distinguish between a material volume and a control volume. A material volume is a volume of fluid that contains the same fluid as it moves and deforms in time.

(Fig. 1)

A control volume is a fixed volume in space where the fluid passes through.

(Fig. 2)

This is tightly linked to the previous discussions on the material derivative and its connection with the Lagrangian and Eulerian views. A material volume is part of a Lagrangian description whereas a control volume is part of the Eulerian description.

Now let us consider and "extensive" property B whose "intensive" property is b. For example, mass is an extensive property, whereas the density is the corresponding intensive property. An extensive property describes a specific part of the fluid (e.g. the mass is different for different volumes of the same fluid) while the intensive property is intrinsic (e.g. the density is the same for different volumes of the same fluid). In simple terms, an intensive property is the extensive property per unit mass.

The Reynolds transport theorem can be thought of as the integral form of the material derivative. It mainly relates the rate of change of an extensive property of a given material volume to the rate of change of the corresponding intensive property.

The total amount of property B in a given material volume is therefore


(Eq. 1)

As the material volume moves around, the quantity B inside M changes due to external forces or internal reactions for example. Therefore, it is convenient to compute the time rate of change of B


(Eq. 2)

Eq. 2 means that the rate of change of the quantity B in the material volume is equal to the rate of change of B within the fixed control volume plus the net flowrate of the quanity B through the control surface. The RHS of Eq. 2 can be expressed as follows


(Eq. 3)
and


(Eq. 4)

Eq. 4 measures the flux of the quantity B through the control surface. Then, combining the above equations, we get the Reynolds transport theorem


(Eq. 5)


Voila!

There is an alternative way of deriving the Reynolds transport theorem, however, it makes use of the continuity equation which we have not derived yet. So this will be postponed to a later post.

[Next Article: How Euler Derived the Continuity Equation]


Cite as:
Saad, T. "5. The Reynolds Transport Theorem". Weblog entry from Please Make A Note. https://pleasemakeanote.blogspot.com/2008/09/derivation-of-navier-stokes-equations.html

4. The Material Derivative in Vector Form

[Previous Article: 3. The Material Derivative in Spherical Coordinates]

After going over the derivation of the material derivative in Cartesian, cylindrical, and spherical coordinates and seeing all the trouble that we had to go through, it is time to present the material derivative in a vector invariant form.

An invariant vector form is independent of the coordinate system used. The form will be the same for all coordinate. Of course, vector operations (i.e. gradient and curl) are not the same for different coordinate systems [see this post] once they are expanded; but the gradient is always a gradient and the curl is always a curl - only the expansion is different.

I will follow Karamcheti's explanation for obtaining the vector form of the material derivative. We start by considering a fluid particle at R measured from the origin of the coordinate system and time t. Consider also a generic scalar fluid property Q such as the temperature, pressure, or density. The scalar restriction will be removed once we obtain the general form for the material derivative. At point R and time t, the property is defined as Q(R, t). At time (t + Δt), the fluid particle moves a distance Ds and the fluid property changes accordingly to Q(R + V Δt, t + Δt)


The total change in Q from t to (t + Δt) is

(Eq. 1)

then, the time derivative is defined as

using Taylor's series for Q, we have


If we substitute Eq. 3 into Eq. 2, we get the following

(Eq. 4)

Note that all high order terms disappear as the limit in the derivative is applied. The second term in Eq. 4 can be cast in vector form because it represents the derivative of Q in the direction of the streamline, tangent to the velocity vector. This means that it can be written as the dot product of the gradient of Q and the unit vector along the streamline, i.e. parallel to the velocity. Mathematically, this can be written as

(Eq. 5)

at the outset, we recover

(Eq. 6)

Voila!

This is the expression we are looking for; Eq. 6 represents the time derivative of a transported fluid property as seen from an Eulerian point of view. This also works when Q is a vector field, call it A

(Eq. 7)

However, the form given by Eq. 7 only works for Cartesian coordinates because it not invariant under coordinate transformation. This means that it does not hold true when using curvilinear coordinates such as Cylindrical or Spherical. Fortunately, we can write it using invariant form as follows

(Eq. 8)

Voila!

Specifically, when the vector field is the velocity field, then Eq. 8 simplifies quite nicely as


Cite as:
Saad, T. "4. The Material Derivative in Vector Form". Weblog entry from Please Make A Note. https://pleasemakeanote.blogspot.com/2008/08/derivation-of-navier-stokes-equations_20.html

3. The Material Derivative in Spherical Coordinates

Spherical coordinates are of course the most intimidating for the untrained eye. For engineers and fluid dynamicists, the farthest we go is usually cylindrical coordinates with rare pop-ups of the spherical problem. Here, I want to derive the material derivative of the velocity field in spherical coordinates. First, let us do that for a scalar.

Assume that at point r and time t a fluid particle has a property Q. As this particle moves about, this property will change with time (and space). Again, in the Lagrangian description, Q is only a function of time, i.e.

(Eq. 1)

However, from the Eulerian point of view, any property of the fluid is a function of time and space, which is also a function of time implicitly. Then

(Eq. 2)

Then, the time rate of change of any scalar fluid property is given by the following

(Eq. 3)

where we have used the chain rule to account for the spatial dependence on time. Remembering some of the formulas from dynamics, we have

(Eq. 4)

upon substitution of Eq. 4 into Eq. 3, we finally obtain the material derivative for a scalar

(Eq. 5)

To obtain the material derivative for a vector field, we follow a similar procedure keeping in mind the directional nature of a vector. We illustrate this using the velocity field - keep in mind that this works for any kind of vector field. Again, in a Lagrangian reference, the velocity is only a function of time. In the Eulerian view, the velocity has the following form

(Eq. 6)

Using the chain rule, the material derivative of the velocity field is written as

(Eq. 7)

Again, noting that the partial derivative with respect to time in Eq. 7 (first term) is evaluated at a fixed position in space, the unit vectors associated with the fluid particle at that point are fixed as viewed from an Eulerian reference, therefore,

(Eq. 8)

To evaluate the remaining terms in Eq. 7, we have to first remember some equations from dynamics or vector calculus about differential changes in unit vectors in spherical coordinates. These are given by

(Eq. 9)

Now we can evaluate the spatial terms in Eq. 7. The radial derivative is

(Eq. 10)

while the tangential derivative takes the following form

(Eq. 11)

Finally, the azimuthal derivative is as follows

(Eq. 12)

Voila!!!

Once Eqs. 8 through 12 are put together, one obtains the full expression for the material derivative of a vector field in spherical coordinates.

In the next post, I will present an invariant vector form for the material derivative so that we don't have to go through all the hassle of using chain rule differentiation to evaluate the material derivative. But it was worth it to see how it works using good old calculus.


Cite as:
Saad, T. "3. The Material Derivative in Spherical Coordinates". Weblog entry from Please Make A Note. https://pleasemakeanote.blogspot.com/2008/08/derivation-of-navier-stokes-equations_18.html