pelahi / VELOCIraptor-STF

Galaxy/(sub)Halo finder for N-body simulations
MIT License
19 stars 26 forks source link

Read cosmology from snapshot #76

Closed JBorrow closed 4 years ago

JBorrow commented 4 years ago

It would be really helpful if VR could read cosmology (Omega_b, Omega_L, Omega_m) information from the snapshot and store this in the output

pelahi commented 4 years ago

VR does read cosmology information from a snapshot (if present) and overwrites any values provide in the config file. Should I add a message saying this has occurred?

MatthieuSchaller commented 4 years ago

Then we should remove the entries in the VR config file used for EAGLE-XL. In that way they don't get overwritten by mistake.

Is Omega_b in the output?

JBorrow commented 4 years ago

Hmm, I think what must be the problem then is the reading of Omega_b - this is always zero in our outputs.

pelahi commented 4 years ago

You are correct as by default all other parameters save Omega_m and Omega_L are typically not stored in the header information for most Gadget HDF5 outputs I've used. I will update this to load in all the possible cosmology information if the code is reading a swift snapshot. I assume I can use colibre/eagle snapshots as an example of the cosmology information that will typically be included. If there are updates to run with dark energy with specific equations of state, inclusion of neutrinos, or other fluids, I will have to update VR to use that extra information. For truly arbitrary cosmologies, it may be necessary to provide the cosmic expansion history. And for modified gravity theories, I would have to update the Poisson equation. But I think that's fine to leave on a todo list for a while.

MatthieuSchaller commented 4 years ago

How do you compute the linking length in hydro simulations if you don't have Omega_b ?

pelahi commented 4 years ago

I use the mass of gas particles (this was for gadget and ramses input). But now the code reads the information if the input is a swift file.

MatthieuSchaller commented 4 years ago

Coming back to the linking length, I do this in the VR invocation:

https://gitlab.cosma.dur.ac.uk/swift/swiftsim/blob/master/src/velociraptor_interface.c#L518 (up to line 552)

Is that different from what you would internally when using a snapshot?

pelahi commented 4 years ago

For simple N-body runs, I just use period/ndark^(1/3) to get the interparticle spacing. But in other circumstances I use the mass of the dark matter particle and the density of dark matter to determine the interparticle spacing like you are doing here.

MatthieuSchaller commented 4 years ago

But I do use omega_b on line 547 in the case of a zoom with hydro.

pelahi commented 4 years ago

I also make use of Omega_b to get Omega_cdm. And use the combined mass of a dark matter particle and a baryon particle to use Omega_m. But I can remove mass_baryon which for hydro zooms with star formation and feedback are not the primordial gas particle mass. Easy to do, just need to store rho_cdm and not just rho_m.