CAPILLARY
Overview
The CAPILLARY
function calculates the Capillary number (Ca), a dimensionless number that characterizes the relative effect of viscous forces versus surface tension forces acting across an interface between a liquid and a gas, or between two immiscible liquids. It is widely used in fluid mechanics, microfluidics, and enhanced oil recovery to describe the behavior of multiphase flows. The Capillary number is defined as:
where:
- is the characteristic velocity (m/s)
- is the dynamic viscosity (Pa·s)
- is the surface tension (N/m)
For more information, see the fluids.core documentation and the fluids GitHub repository .
This example function is provided as-is without any representation of accuracy.
Usage
To use the function in Excel:
=CAPILLARY(V, mu, sigma)
V
(float, required): Characteristic velocity in meters per second (m/s).mu
(float, required): Dynamic viscosity in Pascal-seconds (Pa·s).sigma
(float, required): Surface tension in Newtons per meter (N/m).
The function returns a single value (float): the Capillary number (dimensionless), or an error message (string) if the input is invalid or out-of-range.
Examples
Example 1: Water in a microchannel
In Excel:
=CAPILLARY(1.2, 0.01, 0.1)
Expected output:
Result |
---|
0.12 |
Example 2: Oil droplet in water
In Excel:
=CAPILLARY(0.5, 0.05, 0.2)
Expected output:
Result |
---|
0.125 |
Example 3: Low viscosity, high surface tension
In Excel:
=CAPILLARY(2.0, 0.001, 0.5)
Expected output:
Result |
---|
0.004 |
Example 4: High viscosity, low velocity
In Excel:
=CAPILLARY(0.1, 0.2, 0.05)
Expected output:
Result |
---|
0.4 |
Python Code
import micropip
await micropip.install('fluids')
from fluids.core import Capillary as _capillary
def capillary(V, mu, sigma):
"""
Calculate the Capillary number (Ca) for a fluid system.
Args:
V: Characteristic velocity in meters per second (m/s).
mu: Dynamic viscosity in Pascal-seconds (Pa·s).
sigma: Surface tension in Newtons per meter (N/m).
Returns:
The Capillary number (dimensionless, float), or an error message (str) if the input is invalid or out-of-range.
This example function is provided as-is without any representation of accuracy.
"""
try:
V_ = float(V)
mu_ = float(mu)
sigma_ = float(sigma)
except Exception:
return "Invalid input: could not convert arguments to float."
if sigma_ == 0:
return "Invalid input: sigma (surface tension) must not be zero."
try:
result = _capillary(V_, mu_, sigma_)
except Exception as e:
return f"Error: {str(e)}"
return round(result, 6)
Live Notebook
Edit this function in a live notebook .