Skip to content
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

WIP: Cosmology support for VL+CT #187

Draft
wants to merge 32 commits into
base: main
Choose a base branch
from

Conversation

mabruzzo
Copy link
Contributor

This is a WIP PR for making the VL+CT solver support cosmology, when run without magnetic fields. This builds off of PR #186. I'm pretty confident in the correctness of my implementation.

To try to test it, I tried to quickly port the Zeldovich Pancake test. Unfortunately, this took a lot longer than I expected and I ran into some issues. I'm not sure when exactly I'll have time to get back to this, so I wanted to post my progress so far.

The following shows what happens over the first 8 cycles of the simulation when initializing an x-axis aligned Zeldovich Pancake:
image
To reproduce this plot, use this input file at input/Cosmology/ZeldovichPancake/vlct-HD-x-aligned.in and this python script.

In the final snapshot, you can see that we start to enforce the density floor near the edges of the domain. The bottom row shows the relative difference between the total energy and the kinetic energy. In the second to-last snapshot this goes to a negative number on the domain edge which suggests we're encountering the problem that the dual-energy formalism is supposed to address. For reference, this simulation doesn't currently use the dual-energy formalism (we need a minor change introduced in PR #173 for EnzoMethodComovingExpansion to properly support the VLCT solver with the dual-energy formalism - but I can manually port that to this PR as well).

I suspect that I made a transcription error in porting the Zeldovich Pancale initializer. I was definitely not very careful (especially about units). However, it would be helpful if someone knowledgable about the test in Enzo can:

  • comment if the dual-energy formalism is strictly necessary for this test
  • potentially provide me with some snapshots of the Enzo results (on a uniform grid) that I can eventually use for comparisons

If people really want this feature sooner, we could shelve this test for now and come up with something simpler...

@gregbryan
Copy link
Contributor

gregbryan commented May 30, 2022

This doesn't look crazy in terms of shape, but units are worrying -- the pancake should have a cosmic mean density, and at z=20 that is much higher than what is given (assuming CGS units). The dual energy formalism was developed and tested on this problem, so it's pretty useful (as shown in the bottom panel -- note that just because this is positive doesn't mean it's right). I couldn't quickly dig up Enzo plots but happy to do so once you get back to this. It's just a matter of running the enzo test problem and plotting the same outputs.

@mabruzzo mabruzzo linked an issue Jun 6, 2022 that may be closed by this pull request
@jwise77 jwise77 added this to the v1.0 milestone Jun 15, 2022
@peeples peeples requested review from gregbryan and jwise77 June 30, 2022 15:11
@mabruzzo mabruzzo removed this from the v1.0 milestone Jun 30, 2022
@mabruzzo
Copy link
Contributor Author

There's a dual-energy related issue. This is not going to be done for the v1.0 release

mabruzzo added 12 commits July 21, 2023 14:28
Strictly speaking, this only required 2 minor tweaks to ``EnzoMethodMHDVlct``:
  1. modify the compatability checking of ``EnzoMethodMHDVlct::post_init_checks_`` related to using the VL+CT solver with cosmology.
  2. modify all usage of the cell widths in ``EnzoMethodMHDVlct::compute`` (which would have defaulted to the cell width in the comoving frame) to instead use the proper cell width.

As part of this commit, occurences of the variables named `cell_width` in the relevant code (i.e. paths executed by ``EnzoMethodMHDVlct::compute``) were renamed so that they are called `proper_cell_width`. The docstrings of these functions were also updated accordingly.
I factored out the solution to the Zeldovich pancake problem (for a pressure-free fluid) into a separate functor. By doing this, it should be easier to understand when we are talking about a pressure-free fluid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Zel'dovich pancake test
3 participants