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
54649eb4
Commit
54649eb4
authored
Sep 15, 2016
by
Matthieu Schaller
Browse files
Clean-up before merge
parent
b8f6da05
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/const.h
View file @
54649eb4
...
...
@@ -40,8 +40,8 @@
#define const_isothermal_internal_energy 20.2615290634f
/* Dimensionality of the problem */
//
#define HYDRO_DIMENSION_3D
#define HYDRO_DIMENSION_2D
#define HYDRO_DIMENSION_3D
//
#define HYDRO_DIMENSION_2D
//#define HYDRO_DIMENSION_1D
/* Hydrodynamical adiabatic index. */
...
...
@@ -64,8 +64,8 @@
/* SPH variant to use */
//#define MINIMAL_SPH
//
#define GADGET2_SPH
#define HOPKINS_PE_SPH
#define GADGET2_SPH
//
#define HOPKINS_PE_SPH
//#define DEFAULT_SPH
//#define GIZMO_SPH
...
...
src/hydro/PressureEntropy/hydro.h
View file @
54649eb4
...
...
@@ -305,20 +305,21 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force(
/* Compute the pressure */
const
float
half_dt
=
(
ti_current
-
(
p
->
ti_begin
+
p
->
ti_end
)
/
2
)
*
timeBase
;
const
float
pressure
=
hydro_get_pressure
(
p
,
half_dt
);
const
float
entropy
=
hydro_get_entropy
(
p
,
half_dt
);
const
float
pressure
=
gas_pressure_from_entropy
(
p
->
rho_bar
,
entropy
);
/* Compute the sound speed from the pressure*/
const
float
soundspeed
=
gas_soundspeed_from_pressure
(
p
->
rho_bar
,
pressure
);
/* Divide the pressure by the density squared to get the SPH term */
const
float
rho_bar_inv
=
1
.
f
/
p
->
rho_bar
;
const
float
P_over_rho2
=
pressure
*
rho_bar_inv
*
rho_bar_inv
;
/* Compute the Balsara switch */
const
float
balsara
=
abs_div_v
/
(
abs_div_v
+
curl_v
+
0
.
0001
f
*
soundspeed
/
fac_mu
/
p
->
h
);
/* Compute "grad h" term */
/* Divide the pressure by the density squared to get the SPH term */
const
float
rho_bar_inv
=
1
.
f
/
p
->
rho_bar
;
const
float
P_over_rho2
=
pressure
*
rho_bar_inv
*
rho_bar_inv
;
/* 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
=
...
...
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