-
Notifications
You must be signed in to change notification settings - Fork 36
Adiabatic expansion test ICs and documentation #471
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
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # 3D Adaibatic Expansion Test | ||
|
|
||
| This test demonstrates simple adiabatic expansion in a cosmological frame. The initial conditions are the critical density in baryons at the starting redshift, T=100K, and no bulk velocity. Gamma is set to 5/3. This test is performed with the cosmology build (`cholla/builds/make.type.cosmology`) and SIMPLE integrator. | ||
| Full initial conditions can be found in `cholla/src/grid/initial_conditions.cpp`under `Adiabatic_Expansion()`. | ||
|
|
||
| ## Parameter file: | ||
|
|
||
| This parameter file can be found in [examples/3D/Adiabatic_Expansion.txt](https://github.com/cholla-hydro/cholla/blob/main/examples/3D/Adiabatic_Expansion.txt) on the `dev` branch. | ||
| ``` | ||
| # | ||
| # Parameter File for the 3D Adiabatic Expansion test. | ||
| # | ||
|
|
||
| ###################################### | ||
| # number of grid cells in the x dimension | ||
| nx=256 | ||
| # number of grid cells in the y dimension | ||
| ny=32 | ||
| # number of grid cells in the z dimension | ||
| nz=32 | ||
| # output time | ||
| tout=1000 | ||
| # how often to output | ||
| outstep=1000 | ||
| # value of gamma | ||
| gamma=1.66666667 | ||
| # name of initial conditions | ||
| init=Adiabatic_Expansion | ||
| #Cosmological Parameters | ||
| Init_redshift=20.0 | ||
| #Init_redshift=0.998294693667 | ||
| H0=50.0 | ||
| Omega_M=1.0 | ||
| Omega_L=0.0 | ||
| Omega_b=1.0 | ||
| temperature_floor=1.0e-2 | ||
| scale_outputs_file=scale_output_files/outputs_adiabatic_expansion.txt | ||
| # domain properties | ||
| xmin=0.0 | ||
| ymin=0.0 | ||
| zmin=0.0 | ||
| xlen=64000.0 | ||
| ylen=8000.0 | ||
| zlen=8000.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 | ||
| indir=ics/ | ||
| outdir=./ | ||
| ``` | ||
|
|
||
| Upon completion, you should obtain two output files. The final density, velocity, and temperature in physical units are shown below. | ||
| :::{figure} adiabatic_expansion.png | ||
| Adiabatic Expansion test solution from Cholla. | ||
| ::: |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # | ||
| # Parameter File for the 3D Adiabatic Expansion test. | ||
| # | ||
|
|
||
| ###################################### | ||
| # number of grid cells in the x dimension | ||
| nx=256 | ||
| # number of grid cells in the y dimension | ||
| ny=32 | ||
| # number of grid cells in the z dimension | ||
| nz=32 | ||
| # output time | ||
| tout=1000 | ||
| # how often to output | ||
| outstep=1000 | ||
| # value of gamma | ||
| gamma=1.66666667 | ||
| # name of initial conditions | ||
| init=Adiabatic_Expansion | ||
| #Cosmological Parameters | ||
| Init_redshift=20.0 | ||
| #Init_redshift=0.998294693667 | ||
| H0=50.0 | ||
| Omega_M=1.0 | ||
| Omega_L=0.0 | ||
| Omega_b=1.0 | ||
| temperature_floor=1.0e-2 | ||
| scale_outputs_file=scale_output_files/outputs_zeldovich_grav4.txt | ||
| # domain properties | ||
| xmin=0.0 | ||
| ymin=0.0 | ||
| zmin=0.0 | ||
| xlen=64000.0 | ||
| ylen=8000.0 | ||
| zlen=8000.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 | ||
| indir=ics/ | ||
| outdir=./ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -214,6 +214,8 @@ void Particles3D::Initialize(Parameters *P, const SpatialDomainProps &spatial_pr | |
| Initialize_Sphere(P); | ||
| } else if (strcmp(P->init, "Zeldovich_Pancake") == 0) { | ||
| Initialize_Zeldovich_Pancake(P); | ||
| } else if (strcmp(P->init, "Adiabatic_Expansion") == 0) { | ||
|
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. I assume these modifications to the particles ICs are only necessary because the cosmology make-type by default includes particles?
Collaborator
Author
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. Yes, in tests I tried to compile the code with cosmology and without particles and the compilation failed. |
||
| Initialize_Adiabatic_Expansion(P); | ||
| } else if (strcmp(P->init, "Read_Grid") == 0) { | ||
| Load_Particles_Data(P); | ||
| } else if (strcmp(P->init, "Isolated_Stellar_Cluster") == 0) { | ||
|
|
@@ -1139,6 +1141,17 @@ void Particles3D::Initialize_Zeldovich_Pancake(struct Parameters *P) | |
| chprintf(" Particles Zeldovich Pancake Initialized, n_local: %lu\n", n_local); | ||
| } | ||
|
|
||
| void Particles3D::Initialize_Adiabatic_Expansion(struct Parameters *P) | ||
| { | ||
| // No particles for the Adiabatic Expansion problem. n_local=0 | ||
|
|
||
| chprintf("Setting Adiabatic Expansion initial conditions...\n"); | ||
|
|
||
| n_local = 0; | ||
|
|
||
| chprintf(" Particles Adiabatic Expansion initialized, n_local: %lu\n", n_local); | ||
| } | ||
|
|
||
| void Grid3D::Initialize_Uniform_Particles() | ||
| { | ||
| // Initialize positions assigning one particle at each cell in a uniform grid | ||
|
|
||
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.
Are these additions in the Zeldovich Pancake ICs intentional?
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.
(It's possible git is just confused about which parts of the file have changed, given that below it appears as though the end of the new Adiabatic Expansion test has not been altered, I just want to double-check that this file looks as intended.)
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.
Yes, they are intentional. They reflect how the adiabatic ICs are set. You can remove them if you want, and I can add them back after I am done with testing the Zeldovich test.