astronomix._fluid_equations._eigen_hydro_iso

astronomix._fluid_equations._eigen_hydro_iso#

Computations of the eigenvalues and eigenvectors for the isothermal Euler (hydrodynamics) equations.

Isothermal hydro has no energy equation. The sound speed cs is a fixed parameter. The conserved variables are density and momenta only.

Waves:

1D: u-cs, u+cs (2 waves) 2D: u-cs, u (shear y), u+cs (3 waves) 3D: u-cs, u (shear y), u (shear z), u+cs (4 waves)

There is no entropy wave since there is no energy/pressure to evolve.

Module Contents#

Functions#

diff_safe_sqrt

Square root with a small floor, so its derivative stays finite at x = 0.

API#

astronomix._fluid_equations._eigen_hydro_iso.diff_safe_sqrt(x)[source]#

Square root with a small floor, so its derivative stays finite at x = 0.

The derivative of sqrt(x) is 1 / (2 sqrt(x)), which blows up as x -> 0; clamping the argument to a tiny epsilon keeps the backward pass well-behaved.