-
Notifications
You must be signed in to change notification settings - Fork 38
Updating Documented Examples #459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
marina-pitt24
wants to merge
39
commits into
cholla-hydro:dev
Choose a base branch
from
marina-pitt24:new_docs
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
7014301
added 1d blast page
d0be951
added 1d blast to index
60571e2
fixed file path to png
8db6564
updated plots and wording for blast-1d
c8405f7
shu-osher and fixed blast png
ade63c8
add strong shock, added sphinxcontrib.video to conf, added square wave
d855e25
add strong shock, added sphinxcontrib.video to conf, added square wave
0de7815
added section for 2d khd
7626ebc
added spaces for examples and documented plotting scripts
cdb68ff
added plots to two shocks,soundwave, having trouble building and seei…
b0e5e3b
added plots and edited files for KHD and 2d disk
88a489a
removed scripts from PythonExamples
9946e63
removed some empty files
de5a340
this build version works
154dd92
modified strong shock
a812f3c
changes made to adress issue
a309d3b
this builds
e366f54
build works, edited square wave file and strong shock
ee99579
resolved conflict
001c402
added 2d-khd, reference image for shu-osher
3a7f7ec
fixed image formatting + file wording
e15879a
square wave page
b0aae3e
added two shocks
3057f92
added more examples, still need to update KHRI
744d796
khri included with both resolutions
de1e353
added 2d plotting example script as md file
6e421e7
added 1d plotting script
1865cc6
added noh and implosion
903c385
reconstruction methods section edited
71a397c
added KHD and SQWV plottig scripts
cbcf8d0
all new updated plots, movies, and links
dd5542d
fixed NOH fyris alpha link
6ae74bf
blast link
6642dac
edited reconstruction page
7457123
Merge branch 'dev' into new_docs
marina-pitt24 6681fd8
edited implosion page
5c91fe6
updated formatting and links
59c605e
new khri plots and soundwave movie
484a379
Merge branch 'dev' into new_docs
evaneschneider File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # 1D Shu and Osher test | ||
| This test (Shu & Osher, 1989) highlights the ability of a code to resolve small scale smooth flow and shocks simultaneously. Further, it shows how lower resolution solutions can cut off some of the amplitude of maxima due to the slope limiters. Parameters are from Stone et al., 2008, Section 8.1. The test consists of left and right states separated at x = -0.8. On the left, density is set to 3.857143, pressure to 10.33333, and velocity to 2.629369. On the right, density is sinusoidally varying: $\rho(x)$ = 1.0 + 0.2 $\sin(5.0\pi x)$. Pressure is set to 1.0 and the velocity is 0.0. Gamma is set to 1.4. This test is performed with the hydro build (`cholla/builds/make.type.hydro`). Full initial conditions can be found in `cholla/src/grid/initial_conditions.cpp`under `Shu_Osher()`. | ||
|
|
||
| **Important:** This test must be run with diode boundaries [disabled](https://github.com/alwinm/cholla/tree/main-diode) in order to perform as expected (thank you @alwinm!). This branch also uses the Van Leer integrator. | ||
|
|
||
| The parameter file can be found at {repository-file}`examples/1D/Shu_Osher.txt` | ||
|
|
||
|
|
||
| ## Parameter file | ||
|
|
||
| :::{literalinclude} parameter-file.txt | ||
| ::: | ||
|
|
||
| Upon completion, you should obtain 2 output files. The initial and final density, pressure, and velocity (in code units) of the solution is shown below. Examples of how to extract and plot data can be found in the [General 1D Plotting Example](../../PythonExamples/1D-plotting.md). | ||
|
|
||
| :::{figure} shu-osher.png | ||
|
|
||
|
|
||
| With the diode disabled, this solution does match that of Schneider and Robertson 2015 and Stone et al. 2008, shown below: | ||
|
|
||
| :::{figure} schneider-robertson-2015.png | ||
| :width: 500px | ||
| :align: center | ||
| ::: | ||
|
|
||
|
|
||
36 changes: 36 additions & 0 deletions
36
docs/sphinx/ChollaExamples/1D-Shu-Osher/parameter-file.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # | ||
| # Parameter File for the Shu-Osher shock tube test, originally from | ||
| # Shu & Osher, 1989. These parameters are from Stone et al., 2008, Section 8.1 | ||
| # | ||
|
|
||
| ###################################### | ||
| # number of grid cells in the x dimension | ||
| nx=200 | ||
| # number of grid cells in the y dimension | ||
| ny=1 | ||
| # number of grid cells in the z dimension | ||
| nz=1 | ||
| # final output time | ||
| tout=0.47 | ||
| # time interval for output | ||
| outstep=0.47 | ||
| # value of gamma | ||
| gamma=1.4 | ||
| # name of initial conditions | ||
| init=Shu_Osher | ||
| # domain properties | ||
| xmin=-1.0 | ||
| ymin=0.0 | ||
| zmin=0.0 | ||
| xlen=2.0 | ||
| ylen=1.0 | ||
| zlen=1.0 | ||
| # type of boundary conditions | ||
| xl_bcnd=3 | ||
| xu_bcnd=3 | ||
| yl_bcnd=0 | ||
| yu_bcnd=0 | ||
| zl_bcnd=0 | ||
| zu_bcnd=0 | ||
| # path to output directory | ||
| outdir=./ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # 1D Sod Shock Tube | ||
| This test highlights the ability of a code to resolve shocks and contact discontinuities over a narrow region. Parameters from Sod (1978). The setup consists of a density and pressure of 1.0 for x \< 0 and 0.1 for x \> 0.5. Gamma is set to 1.4. This test was performed with the hydro build (`cholla/builds/make.type.hydro`) and Van Leer integrator. Full initial conditions can be found in `cholla/src/grid/initial_conditions.cpp`under `Riemann()`. | ||
|
|
||
|
|
||
| The parameter file can be found at {repository-file}`examples/1D/sod.txt` | ||
|
|
||
| ## Parameter File: | ||
| ``` | ||
| # | ||
| # Parameter File for 1D Sod Shock tube | ||
| # | ||
|
|
||
| ################################################ | ||
| # number of grid cells in the x dimension | ||
| nx=100 | ||
| # number of grid cells in the y dimension | ||
| ny=1 | ||
| # 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=0 | ||
| yu_bcnd=0 | ||
| zl_bcnd=0 | ||
| zu_bcnd=0 | ||
| # path to output directory | ||
| outdir=./ | ||
|
|
||
| ################################################# | ||
| # Parameters for 1D 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 density, pressure, and velocity (in code units) of the solution is shown below. Examples of how to extract and plot data can be found in the [General 1D Plotting Example](../../PythonExamples/1D-plotting.md). | ||
|
|
||
| :::{figure} sod-initial-final.png | ||
| ::: | ||
|
|
||
| We see a rarefaction wave propagating away from the initial discontinuity, a contact discontinuity at x = 0.7, and a shock at x =0.9. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # 1D Sound Wave | ||
| This test initializes a compression/rarefaction wave across the grid. The setup consists of an initial density and pressure of 1.0 and 0.6, respectively. A sound wave is initialized as a sinusoidal wave with amplitude 1e-4 and wavelength of 1.0. Gamma is set to 1.666666666666667. This test was performed with the hydro build (`cholla/builds/make.type.hydro`) and Van Leer integrator. Full initial conditions can be found in `cholla/src/grid/initial_conditions.cpp`under `Sound_Wave()`. | ||
|
|
||
| The parameter file can be found at: {repository-file}`examples/1D/sound_wave.txt` | ||
|
|
||
| ## Parameter file: | ||
| ``` | ||
| # | ||
| # Parameter File for sound wave test | ||
| # | ||
|
|
||
| ################################################ | ||
| # number of grid cells in the x dimension | ||
| nx=128 | ||
| # number of grid cells in the y dimension | ||
| ny=1 | ||
| # number of grid cells in the z dimension | ||
| nz=1 | ||
| # final output time | ||
| tout=0.05 | ||
| # time interval for output | ||
| outstep=0.01 | ||
| # name of initial conditions | ||
| init=Sound_Wave | ||
| # size of domain | ||
| 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=0 | ||
| yu_bcnd=0 | ||
| zl_bcnd=0 | ||
| zu_bcnd=0 | ||
| # path to output directory | ||
| outdir=./sowvout | ||
|
|
||
| ################################################# | ||
| # Parameters for linear wave problems | ||
| # initial density | ||
| rho=1.0 | ||
| # velocity in the x direction | ||
| vx=0 | ||
| # velocity in the y direction | ||
| vy=0 | ||
| # velocity in the z direction | ||
| vz=0 | ||
| # initial pressure | ||
| P=0.6 | ||
| # amplitude of perturbing oscillations | ||
| A=1e-4 | ||
| # value of gamma | ||
| gamma=1.666666666666667 | ||
|
|
||
| ``` | ||
| Upon completion, you should obtain five output files. By changing the outstep to 1, we can obtain the evolution of the density, pressure, and velocity. Examples of how to extract and plot data can be found in the [General 1D Plotting Example](../../PythonExamples/1D-plotting.md). | ||
|
|
||
| :::{video} new_soundwave_2.mp4 | ||
| :width: 700 | ||
| :height: 500 | ||
| :align: center | ||
| :autoplay: | ||
| :loop: | ||
| ::: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we're going to show a movie on this page it would be nice to show the evolution of the wave for a full period. So perhaps instead of modifying the outstep to 0.005, you could modify the final output time to 1.0. |
||
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| # 1D Square Wave | ||
| This test initializes a square wave density pertubation. The setup consists of an initial density and pressure of 1.0 and 0.01, respectively. A square wave is initialized with amplitude 1.5. Gamma is set to 1.666666666666667. This test was performed with the hydro build (`cholla/builds/make.type.hydro`) and Van Leer integrator. Full initial conditions can be found in `cholla/src/grid/initial_conditions.cpp`under `Square_Wave()`. | ||
|
|
||
| The parameter file can be found at: {repository-file}`examples/1D/square_wave.txt` | ||
|
|
||
| ## Parameter file: | ||
| ``` | ||
| # | ||
| # Parameter File for square wave test | ||
| # | ||
|
|
||
| ################################################ | ||
| # number of grid cells in the x dimension | ||
| nx=100 | ||
| # number of grid cells in the y dimension | ||
| ny=1 | ||
| # number of grid cells in the z dimension | ||
| nz=1 | ||
| # final output time | ||
| tout=1.0 | ||
| # time interval for output | ||
| outstep=0.01 | ||
| n_hydro=1 | ||
| # name of initial conditions | ||
| init=Square_Wave | ||
| # size of domain | ||
| 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=0 | ||
| yu_bcnd=0 | ||
| zl_bcnd=0 | ||
| zu_bcnd=0 | ||
| # path to output directory | ||
| outdir=./ | ||
|
|
||
| ################################################# | ||
| # Parameters for square wave | ||
| # initial density | ||
| rho=1.0 | ||
| # velocity in the x direction | ||
| vx=1.0 | ||
| # velocity in the y direction | ||
| vy=0 | ||
| # velocity in the z direction | ||
| vz=0 | ||
| # initial pressure | ||
| P=0.01 | ||
| # relative amplitude of overdense region | ||
| A=1.5 | ||
| # value of gamma | ||
| gamma=1.666666666666667 | ||
| ``` | ||
| Upon completion, you should obtain 101 output files. The evolution of the density is shown below. Pressure is constant to the $10^{-14}$ level. Examples of how to extract and plot data can be found in the [General 1D Plotting Example](../../PythonExamples/1D-plotting.md). | ||
|
|
||
|
|
||
| :::{video} square-docs.mp4 | ||
| :width: 640 | ||
| :height: 480 | ||
| :autoplay: | ||
| :loop: | ||
| :align: center | ||
| ::: | ||
|
|
||
| We see a square waveform of amplitude 1.5 propagating rightwards. | ||
|
|
||
| If the wave is left to propagate for an extended period of time, we observe a rapid breakdown in the structure. This breakdown is much faster with the Van Leer integrator than with the Simple integrator: | ||
|
|
||
| Van Leer: | ||
|
|
||
| <img src="https://github.com/user-attachments/assets/52248416-8606-43e8-bac5-8d4179581785" width="682" height="452" /> | ||
|
|
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| # 1D Strong Shock | ||
| This test is similar to the Sod shock tube but has higher initial pressure and density differences. This shows the ability of a code to limit oscillatory behavior in areas of high density and pressure contrasts. The setup consists of a density and pressure of 10.0 and 100.0, respectively, for 0 \< x \< 0.5 and density= pressure = 1.0 for 0.5 \< x \< 1.0. Gamma is set to 1.4. This test was performed with the hydro build (`cholla/builds/make.type.hydro`) and Van Leer integrator. Full initial conditions can be found in `cholla/src/grid/initial_conditions.cpp`under `Riemann()`. | ||
|
|
||
| The parameter file can be found at: {repository-file}`examples/1D/strong_shock.txt` | ||
|
|
||
| ## Parameter file: | ||
| ``` | ||
| # | ||
| # Parameter File for 1D strong shock test | ||
| # | ||
|
|
||
| ################################################ | ||
| # number of grid cells in the x dimension | ||
| nx=100 | ||
| # number of grid cells in the y dimension | ||
| ny=1 | ||
| # number of grid cells in the z dimension | ||
| nz=1 | ||
| # final output time | ||
| tout=0.07 | ||
| # time interval for output | ||
| outstep=0.07 | ||
| # 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=0 | ||
| yu_bcnd=0 | ||
| zl_bcnd=0 | ||
| zu_bcnd=0 | ||
| # path to output directory | ||
| outdir=./ | ||
|
|
||
| ################################################# | ||
| # Parameters for 1D Riemann problems | ||
| # density of left state | ||
| rho_l=10.0 | ||
| # velocity of left state | ||
| vx_l=0.0 | ||
| vy_l=0.0 | ||
| vz_l=0.0 | ||
| # pressure of left state | ||
| P_l=100.0 | ||
| # density of right state | ||
| rho_r=1.0 | ||
| # velocity of right state | ||
| vx_r=0.0 | ||
| vy_r=0.0 | ||
| vz_r=0.0 | ||
| # pressure of right state | ||
| P_r=1.0 | ||
| # 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 density, velocity, and pressure (in code units) of the solution is shown below. Examples of how to extract and plot data can be found in the [General 1D Plotting Example](../../PythonExamples/1D-plotting.md). | ||
|
|
||
| :::{figure} snapshots_strongshock.png | ||
|
|
||
evaneschneider marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| We see a rarefaction expanding from just after the initial discontinuity, followed by a contact discontinuity at x =0.75 and a shock at x = 0.85. There is very slight oscillatory behavior around x = 0.7 but it is limited. | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warning about diode boundaries that is in the wiki page for this test should be added here. See https://github.com/cholla-hydro/cholla/wiki/1D-Shu-Osher