Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
a2fb917e
Commit
a2fb917e
authored
Jun 28, 2020
by
Jacob Kegerreis
Browse files
Avoid unusual extrapolating for low u with tables
parent
abf607bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/equation_of_state/planetary/sesame.h
View file @
a2fb917e
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment