CONFINEMENT
Overview
The CONFINEMENT
function calculates the Confinement number (Co), a dimensionless number used in two-phase flow and microchannel heat transfer to characterize the relative importance of surface tension and gravity. The Confinement number is defined as:
where:
- is the surface tension (N/m)
- is the acceleration due to gravity (m/s²)
- is the density of the liquid (kg/m³)
- is the density of the gas (kg/m³)
- is the channel diameter (m)
This number is important in microfluidics and boiling heat transfer, as it helps predict flow regimes and the dominance of capillary effects. 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:
=CONFINEMENT(D, rhol, rhog, sigma, [g])
D
(float, required): Channel diameter (m)rhol
(float, required): Density of liquid (kg/m³)rhog
(float, required): Density of gas (kg/m³)sigma
(float, required): Surface tension (N/m)g
(float, optional, default=9.80665): Acceleration due to gravity (m/s²)
The function returns a single value (float): the Confinement number (dimensionless), or an error message (string) if the input is invalid or out-of-range.
Examples
Example 1: Water/Air in Microchannel
In Excel:
=CONFINEMENT(0.001, 1077, 76.5, 0.00427)
Expected output:
Result |
---|
0.6597 |
Example 2: Oil/Air in Microchannel
In Excel:
=CONFINEMENT(0.002, 900, 1.2, 0.030)
Expected output:
Result |
---|
0.3162 |
Example 3: Water/Steam at High Surface Tension
In Excel:
=CONFINEMENT(0.0005, 1000, 0.6, 0.072)
Expected output:
Result |
---|
1.2085 |
Example 4: Large Channel, Low Surface Tension
In Excel:
=CONFINEMENT(0.01, 800, 1.0, 0.002)
Expected output:
Result |
---|
0.0500 |
Python Code
import micropip
await micropip.install('fluids')
from fluids.core import Confinement as fluids_confinement
def confinement(D, rhol, rhog, sigma, g=9.80665):
"""
Calculate the Confinement number (Co) for two-phase flow in a channel.
Args:
D: Channel diameter (m).
rhol: Density of liquid (kg/m³).
rhog: Density of gas (kg/m³).
sigma: Surface tension (N/m).
g: Acceleration due to gravity (m/s², default 9.80665).
Returns:
The Confinement number (float), or an error message (str) if input is invalid.
This example function is provided as-is without any representation of accuracy.
"""
try:
D = float(D)
rhol = float(rhol)
rhog = float(rhog)
sigma = float(sigma)
g = float(g)
except Exception:
return "Invalid input: could not convert arguments to float."
if D <= 0 or sigma <= 0 or rhol <= 0 or rhog < 0 or g <= 0:
return "Invalid input: arguments must be positive."
if rhol <= rhog:
return "Invalid input: rhol must be greater than rhog."
try:
result = fluids_confinement(D, rhol, rhog, sigma, g)
except Exception as e:
return f"Calculation error: {str(e)}"
return round(result, 4)
Live Notebook
Edit this function in a live notebook .