ARCHIMEDES
Overview
The ARCHIMEDES
function calculates the Archimedes number (Ar), a dimensionless number used in fluid mechanics to characterize the motion of fluids due to density differences. The Archimedes number is commonly used to predict the onset of natural convection and to analyze the settling of particles in a fluid. It is defined as:
where is the characteristic length, is the density of the fluid, is the density of the particle, is the acceleration due to gravity, and is the dynamic viscosity of the fluid.
For more information, see the fluids GitHub repository and the official documentation .
This example function is provided as-is without any representation of accuracy.
Usage
To use the function in Excel:
=ARCHIMEDES(L, rhof, rhop, mu, [g])
L
(float, required): Characteristic length (m).rhof
(float, required): Density of fluid (kg/m³).rhop
(float, required): Density of particle (kg/m³).mu
(float, required): Dynamic viscosity of fluid (N·s/m²).g
(float, optional, default=9.80665): Acceleration due to gravity (m/s²).
The function returns a single value (float): the Archimedes number (dimensionless), or an error message (string) if the input is invalid or out-of-range.
Examples
Example 1: Calculate Archimedes Number for a Particle in Water
In Excel:
=ARCHIMEDES(0.002, 2, 3000, 0.001)
Expected output:
Result |
---|
470.41 |
This means the Archimedes number is approximately 470.41 for the given parameters.
Python Code
def archimedes(L, rhof, rhop, mu, g=9.80665):
"""
Calculate the Archimedes number (Ar) for a fluid and particle.
Args:
L: Characteristic length (m).
rhof: Density of fluid (kg/m³).
rhop: Density of particle (kg/m³).
mu: Dynamic viscosity of fluid (N·s/m²).
g: Acceleration due to gravity (m/s², default 9.80665).
Returns:
Archimedes number (float), or an error message (str) if input is invalid.
This example function is provided as-is without any representation of accuracy.
"""
try:
L = float(L)
rhof = float(rhof)
rhop = float(rhop)
mu = float(mu)
g = float(g)
except Exception:
return "Invalid input: could not convert arguments to float."
if mu == 0:
return "Invalid input: mu must be nonzero."
Ar = (L**3 * rhof * (rhop - rhof) * g) / (mu**2)
return round(Ar, 2)
Live Notebook
Edit this function in a live notebook .