Skip to content

3D Spherical Collapse

Bob Caddy edited this page Jan 25, 2024 · 17 revisions

3D Spherical Collapse

This test illustrates the ability of a code to handle gravitational collapse due to spherical overdensity. The test consists of a sphere of radius 0.2 centered at (0.5, 0.5, 0.5) with a density of 1, surrounded by a background density of 0.0005. Pressure is constant everywhere at 0.0005. This test is performed with the gravity build (cholla/builds/make.type.gravity). Full initial conditions can be found in cholla/src/grid/initial_conditions.cppunder Spherical_Overdensity_3D().

Parameter file: (cholla/examples/3D/Spherical_Collapse.txt)

Note that the output directory needs to be changed for the user.

#
# Parameter File for the 3D Sphere Collapse.
#

######################################
# number of grid cells in the x dimension
nx=256
# number of grid cells in the y dimension
ny=256
# number of grid cells in the z dimension
nz=256
# output time
tout=0.38
# how often to output
outstep=0.01
# value of gamma
gamma=1.66666667
# name of initial conditions
init=Spherical_Overdensity_3D
# 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=1
xu_bcnd=1
yl_bcnd=1
yu_bcnd=1
zl_bcnd=1
zu_bcnd=1
# path to output directory
outdir=/data/groups/comp-astro/bruno/cosmo_sims/sphere_collapse/output_files/
#outdir=/raid/bruno/data/cosmo_sims/cholla_pm/sphere_collapse/
#outdir=/gpfs/alpine/scratch/bvilasen/ast149/sphere_collapse/output_files/

Upon completion, you should obtain 39 output files. The initial and final densities (in code units) of a slice along the z-midplane is shown below. Examples of how to plot projections and slices can be found in cholla/python_scripts/Projection_Slice_Tutorial.ipynb.

Initial Density

A 2D histogram, showing density of cells in the xy plane at y=128. The plot is the initial state density plot at t = 0 with an over dense spherical region in the center.

Final Density

A 2D histogram, showing density of cells in the xy plane at y=128. The plot is the final state density plot at t = 0.38 with an over dense spherical region in the center that is slightly smaller than in the initial conditions.
Clone this wiki locally