We propose the attached patch for the file EOS_Omni/src/nuc_eos_cxx/helpers.hh of EOS_Omni in order to fix a bug that causes GRHydro to fail in some situations involving tabulated EOSs.
We are currently working on the development of our GRMHD code, "Spritz", which will be capable of dealing with tabulated EOS, considering the evolution of Temperature, T, and Electron Fraction, Y_e. In order to test the implementation, we are currently performing some TOV tests with both Spritz and GRHydro, adopting the LS220 tabulated EOS that we downloaded from the stellarcollapse website. We realized that the EOS_Omni thorn may present some issues when dealing with tabulated nuclear EOS. In particular, when T must be found in relation to other thermodynamic quantities, this is normally done by the EOS_Omni thorn by computing T through a Newton-Raphson routine with a "fall-back" on Bisection method in the case of too many iterations (the procedure is related to the routines "nuc_eos_findtemp" and "bisection" contained in the file "EOS_Omni/src/nuc_eos_cxx/helpers.hh" - if the number of iterations performed by Newton-Raphson is greater that one hard-coded 200 value, then the Bisection method is called). With our tests for the LS220 EOS, we do see that the calculation of T, in some cases, may not perform well. Specifically, with the GRHydro code, roughly after 144 iterations the T goes above the prescribed parameter "GRHydro_max_temp" (which we imagine being chosen in accordance with the maximum value of T given in the Table), so the simulation is stopped. With Spritz, as well, we clearly get one wrong T value (well above T_max given in the table).
This issue is probably related to a weak dependence of T on \epsilon and can be solved by using the bisection method, see Section IV of Galeazzi, Kastaun, Rezzolla, and Font, PRD (2013). Lorenzo Sala, one of our collaborators, already implemented this modification in the aforementioned routines of the EOS_Omni thorn. In the modified version, if the energy dependence on the temperature is weak, i.e., if the derivative of the function is too large and therefore the Newton-Raphson routine may overshoot (in the routine "nuc_eos_findtemp"), the code switches to a safer bisection method (in the routine "bisection"). In addition, the "bisection" routine presents a slight modification in order to be sure of not going below the minimum of tabulated temperature value. With these modifications, both tests with GRHydro and Spritz result to be successful and well in accordance.
We would like to propose the inclusion of the modified EOS_Omni thorn in the future releases of the EinsteinToolkit, in order to provide the community with this more robust version. For your reference, I attach:
1- the file "helpers.hh" containing our proposed modifications; 2- a patch file "diff_STDvsMOD.txt" where I compared the standard (STD) vs the modified (MOD) helpers.hh file 3 - a file "LS220_RHOmax.pdf" with a plot showing the evolution of maximum density for the TOV test with the LS220 EOS and comparing the results obtained with Spritz and GRHydro plus the standard and modified EOS_Omni thorn; 4- a file "LS220_Tmax.pdf", which is the same as 3 but for maximum temperature.
Best Regards, Federico Cipolletta.
users@lists.einsteintoolkit.org