Skip to content
Snippets Groups Projects
Commit a2fb917e authored by Jacob Kegerreis's avatar Jacob Kegerreis
Browse files

Avoid unusual extrapolating for low u with tables

parent abf607bd
Branches
Tags
2 merge requests!1109More EoS,!1099WIP: More eos
......@@ -385,6 +385,14 @@ INLINE static float SESAME_pressure_from_internal_energy(
P_2 = mat->table_P_rho_T[idx_rho * mat->num_T + idx_u_1 + 1];
P_3 = mat->table_P_rho_T[(idx_rho + 1) * mat->num_T + idx_u_2];
P_4 = mat->table_P_rho_T[(idx_rho + 1) * mat->num_T + idx_u_2 + 1];
// If below the minimum u at this rho then just use the lowest table values
if ((idx_rho > 0.f) && (
(intp_u_1 < 0.f) || (intp_u_2 < 0.f) || (P_1 > P_2) || (P_3 > P_4)
)) {
intp_u_1 = 0;
intp_u_2 = 0;
}
// If more than two table values are non-positive then return zero
int num_non_pos = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment