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
b8f6da05
Commit
b8f6da05
authored
Sep 14, 2016
by
Matthieu Schaller
Browse files
Move the calculation of the grad-h term in prepare_force() for PE-SPH.
parent
d025615d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/hydro/PressureEntropy/hydro.h
View file @
b8f6da05
...
...
@@ -270,12 +270,6 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
/* Final operation on the weighted density */
p
->
rho_bar
*=
entropy_minus_one_over_gamma
;
/* Compute the derivative term */
p
->
density
.
rho_dh
=
1
.
f
/
(
1
.
f
+
hydro_dimension_inv
*
h
*
p
->
density
.
rho_dh
*
rho_inv
);
p
->
density
.
pressure_dh
*=
h
*
rho_inv
*
hydro_dimension_inv
*
entropy_minus_one_over_gamma
;
/* Finish calculation of the velocity curl components */
p
->
density
.
rot_v
[
0
]
*=
h_inv_dim_plus_one
*
rho_inv
;
p
->
density
.
rot_v
[
1
]
*=
h_inv_dim_plus_one
*
rho_inv
;
...
...
@@ -325,7 +319,14 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force(
abs_div_v
/
(
abs_div_v
+
curl_v
+
0
.
0001
f
*
soundspeed
/
fac_mu
/
p
->
h
);
/* Compute "grad h" term */
const
float
grad_h_term
=
p
->
density
.
rho_dh
*
p
->
density
.
pressure_dh
;
const
float
rho_inv
=
1
.
f
/
p
->
rho
;
const
float
entropy_minus_one_over_gamma
=
1
.
f
/
p
->
entropy_one_over_gamma
;
const
float
rho_dh
=
1
.
f
/
(
1
.
f
+
hydro_dimension_inv
*
p
->
h
*
p
->
density
.
rho_dh
*
rho_inv
);
const
float
pressure_dh
=
p
->
density
.
pressure_dh
*
rho_inv
*
p
->
h
*
hydro_dimension_inv
*
entropy_minus_one_over_gamma
;
const
float
grad_h_term
=
rho_dh
*
pressure_dh
;
/* Update variables. */
p
->
force
.
soundspeed
=
soundspeed
;
...
...
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