-
Notifications
You must be signed in to change notification settings - Fork 32
2D Sod
Illustrates the ability of a code to resolve shocks and contact discontinuities over a narrow region. Parameters from Sod (1978). The test consists of two constant states (on left pressure and density are equal to 1; on right they are equal to 0.1) separated by a discontinuity at 0.5. Gamma is set to 1.4. This test is performed with the default hydro build (cholla/builds/make.type.hydro
) and Van Leer integrator.
Modified to add zl_bcnd=0 and zu_bcnd=0.
#
# Parameter File for 2D Sod Shock tube
#
################################################
# number of grid cells in the x dimension
nx=100
# number of grid cells in the y dimension
ny=100
# number of grid cells in the z dimension
nz=1
# final output time
tout=0.2
# time interval for output
outstep=0.2
# name of initial conditions
init=Riemann
# domain properties
xmin=0.0
ymin=0.0
zmin=0.0
xlen=1.0
ylen=1.0
zlen=1.0
# type of boundary conditions
xl_bcnd=3
xu_bcnd=3
yl_bcnd=3
yu_bcnd=3
zl_bcnd=0
zu_bcnd=0
# path to output directory
outdir=./
#################################################
# Parameters for 2D Riemann problems
# density of left state
rho_l=1.0
# velocity of left state
vx_l=0.0
vy_l=0.0
vz_l=0.0
# pressure of left state
P_l=1.0
# density of right state
rho_r=0.1
# velocity of right state
vx_r=0.0
vy_r=0.0
vz_r=0.0
# pressure of right state
P_r=0.1
# location of initial discontinuity
diaph=0.5
# value of gamma
gamma=1.4
Upon completion, you should obtain two output files. The initial and final densities (in code units) of a slice along the y-midplane is shown below. Examples of how to plot projections and slices can be found in cholla/python_scripts/Projection_Slice_Tutorial.ipynb
.
A skewer in x along the y and z midplanes yields the traditional 1-dimension solution, shown below (pink dots) plotted over the exact solution (purple line).
We can see a rarefaction wave on the left side, followed first by a contact discontinuity and then a shock.