1D setups

Shocktube

The image below shows the result of the shocktube test for a domain with 100 cells:

_images/setup_sod.png
class ulula.setups.shocktube.SetupShocktube(unit_l=1.0, unit_t=1.0, unit_m=1.0)

Superclass for a shocktube problem in 1D

The Sod (1978) shocktube problem is a class test for Riemann solvers. A sharp break in fluid properties at the center of a 1D domain causes a shock, contact discontinuity, and rarefaction wave. The problem can be solved analytically. The solution used here was taken from Frank van den Bosch’s and Susanne Hoefner’s lecture notes.

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)

Freefall

This setup is mostly a test of the gravity solver. The outflow BCs mean that the entire domain is free-falling. We compare the position of a Gaussian gas blob to the known solution.

_images/setup_freefall.png
class ulula.setups.freefall.SetupFreefall(unit_l=1.0, unit_t=1.0, unit_m=1.0)

Gravitational free-fall

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)

Atmosphere

This setup represents the Earth’s atmosphere in 1D and demonstrates that the density and pressure settle into the expected exponential profile (for an isothermal equation of state). The setup also demonstrates code units, which are set to kilometers, hours, and tons.

class ulula.setups.atmosphere.SetupAtmosphere(unit_l=100000.0, unit_t=3600.0, unit_m=1000000000000.0, T_K=300.0)

Earth’s hydrostratic atmosphere

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.

T_K: float

Air temperature in Kelvin.

__init__(unit_l=100000.0, unit_t=3600.0, unit_m=1000000000000.0, T_K=300.0)