New issue 1054: Derived magnetic quantities are broken under the chombo frontend https://bitbucket.org/yt_analysis/yt/issues/1054/derived-magnetic-quantities...
Various quantities that are derived from the magnetic field, including 'plasma_beta' and 'magnetic_pressure', do not work with chombo in the current development branch. The problem is a naming convention conflict: yt/fields/magnetic_field.py defines 'magnetic_energy' to be the magnetic energy density (i.e., energy per unit volume), but the chombo frontend calls all per unit volume quantities X_density (e.g., 'magnetic_energy_density'), and redefines 'magnetic_energy' to be the energy per unit mass, consistent with how 'kinetic_energy' and 'thermal_energy' are defined. This breaks everything in magnetic_field.py that expects the 'magnetic_energy' field to be an energy density.
As far as I can tell this issue is specific to the chombo frontend. From a code standpoint the fix is trivial: just get rid of the 'magnetic_energy' field in the chombo frontend, and revert to the one defined generically. However, this would break the naming convention for chombo, because it would make 'magnetic_energy' an energy per unit volume, while 'thermal_energy' and 'kinetic_energy' are energies per unit mass. The cleanest fix is therefore probably to change all the energy quantity names in the same way, for example changing 'magnetic_energy' to 'specific_magnetic_energy', and similarly for the other quantities. This would probably be a good change on its own, since it's a bit confusing to define 'magnetic_energy' as an energy per unit mass, and similar for other quantities.
The problem is that this fix is likely to break some analysis scripts that rely on the current naming convention. I would therefore like to ask other chombo users to weigh in on the best course of action. If there is consensus that it's ok to change the definitions of the energies, I can submit a patch quite easily.