A method of quickly calculating point maps of axis-symmetric drops.
Project description
Installation
pip install fourier-laplace
Usage
from numpy import arange
from fourier_laplace import FourierProfile
# 0.1 <= Bo <= 0.35
estimator = FourierProfile(bond_number=0.2)
# 0 <= z <= 5
z = arange(0, 2, 1e-1)
x = estimator.estimate(z=z) # Predicted x
# Normalize profile (so that true x_max = 1)
max_x = estimator.get_max_x()
z = z / max_x
x = x / max_x
Background
The Young-Laplace equation describes the pressure difference across a curved interface between two immiscible fluids, such as a liquid drop or bubble.
$$\Delta P = \frac{1}{\gamma}(\frac{1}{R_1} + \frac{1}{R_2})$$
In the case of axis-symmetric drops, the above equation can be translated into a system of first order differential equation.
$$\frac{d \phi}{d s} = 2 - Bo z - \frac{\sin \phi}{x}$$
$$\frac{d x}{d s} = \cos \phi$$
$$\frac{d z}{d s} = \sin \phi$$
With the boundary condition
$$\phi(s=0)=x(s=0)=z(s=0)=0$$
The bond number, $Bo$, represents the balance of forces between gravity and surface tension.
$$Bo = \frac{\Delta \rho g a^2}{\gamma}$$
Where $a$ is the characteristic length. Then to calculate a point map (x, z) from the equations above, the set of differential equations have to be solved through numerical means.
Improved Method
The surface tension can only accurately be calculated from the $Bo$ range of [0, 1]. Otherwise, gravity is the dominating force and not surface tension. In practice, the true $Bo$ should be in the range [0.1, 0.35] for the most accurate measurements. For any drop, the following relationship can written.
$$x = f(z, Bo)$$
Where $f(z, Bo)$ is some generic function can be calculated from the equations above. Using a fourier series, a generic function for $f(z, Bo)$ can be calculated.
$$f(z, Bo) = \frac{a_0}{2} + \sum_{n=1}^{\infty} a_n \cos \left( \frac{2 \pi n z}{P} \right)+ b_n \sin \left( \frac{2 \pi n z}{P} \right)$$
$$a_n = \frac{2}{P} \int^{P}_{0} f(z, Bo) \cos \left( \frac{2 \pi n z}{P} \right) dz$$
$$b_n = \frac{2}{P} \int^{P}_{0} f(z, Bo) \sin \left( \frac{2 \pi n z}{P} \right) dz$$
$P$ is some artibary period at which the function is defined over, but $z$ can theoretically be defined over any range. In reality, z is typically only defined over the range [0, 5]. Often times $z < 2$, but there are some cases where z is defined at a larger values. Thus, it is safe to assume that $P=5$. But it can be seen above that $a_n$ and $b_n$ are only dependant on $Bo$, since the dependance on z is integrated out.
$$a_n = a_n(Bo)$$
$$b_n = b_n(Bo)$$
Since the range for $Bo$ is known, a table can easily be made all the fourier constants for many $Bo$ values. Then interplotion can be used to calculate the new constants for a given Bo. This means that generating the table is computationally very expensive, but using it is very computationally cheap. This is the basis for this codebase, and how a sigificant speed up is achieved.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fourier_laplace-1.0.4.tar.gz
.
File metadata
- Download URL: fourier_laplace-1.0.4.tar.gz
- Upload date:
- Size: 9.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6a2e9ebf676f4ebf1e60e083947c2c7a66cd0748e2aac8a42a954872e81b3dc |
|
MD5 | bfb5477dc8e950cb2c0bb8c6a8c38e40 |
|
BLAKE2b-256 | c9e79a65f9663443bb6ebd22bbd3451be4553672f23b344cb044d65d35bf2409 |
File details
Details for the file fourier_laplace-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: fourier_laplace-1.0.4-py3-none-any.whl
- Upload date:
- Size: 9.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 128a9d689df418b713f29abda9d3097e848b80fb9ac01ea22909b0271c02e5ab |
|
MD5 | fb92edb596ce6666ae1cd769944ddfd8 |
|
BLAKE2b-256 | 3c72c85f8a799594a369ac59d4127004999dfcf3d6dd0191069cc0b234b2e353 |