Open jtlaune opened 8 years ago
@jtlaune Great work on all this!
Interpolating EoS tables is a tricky subject, as has to use a monotonic and thermodynamically consistent scheme (see Maiden et al 1997). That's the reason merge_grid routines just removed missing points, instead of trying to recover them by interpolation. We do lose some data, but if you look at the rho - Temp grid I think it has non uniform sampling with a high sampling rate near solid density and at the critical point, so we don't lose that much precision after all, and the fluid description in those regions is not great anyway. When things go wrong it's just easier to say that that was because the original sesame table has issues, rather than see what happened in the intermediary partially interpolated version.
This also means that linear interpolation might the only monotonic scheme you can use from scipy. But then again, I'm not sure what happens to thermodynamic consistency when you interpolate twice (once when writing the table, and a second time in FLASH) so if that can be avoided it might be best.
In the error plots, I don't understand the difference in the ion tables: normally both the ionmix and the converted sesame should have exactly the same grid and data, and the error should be 0 there? The error in the elector tables (bellow 1-10 eV and solid density) doesn't look so bad, and might be normal after a few grid points were removed in the merge_grid routines.
@rth @tzeferacos
opacplot.utils.EosMergeGrids()
is currently used to merge electron/ion density and temperature grids for SESAME.In it,
numpy.intersect1d()
is used to define a mask for the intersection of the grids. However, this process will lose any data points that are not shared exactly by the two, even if they are within range for interpolation. Is this desired? Or could it help to reduce error if there was interpolation for points that were within the range for interpolation?This process did not remove any points in the test file
matr_009999.ses
. However, with a full-length table, I have found that this process cuts around 7 density points and 6 temperature points out of a SESAME table.Furthermore, when error checking, there are specific points for high error percentages in my full-length SESAME table after converting it to IONMIX, and I believe this could be a contributing factor. I have attached plots regarding this issue.