EEDM is an exact 3D method of breaking down the total energy density associated with compound nonlinear gravitational ideal-MHD disturbances into the energy contributions carried by each eigenmode. For more details, see Paper 1, Paper 2 , and Paper 3. For the MPI-parallelized domain decomposition, the AutoParallelizePy Python plug-in is used.
Axel Raboonik
Email: raboonik@gmail.com
GitHub: https://github.com/raboonik
1) When cloning, use the --recurse-submodules flag (see Step 1 below).
2) This version currently only works with Lare3D V2 and V3 (.sdf and .cfd), and Mancha (.h5). Get in touch to add support for your MHD simulation code!
Make sure the following Python3 packages are installed
numpy
h5py
SciPy
mpi4py
Note for LareXd > V3 users: If you are working with .sdf files, it is assumed that a compatible Python interface for reading this format using sdf.read already exists in your environment.
git clone --recurse-submodules https://github.com/raboonik/EEDM.git
cd EEDM/
Modify settings.py to set the analysis tasks
Run the code from EEDM/ using:
mpirun -n [#cores] python3 -m eedm
You can also install the EEDM package and run it from anywhere (inside or outside of EEDM/) using the same command. To install in editable mode, run:
cd EEDM/
pip install -e .
As mentioned, the curent version of the code handles lareXd (sdf and cfd snapshot extensions) and Mancha (h5 snapshot extension), and outputs h5 files containing the eigenpowers (eigenenergy time derivatives) and/or the eigenenergies themselves associated with each of the nine gravitational-ideal-MHD modes in each of the three x, y, and z Cartesian directions separately. The computations are done according to Equations 6 and 9 of Paper 3. If g = 0, the code reduces to the non-gravitational ideal-MHD equations of Paper 2. Note that although the EEDM method is valid for any 3D gravitational field (prescribed by a gravitational potential), the current version of the code is tailored to solar/stellar atmospheric use assuming uniform gravity along -z.
The main outputs are the eigenpowers (Equation 6), eigenenergies (Equation 9), and grid/parameter data. These are stored in the following three separate directories:
Equation 6: <|SimulationDir|>/EEDM_results/Decomposed_EigenEnergies/PaperIII_Eq_6_3D/
Equation 9: <|SimulationDir|>/EEDM_results/Decomposed_EigenEnergies/PaperIII_Eq_9_2DSlabs/
Grid/parameters: <|SimulationDir|>/EEDM_results/grid_params.h5
For 3D simulation data, the eigenpowers (Equation 6) are computed in 3D. However, due to the storage-intensive nature of the computations, the eigenenergies (Equation 9) are only computed on 2D slabs set by the user. The user is given the option to compute the eigenenergies (Equation 9) on one or more 2D slabs. This is controlled by the "slicingPlane" and "slicingPnts" variables in EEDM/settings.py.
Note that computing Equation 6 is a prerequisite for computing Equation 9 (as the latter is just the time-integral of the former).
An additional file named grid_params.h5 is outputted, which contains the meshgrid data and important parameters used in the analysis.
The optional outputs below (of which the first two are more important) can be switched on in the code. These are
• the pre-decomposition terms of the total energy (i.e., the kinetic, internal, magnetic, and gravitational energies) stored in <|SimulationDir|>/EEDM_results/Predecomposition_Energies. These are frequently required to evaluate the accuracy of the EEDM analysis (see Paper 3).
• the characteristic speeds aq, csq, cfq (for q in [x,y,z]) stored in <|SimulationDir|>/EEDM_results/Char_Speeds
• extra information on the polytropic coefficient and the magnetic field divergence as measured by the numerical differential method used in the code, stored in SimulationDir/EEDM_results/Extras
###q-directed (for q in [x,y,z]):
Divergence: "eq6_m1_q" Entropy : "eq6_m2_q" Aflven- : "eq6_m3_q" Aflven+ : "eq6_m4_q" slow- : "eq6_m5_q" slow+ : "eq6_m6_q" fast- : "eq6_m7_q" fast+ : "eq6_m8_q" Gravity : "eq6_m9_z" These 2D-slabs contain both the eigenpowers and eigenenergies on the specified 2D planes.
###q-directed eigenenergies (for q in [x,y,z]):
Divergence: "eq9_m1_q" Entropy : "eq9_m2_q" Aflven- : "eq9_m3_q" Aflven+ : "eq9_m4_q" slow- : "eq9_m5_q" slow+ : "eq9_m6_q" fast- : "eq9_m7_q" fast+ : "eq9_m8_q" Gravity : "eq9_m9_z" ###q-directed speeds (for q in [x,y,z]):
Aflven: "aq" slow : "csq" fast : "cfq" Output keys of kinetic, internal, magnetic, and gravitational energies ("Etot_<|snapshot_name|>.h5")
Kinetic : "Kin" Internal: "Int" Magnetic: "Mag" Gravity : "Grv" For all versions of Mancha, we assume that the user input snapshot prescribing the background plasma is stored in a single h5 file named "background_plasma.h5" stored under the same directory as the main simulation snapshots. This file must contain all the initial values of rho, vx, vy, vz, bx, by, bz, and pe (using the same keys as standard Mancha snapshots). The user may flag the special case where all of these variables are zero by setting simCode = mancha_0. In this case, the inclusion of "background_plasma.h5" becomes redundant.
The latest version of Mancha outputs two separate H5 snapshots at each data-dumping time step, namely, <|snapshot_timestep|>_i.h5 and <|snapshot_timestep|>_i_extra.h5, where we assume that the former contains rho, vx, vy, vz, bx, by, bz, and the latter contains the gas pressure pe. If you are using this version, note that the EEDM will need the "extra" snapshots to read the gas pressure from.