Fields
A collection of levitation related mathematical implementations.
The fields is one of the most important parts of the package,
containing implementations of various ways to calculate levitate-related physical properties.
To simplify the management and manipulation of the implemented fields they are wrapped
in an additional abstraction layer.
The short version is that the classes implemented in the fields
module
will not return objects of the called class, but typically objects of Field
.
These objects support algebraic operations, like +
, *
, and abs
. The full description of
what the different operands do can be found in the documentation of _field_wrappers
.
References
- Gorkov(1,2,3)
L. P. Gorkov, “On the Forces Acting on a Small Particle in an Acoustical Field in an Ideal Fluid” Soviet Physics Doklady, vol. 6, p. 773, Mar. 1962.
- Sapozhnikov(1,2,3,4,5)
O. A. Sapozhnikov and M. R. Bailey, “Radiation force of an arbitrary acoustic beam on an elastic sphere in a fluid” J Acoust Soc Am, vol. 133, no. 2, pp. 661–676, Feb. 2013.
Complex sound pressure \(p\). |
|
Complex sound particle velocity \(v\). |
|
Gor'kov's potential \(U\). |
|
Gradient of Gor'kov's potential, \(\nabla U\). |
|
Laplacian of Gor'kov's potential, \(\nabla^2 U\). |
|
Radiation force calculation for small beads in arbitrary sound fields. |
|
Radiation force gradient for small beads in arbitrary sound fields. |
|
Curl or rotation of the radiation force. |
|
Full matrix gradient of the radiation force. |
|
Spherical harmonics based radiation force. |
|
Spatial gradient of the total spherical radiation force. |
|
Spherical harmonics expansion coefficients of the sound pressure. |
|
Spatial gradient of spherical harmonics expansion coefficients. |
Sound Fields
- class levitate.fields.Pressure(array)
Complex sound pressure \(p\).
Calculates the complex-valued sound pressure.
- Parameters
array (TransducerArray) – The object modeling the array.
- class levitate.fields.Velocity(array, *args, **kwargs)
Complex sound particle velocity \(v\).
Calculates the sound particle velocity
\[v = {1 \over j\omega\rho} \nabla p\]from the relation \(\dot v = \rho \nabla p\) applied for monofrequent sound fields. This is a vector value using a Cartesian coordinate system.
- Parameters
array (TransducerArray) – The object modeling the array.
- class levitate.fields.SphericalHarmonicsExpansion(array, orders, *args, **kwargs)
Spherical harmonics expansion coefficients of the sound pressure.
The expansion coefficients up to a certain order, where the complex amplitudes of the transducers will be accounted for.
- Parameters
array (TransducerArray) – The object modeling the array.
orders (int) – The number of expansion orders to include.
- class levitate.fields.SphericalHarmonicsExpansionGradient(array, orders, *args, **kwargs)
Spatial gradient of spherical harmonics expansion coefficients.
Gives the Cartesian gradient of the expansion coefficient with respect to the expansion center. See
SphericalHarmonicsExpansion
for documentation of parameters.- Parameters
array (TransducerArray) – The object modeling the array.
orders (int) – The number of expansion orders to include.
Radiation Force
- class levitate.fields.RadiationForce(array, radius=0.001, material=Styrofoam(poisson_ratio=0.35, rho=25, c=2350), *args, **kwargs)
Radiation force calculation for small beads in arbitrary sound fields.
Calculates the radiation force on a small particle in a sound field which can have both strong standing wave components or strong traveling wave components. The force components \(q=x,y,z\) are calculated as
\[\begin{split}F_q &= -{\pi \over k^5}\kappa_0 \Re\left\{ i k^2 \Psi_0 p {\partial p^* \over \partial q} + ik^2 \Psi_1 p^* {\partial p \over \partial q} \right. \\ &\quad +\left. 3i \Psi_1 \left( {\partial p \over \partial x}{\partial^2 p^* \over \partial x\partial q} + {\partial p \over \partial y}{\partial^2 p^* \over \partial y\partial q} + {\partial p \over \partial z}{\partial^2 p^* \over \partial z\partial q} \right)\right\}\end{split}\]where
\[\begin{split}\Psi_0 &= -{2(ka)^6 \over 9} \left(f_1^2 + {f_2^2 \over 4} + f_1 f_2\right) -i{(ka)^3 \over 3} (2f_1+f_2) \\ \Psi_1 &= - {(ka)^6 \over 18}f_2^2 + i{(ka)^3 \over 3} f_2 \\ f_1 &= 1 - {\kappa_p \over \kappa_0}, \qquad f_2 = 2 {\rho_p - \rho_0 \over 2 \rho_p + \rho_0}\end{split}\]This is more suitable than the Gor’kov formulation for use with progressive wave fiends, e.g. single sided arrays, see [Sapozhnikov]. The actual implementation uses a further algebraic simplification of the above expresion.
- Parameters
array (TransducerArray) – The object modeling the array.
radius (float, default 1e-3) – Radius of the spherical beads.
material (Material) – The material of the sphere, default styrofoam.
- class levitate.fields.RadiationForceGradient(array, radius=0.001, material=Styrofoam(poisson_ratio=0.35, rho=25, c=2350), *args, **kwargs)
Full matrix gradient of the radiation force.
Calculates the full gradient matrix of the radiation force on a small spherical bead. Component \((i,j)\) in the matrix is \({\partial F_i \over \partial q_j}\) i.e. the first index is force the force components and the second index is for derivatives. This is based on analytical differentiation of the radiation force on small beads from [Sapozhnikov], see
RadiationForce
.- Parameters
array (TransducerArray) – The object modeling the array.
radius (float, default 1e-3) – Radius of the spherical beads.
material (Material) – The material of the sphere, default styrofoam.
- class levitate.fields.RadiationForceStiffness(array, radius=0.001, material=Styrofoam(poisson_ratio=0.35, rho=25, c=2350), *args, **kwargs)
Radiation force gradient for small beads in arbitrary sound fields.
Calculates the non-mixed spatial derivatives of the radiation force,
\[({\partial F_x \over \partial x}, {\partial F_y \over \partial y}, {\partial F_z \over \partial z})\]where \(F\) is the radiation force by [Sapozhnikov], see
RadiationForce
.- Parameters
array (TransducerArray) – The object modeling the array.
radius (float, default 1e-3) – Radius of the spherical beads.
material (Material) – The material of the sphere, default styrofoam.
- class levitate.fields.RadiationForceCurl(*args, **kwargs)
Curl or rotation of the radiation force.
Calculates the curl of the radiation force field as
\[({\partial F_z \over \partial y} - {\partial F_y \over \partial z}, {\partial F_x \over \partial z} - {\partial F_z \over \partial x}, {\partial F_y \over \partial x} - {\partial F_x \over \partial y})\]where \(F\) is the radiation force by [Sapozhnikov], see
RadiationForce
.- Parameters
array (TransducerArray) – The object modeling the array.
radius (float, default 1e-3) – Radius of the spherical beads.
material (Material) – The material of the sphere, default styrofoam.
Gor’kov
- class levitate.fields.GorkovPotential(array, radius=0.001, material=Styrofoam(poisson_ratio=0.35, rho=25, c=2350), *args, **kwargs)
Gor’kov’s potential \(U\).
Calculates the Gor’kov potential [Gorkov]
\[U = {V \over 4}(f_1 \kappa_0 |p|^2 - {3 \over 2} f_2 \rho_0 |v|^2)\]where
\[f_1 = 1 - {\kappa_p \over \kappa_0}, \qquad f_2 = 2 {\rho_p - \rho_0 \over 2 \rho_p + \rho_0}\]and \(V\) is the volume of the particle. Note that this is only a suitable measure for small particles, i.e. \(ka<<1\), where \(a\) is the radius of the particle.
- Parameters
array (TransducerArray) – The object modeling the array.
radius (float, default 1e-3) – Radius of the spherical beads.
material (Material) – The material of the sphere, default styrofoam.
- class levitate.fields.GorkovGradient(array, radius=0.001, material=Styrofoam(poisson_ratio=0.35, rho=25, c=2350), *args, **kwargs)
Gradient of Gor’kov’s potential, \(\nabla U\).
Calculates the Cartesian spatial gradient of Gor’kov’s potential, see
GorkovPotential
and [Gorkov]. This is a vector value used to calculate the radiation force as\[F = -\nabla U.\]Note that this value is not suitable for sound fields with strong traveling wave components. If this is the case, use the
RadiationForce
field instead.- Parameters
array (TransducerArray) – The object modeling the array.
radius (float, default 1e-3) – Radius of the spherical beads.
material (Material) – The material of the sphere, default styrofoam.
- class levitate.fields.GorkovLaplacian(array, radius=0.001, material=Styrofoam(poisson_ratio=0.35, rho=25, c=2350), *args, **kwargs)
Laplacian of Gor’kov’s potential, \(\nabla^2 U\).
This calculates the Cartesian parts of the Laplacian of Gor’kov’s potential, see
GorkovPotential
and [Gorkov]. This is not really the Laplacian, since the components are not summed. The results can be seen as the local linear spring stiffness of the radiation force.Note that this value is not suitable for sound fields with strong traveling wave components. If this is the case, use the
RadiationForceStiffness
field instead.- Parameters
array (TransducerArray) – The object modeling the array.
radius (float, default 1e-3) – Radius of the spherical beads.
material (Material) – The material of the sphere, default styrofoam.
Spherical Harmonics Forces
- class levitate.fields.SphericalHarmonicsForce(array, radius, orders=None, material=Styrofoam(poisson_ratio=0.35, rho=25, c=2350), scattering_model='Hard sphere', *args, **kwargs)
Spherical harmonics based radiation force.
Expands the local sound field in spherical harmonics and calculates the radiation force in the spherical harmonics domain. The expansion coefficients are calculated using superposition of the translated expansions of the transducer radiation patterns. The radiation force is calculated using a similar derivation as [Sapozhnikov], but without any plane wave decomposition.
- Parameters
array (TransducerArray) – The object modeling the array.
radius (float) – Radius of the spherical beads.
orders (int) – The number of force orders to include. Note that the sound field will be expanded at one order higher that the force order. Will default to floor(ka) + 3, where
k
is the wavenumber anda
is the radius.material (Material) – The material of the sphere, default styrofoam.
scattering_model – Chooses which scattering model to use. Currently
Hard sphere
,Soft sphere
, andCompressible sphere
are implemented.
- class levitate.fields.SphericalHarmonicsForceGradient(*args, **kwargs)
Spatial gradient of the total spherical radiation force.
The three Cartesian derivatives of the radiation force on a spherical object, calculated using spherical harmonics expansion of the sound field. See
SphericalHarmonicsForce
for details on the parameters.- Parameters
array (TransducerArray) – The object modeling the array.
radius (float) – Radius of the spherical beads.
orders (int) – The number of force orders to include. Note that the sound field will be expanded at one order higher that the force order. Will default to floor(ka) + 3, where
k
is the wavenumber anda
is the radius.material (Material) – The material of the sphere, default styrofoam.
scattering_model – Chooses which scattering model to use. Currently
Hard sphere
,Soft sphere
, andCompressible sphere
are implemented.
- class levitate.fields.SphericalHarmonicsForceDecomposition(array, radius, orders=None, material=Styrofoam(poisson_ratio=0.35, rho=25, c=2350), scattering_model='Hard sphere', *args, **kwargs)
Radiation force decomposed in spherical harmonics.
This is mostly intended for research purposes, when the radiation force decomposed in individual spherical harmonics bases is of interest.
- Parameters
array (TransducerArray) – The object modeling the array.
radius (float) – Radius of the spherical beads.
orders (int) – The number of force orders to include. Note that the sound field will be expanded at one order higher that the force order. Will default to floor(ka) + 3, where
k
is the wavenumber anda
is the radius.material (Material) – The material of the sphere, default styrofoam.
scattering_model – Chooses which scattering model to use. Currently
Hard sphere
,Soft sphere
, andCompressible sphere
are implemented.
- class levitate.fields.SphericalHarmonicsForceGradientDecomposition(*args, **kwargs)
Spatial gradient of spherical harmonics force decomposition.
Takes the spatial gradient in Cartesian coordinates of each order and mode of the radiation force calculated from a spherical harmonics expansion. See
SphericalHarmonicsForce
for details on algorithms and parameters.- Parameters
array (TransducerArray) – The object modeling the array.
radius (float) – Radius of the spherical beads.
orders (int) – The number of force orders to include. Note that the sound field will be expanded at one order higher that the force order. Will default to floor(ka) + 3, where
k
is the wavenumber anda
is the radius.material (Material) – The material of the sphere, default styrofoam.
scattering_model – Chooses which scattering model to use. Currently
Hard sphere
,Soft sphere
, andCompressible sphere
are implemented.