This is a web app that simulates the fluid flow around a falling sphere, taking into account the dynamic effects of fluid viscosity, sphere radius and density, along with static parameters such as gravity, buoyancy and drag.
The simulation measures the time taken for the sphere to travel 15cm at terminal velocity. It is meant as a lab auxiliary for the Chemical Engineering branches.
The simulation parameters can be changed from the menus at the top of the screen. The time can be altered from real time to 4 times slower or 4 times faster. The viscosity is measured in centistokes (cSt).
Any sphere can be selected by clicking on it. The radius is provided in imperial measurements, like the laboratory resources.
At the bottom of the screen is the table for physical, dynamic parameters. On the right is the data log that outputs the measurements.
The Jacobi iterations parameter represents the number of calculations for the fluid movement. A higher number of iterations provides higher fidelity in the fluid flow, but requires more power from the GPU.
More in-depth information is given in the next section.
The graphical fluid flow is modelled using the Navier-Stokes equations: $$\frac{\partial \vec{u}}{\partial t} = -\vec{u} \cdot \nabla \vec{u} - \frac{1}{\rho}\nabla \rho + \nu \nabla^2\vec{u} + \vec{F}$$ $$\nabla \cdot \vec{u} = 0$$ However, for purely graphical purposes, leaving the viscosity term out provides a very good trade-off in terms of computational efficiency and graphical fidelity. The equations are solved numerically for pressure using Jacobi iterations.
The graphical sphere movement is modelled using gravitational acceleration, drag force and buoyancy. The sphere moves in discrete time-steps of around 0.065ms. Therefore, at terminal velocity, the following is true: $$ m g = C_d A \frac {\rho u^2}{2} + \rho V g $$ The drag coefficient Cd is defined in terms of the Reynolds Number: $$ Re = \frac {\rho u d}{\mu} $$
The simulation screen is comprised of two superimposed HTML canvases:
To make this, I had to draw from many different sources. The main ones are:
Acceleration (m / s2) | Velocity (m / s) | Position (m) | ||||
- | ||||||
x | y | x | y | x | y | |
accx | accy | velx | vely | posx | posy | |
Export to CSV |
Clear Log |