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
1d895563
Commit
1d895563
authored
Oct 09, 2016
by
Matthieu Schaller
Browse files
Drift entopy in grad-h term for PE-SPH
parent
bec2f704
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/hydro/PressureEntropy/hydro.h
View file @
1d895563
...
...
@@ -338,11 +338,10 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force(
/* Compute "grad h" term (note we use rho here and not rho_bar !)*/
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
pressure_dh
=
p
->
density
.
pressure_dh
*
rho_inv
*
p
->
h
*
hydro_dimension_inv
;
const
float
grad_h_term
=
rho_dh
*
pressure_dh
;
...
...
src/hydro/PressureEntropy/hydro_iact.h
View file @
1d895563
...
...
@@ -255,8 +255,9 @@ __attribute__((always_inline)) INLINE static void runner_iact_force(
/* Now, convolve with the kernel */
const
float
visc_term
=
0
.
5
f
*
visc
*
(
wi_dr
+
wj_dr
);
const
float
sph_term
=
(
S_gamma_j
/
S_gamma_i
-
f_i
)
*
P_over_rho2_i
*
wi_dr
+
(
S_gamma_i
/
S_gamma_j
-
f_j
)
*
P_over_rho2_j
*
wj_dr
;
const
float
sph_term
=
(
S_gamma_j
/
S_gamma_i
-
f_i
/
S_gamma_i
)
*
P_over_rho2_i
*
wi_dr
+
(
S_gamma_i
/
S_gamma_j
-
f_j
/
S_gamma_j
)
*
P_over_rho2_j
*
wj_dr
;
/* Eventually got the acceleration */
const
float
acc
=
(
visc_term
+
sph_term
)
*
r_inv
;
...
...
@@ -365,8 +366,9 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force(
/* Now, convolve with the kernel */
const
float
visc_term
=
0
.
5
f
*
visc
*
(
wi_dr
+
wj_dr
);
const
float
sph_term
=
(
S_gamma_j
/
S_gamma_i
-
f_i
)
*
P_over_rho2_i
*
wi_dr
+
(
S_gamma_i
/
S_gamma_j
-
f_j
)
*
P_over_rho2_j
*
wj_dr
;
const
float
sph_term
=
(
S_gamma_j
/
S_gamma_i
-
f_i
/
S_gamma_i
)
*
P_over_rho2_i
*
wi_dr
+
(
S_gamma_i
/
S_gamma_j
-
f_j
/
S_gamma_j
)
*
P_over_rho2_j
*
wj_dr
;
/* Eventually got the acceleration */
const
float
acc
=
(
visc_term
+
sph_term
)
*
r_inv
;
...
...
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