PHYS 432 Physics of Fluids Week 5
PHYS 432 Physics of Fluids Week 5
Numerical exercises
Working in groups, write a python code to solve one of the following problems:
1. Calculate the motion of a layer of viscous fluid which lies on top of a large plate that is oscillating sideways (parallel to itself). Compare with the analytic solution in 2009 Midterm question 1. Next, add gravity and solve the problem of a viscous fluid moving down an inclined plane.
2. Write a code to follow the motion of sound waves in a uniform density gas (in 1D, no gravity). Start with a uniform density gas with a small Gaussian perturbation in its density. How does the perturbation evolve with time? What happens as you increase the amplitude of the perturbation. Next, consider a piston moving into a tube of gas. Calculate the subsequent motion of the gas.
3. Write a code to follow the evolution of a collection of parallel line vortices. Try different initial conditions: vortex pairs, a line of vortices, a circle of vortices, a random distribution. Add the ability to track one or more "tracer particles" that are passively advected by the flow and see what they do in each case.
4. Calculate the streamlines of an inviscid incompressible fluid moving past a long cylinder (the cylinder axis is perpendicular to the fluid velocity). Hint: use a streamfunction . Now make the cylinder rotate and calculate the streamlines as the rotation rate increases.
5. A fluid flows at constant velocity through a pipe that is heated at the far end. Calculate the temperature distribution in the fluid along the pipe.
6. Taylor-Couette flow is the flow of a viscous fluid between concentric cylinders. Starting at rest, calculate the fluid flow when one of the cylinders begins to rotate. Calculate the energy budget for this problem: the rate of work done by the external torques, the kinetic energy of the fluid, and the viscous dissipation over time.
Here is how to animate a plot in matplotlib:
import matplotlib.pyplot as plt
... now define numpy arrays x and y ...
plt.ion() fig = plt.figure() p, = plt.plot(x,y,'ro') plt.xlim([0,1]) plt.ylim([0,1]) fig.canvas.draw()
... then after each timestep to update the plot you can do ...
y = y + ... p.set_ydata(y) fig.canvas.draw() plt.pause(0.01)
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- analysis and visualization of multi scale astrophysical
- phys 432 physics of fluids week 5
- modeling and simulation in python green tea press
- map projection
- physics simulations in python
- a python module for animating torsional wave data for
- ngs py documentation
- lab assignment 3 data visualization basics
- approximating a circle or an ellipse using four bezier