2D setups
Advection
The following image shows the results of the advection test for four combinations of hydro solvers. This test can be run with the function given in the runtime examples (see Running Ulula).
The initially spherical and perfectly sharp circle with higher density is advected through the box on a diagonal trajectory. When using no spatial reconstruction (top left), the scheme is extremely diffusive (and 1st order in space and time). When using linear reconstruction with the MinMod limiter but still a 1st-order in time Euler integrator (top right), the results are better but still pretty diffusive. When using a less diffusive slope limiter (MC, bottom left), the scheme is unstable and explodes. Using the MUSCL-Hancock 2nd-order scheme (bottom right) leads to a stable and much less diffusive solution.
- class ulula.setups.advection.SetupAdvection(unit_l=1.0, unit_t=1.0, unit_m=1.0)
Tophat advection test
In this test, an initially overdense tophat is placed at the center of the domain. The entire fluid moves towards the northeast direction. This test is the 2D equivalent of tophat advection in 1D and mostly tests how diffusive a hydro solver is.
- Parameters:
- unit_l: float
Code unit for length in units of centimeters.
- unit_t: float
Code unit for time in units of seconds.
- unit_m: float
Code unit for mass in units of gram.
- __init__(unit_l=1.0, unit_t=1.0, unit_m=1.0)
Cloud crushing
The following plots show the evolution of the default cloud crushing setup implemented in the class below.
This test was run with a relatively low resolution of 100x300, which leads to a fast execution time. However, the results of the cloud crushing test depend quite strongly on resolution.
- class ulula.setups.cloud_crushing.SetupCloudCrushing(unit_l=1.0, unit_t=1.0, unit_m=1.0)
Cloud-crushing setup
In this setup, a denser cloud is embedded in a hot, fast-moving, less dense wind at equal pressure. The cloud is rapidly destroyed.
- Parameters:
- unit_l: float
Code unit for length in units of centimeters.
- unit_t: float
Code unit for time in units of seconds.
- unit_m: float
Code unit for mass in units of gram.
- __init__(unit_l=1.0, unit_t=1.0, unit_m=1.0)
Kelvin-Helmholtz instability
The following images show the evolution of the standard Kelvin-Helmholtz setup implemented in the class below.
This test can be run in less than a minute (see, e.g., the example function in Running Ulula).
- class ulula.setups.kelvin_helmholtz.SetupKelvinHelmholtz(sharp_ics=False, n_waves=1, unit_l=1.0, unit_t=1.0, unit_m=1.0)
Kelvin-Helmholtz instability
The KH instability forms at the interface between two fluids that are moving past each other. The user can choose between a setup where the interface is infinitely sharp and the smooth ICs of Robertson et al. 2010. In the sharp case, the instability is seeded by grid noise, but we still add a small velocity perturbation to obtain more well-defined behavior. The smooth version is recommended as it leads to a more physical test case.
- Parameters:
- sharp_ics: bool
Use sharp boundary between fluids instead of smoothed ICs.
- n_waves: int
Number of wave periods in the domain. The number of periods that can be resolved depends on the resolution.
- unit_l: float
Code unit for length in units of centimeters.
- unit_t: float
Code unit for time in units of seconds.
- unit_m: float
Code unit for mass in units of gram.
- __init__(sharp_ics=False, n_waves=1, unit_l=1.0, unit_t=1.0, unit_m=1.0)
Sedov-Taylor explosion
The following image shows the Sedov-Taylor test when the blastwave is about to reach the edge of the box:
Ulula can also plot the results binned in radial annuli:
The analytical solution is part of the setup class below.
- class ulula.setups.sedov.SetupSedov(E=50.0, rho0=1.0, gamma=1.6666666666666667, unit_l=1.0, unit_t=1.0, unit_m=1.0)
Sedov-Taylor explosion
The Sedov-Taylor solution represents a blastwave created by a large amount of energy that is injected at the center of the domain. If the energy is much larger than the thermal energy of the surrounding gas, the solution is self-similar, i.e., does not depend on any physical scale and evolves in time as a power-law.
In this setup, the energy is distributed in a Gaussian with a radius of ~1 cell. This avoids grid artifacts that can arise to the square nature of the grid cells. The exact solution code is adapted from the Gandalf code by Hubber et al.
- Parameters:
- E: float
Explosion energy in code units; the thermal energy in the domain is about unity in these units, so
E
should be significantly larger than unity- rho0: float
The density of the surrounding medium in code units
- gamma: float
The adiabatic index of the gas
- unit_l: float
Code unit for length in units of centimeters.
- unit_t: float
Code unit for time in units of seconds.
- unit_m: float
Code unit for mass in units of gram.
- __init__(E=50.0, rho0=1.0, gamma=1.6666666666666667, unit_l=1.0, unit_t=1.0, unit_m=1.0)
Rayleigh-Taylor instability
The following images show the evolution of the Rayleigh-Taylor instability setup implemented in the class below. Note how the top of the cold mushroom structure forms its own Rayleigh-Taylor instability as it rises.
- class ulula.setups.rayleigh_taylor.SetupRayleighTaylor(n_waves=0.5, aspect_ratio=3.0, unit_l=1.0, unit_t=1.0, unit_m=1.0)
Rayleigh-Taylor instability
- Parameters:
- n_waves: float
The number of waves by which the boundary is perturbed.
- aspect_ratio: float
The ratio of y to x extent of the domain.
- unit_l: float
Code unit for length in units of centimeters.
- unit_t: float
Code unit for time in units of seconds.
- unit_m: float
Code unit for mass in units of gram.
- __init__(n_waves=0.5, aspect_ratio=3.0, unit_l=1.0, unit_t=1.0, unit_m=1.0)
Tidal disruption
This test uses a user-defined gravitational potential of a point mass. A gas blob comes close to the mass and is disrupted.
- class ulula.setups.tidal_disruption.SetupTidalDisruption(unit_l=1.0, unit_t=1.0, unit_m=1.0)
Gravitational tidal disruption
- Parameters:
- unit_l: float
Code unit for length in units of centimeters.
- unit_t: float
Code unit for time in units of seconds.
- unit_m: float
Code unit for mass in units of gram.
- __init__(unit_l=1.0, unit_t=1.0, unit_m=1.0)