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
b61090f9
Commit
b61090f9
authored
Jan 09, 2020
by
Josh Borrow
Committed by
Matthieu Schaller
Jan 09, 2020
Browse files
Sphenix SPH
parent
a798ebdd
Changes
21
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
b61090f9
...
...
@@ -1555,8 +1555,11 @@ case "$with_hydro" in
planetary)
AC_DEFINE([PLANETARY_SPH], [1], [Planetary SPH])
;;
sphenix)
AC_DEFINE([SPHENIX_SPH], [1], [SPHENIX SPH])
;;
anarchy-du)
AC_DEFINE([
ANARCHY_DU
_SPH], [1], [
ANARCHY (DU)
SPH])
AC_DEFINE([
SPHENIX
_SPH], [1], [
SPHENIX
SPH])
;;
anarchy-pu)
AC_DEFINE([ANARCHY_PU_SPH], [1], [ANARCHY (PU) SPH])
...
...
doc/RTD/source/HydroSchemes/anarchy_sph.rst
View file @
b61090f9
...
...
@@ -62,64 +62,3 @@ There is also a compile-time parameter, ``viscosity_beta`` that we set to
``hydro_props_default_viscosity_alpha_feedback_reset = 2.0`` and the
diffusion is set to ``hydro_props_default_diffusion_alpha_feedback_reset =
0.0``. These can be changed in ``src/hydro/AnarchyPU/hydro_parameters.h``.
ANARCHY-DU SPH
==============
This is the new scheme that will be used in EAGLE-XL. This scheme includes:
+ Durier & Dalla Vecchia (2012) time-step limiter
+ Density-Energy SPH
+ Thermal diffusion following Price (2012)
+ A simplified version of the 'Inviscid SPH' artificial viscosity
(Cullen & Dehnen 2010), with a Balsara switch
+ A diffusion limiter, used to prevent energy leakage out of EAGLE
supernovae (Borrow in prep).
More information will be made available in a forthcoming publication.
The simplified version of the 'Inviscid SPH' artificial viscosity calculates
the time differential of the velocity divergence explicitly, using the value
from the previous step. We also use the Balsara switch instead of the improved
neighbour-based limiter from Cullen & Dehnen 2010, to avoid matrix
calculations.
The diffusion limiter is implemented to ensure that the diffusion is turned
ff in very viscous flows and works as follows:
.. code-block:: C
float new_diffusion_alpha = old_diffusion_alpha;
const float viscous_diffusion_limit =
diffusion_alpha_max *
(1.f - maximum_alpha_visc_over_ngb / viscosity_alpha_max);
new_diffusion_alpha = min(new_diffusion_alpha, viscous_diffusion_limit);
The parameters available for this scheme, and their defaults, are:
.. code-block:: yaml
SPH:
viscosity_alpha: 0.1 # Initial value for the alpha viscosity
viscosity_length: 0.25 # Viscosity decay length (in terms of sound-crossing time)
# These are enforced each time-step
viscosity_alpha_max: 2.0 # Maximal allowed value for the viscosity alpha
viscosity_alpha_min: 0.0 # Minimal allowed value for the viscosity alpha
diffusion_alpha: 0.0 # Initial value for the diffusion alpha
diffusion_beta: 0.25 # Timescale to raise the diffusion coefficient over
# (decay is on the sound-crossing time)
# These are enforced each time-step
diffusion_alpha_max: 1.0
diffusion_alpha_min: 0.0
There is also a compile-time parameter, ``viscosity_beta`` that we set to
3.0. During feedback events, the viscosity is set to the compile-time
``hydro_props_default_viscosity_alpha_feedback_reset = 2.0`` and the
diffusion is set to ``hydro_props_default_diffusion_alpha_feedback_reset =
0.0``. These can be changed in ``src/hydro/AnarchyPU/hydro_parameters.h``.
doc/RTD/source/HydroSchemes/index.rst
View file @
b61090f9
...
...
@@ -18,6 +18,7 @@ schemes available in SWIFT, as well as how to implement your own.
planetary
hopkins_sph
anarchy_sph
sphenix_sph
gizmo
adding_your_own
doc/RTD/source/HydroSchemes/sphenix_sph.rst
0 → 100644
View file @
b61090f9
.. SPHENIX SPH
Josh Borrow 8th January 2020
SPHENIX
=======
This is the new scheme that will be used in EAGLE-XL. This scheme includes:
+ Durier & Dalla Vecchia (2012) time-step limiter
+ Density-Energy SPH
+ Thermal diffusion following Price (2012)
+ A simplified version of the 'Inviscid SPH' artificial viscosity
(Cullen & Dehnen 2010), with a Balsara switch
+ A diffusion limiter, used to prevent energy leakage out of EAGLE
supernovae (Borrow+ 2020).
The simplified version of the 'Inviscid SPH' artificial viscosity calculates
the time differential of the velocity divergence explicitly, using the value
from the previous step. We also use the Balsara switch instead of the improved
neighbour-based limiter from Cullen & Dehnen 2010, to avoid matrix
calculations.
To configure with this scheme, use
.. code-block:: bash
./configure --with-hydro=sphenix --with-kernel=quintic-spline --disable-hand-vec
The diffusion limiter is implemented to ensure that the diffusion is turned
off in very viscous flows and works as follows:
.. code-block:: C
float new_diffusion_alpha = old_diffusion_alpha;
const float viscous_diffusion_limit =
diffusion_alpha_max *
(1.f - maximum_alpha_visc_over_ngb / viscosity_alpha_max);
new_diffusion_alpha = min(new_diffusion_alpha, viscous_diffusion_limit);
The parameters available for this scheme, and their defaults, are:
.. code-block:: yaml
SPH:
viscosity_alpha: 0.1 # Initial value for the alpha viscosity
viscosity_length: 0.25 # Viscosity decay length (in terms of sound-crossing time)
# These are enforced each time-step
viscosity_alpha_max: 2.0 # Maximal allowed value for the viscosity alpha
viscosity_alpha_min: 0.0 # Minimal allowed value for the viscosity alpha
diffusion_alpha: 0.0 # Initial value for the diffusion alpha
diffusion_beta: 0.25 # Timescale to raise the diffusion coefficient over
# (decay is on the sound-crossing time)
# These are enforced each time-step
diffusion_alpha_max: 1.0
diffusion_alpha_min: 0.0
There is also a compile-time parameter, ``viscosity_beta`` that we set to
3.0. During feedback events, the viscosity is set to the compile-time
``hydro_props_default_viscosity_alpha_feedback_reset = 2.0`` and the
diffusion is set to ``hydro_props_default_diffusion_alpha_feedback_reset =
0.0``. These can be changed in ``src/hydro/SPHENIX/hydro_parameters.h``.
src/Makefile.am
View file @
b61090f9
...
...
@@ -130,9 +130,9 @@ nobase_noinst_HEADERS = align.h approx_math.h atomic.h barrier.h cycle.h error.h
hydro/AnarchyPU/hydro.h hydro/PressureEnergy/hydro_iact.h hydro/PressureEnergy/hydro_io.h
\
hydro/AnarchyPU/hydro_debug.h hydro/PressureEnergy/hydro_part.h
\
hydro/AnarchyPU/hydro_parameters.h
\
hydro/
AnarchyDU
/hydro.h hydro/PressureEnergy/hydro_iact.h hydro/PressureEnergy/hydro_io.h
\
hydro/
AnarchyDU
/hydro_debug.h hydro/PressureEnergy/hydro_part.h
\
hydro/
AnarchyDU
/hydro_parameters.h
\
hydro/
SPHENIX
/hydro.h hydro/PressureEnergy/hydro_iact.h hydro/PressureEnergy/hydro_io.h
\
hydro/
SPHENIX
/hydro_debug.h hydro/PressureEnergy/hydro_part.h
\
hydro/
SPHENIX
/hydro_parameters.h
\
hydro/Gizmo/hydro_parameters.h
\
hydro/Gizmo/hydro_io.h hydro/Gizmo/hydro_debug.h
\
hydro/Gizmo/hydro.h hydro/Gizmo/hydro_iact.h
\
...
...
src/debug.c
View file @
b61090f9
...
...
@@ -58,8 +58,8 @@
#include
"./hydro/Shadowswift/hydro_debug.h"
#elif defined(PLANETARY_SPH)
#include
"./hydro/Planetary/hydro_debug.h"
#elif defined(
ANARCHY_DU
_SPH)
#include
"./hydro/
AnarchyDU
/hydro_debug.h"
#elif defined(
SPHENIX
_SPH)
#include
"./hydro/
SPHENIX
/hydro_debug.h"
#elif defined(ANARCHY_PU_SPH)
#include
"./hydro/AnarchyPU/hydro_debug.h"
#else
...
...
src/hydro.h
View file @
b61090f9
...
...
@@ -67,10 +67,10 @@
#include
"./hydro/Planetary/hydro.h"
#include
"./hydro/Planetary/hydro_iact.h"
#define SPH_IMPLEMENTATION "Minimal version of SPH with multiple materials"
#elif defined(
ANARCHY_DU
_SPH)
#include
"./hydro/
AnarchyDU
/hydro.h"
#include
"./hydro/
AnarchyDU
/hydro_iact.h"
#define SPH_IMPLEMENTATION "
ANARCHY (Density-Energy) SPH
(Borrow+
in prep
)"
#elif defined(
SPHENIX
_SPH)
#include
"./hydro/
SPHENIX
/hydro.h"
#include
"./hydro/
SPHENIX
/hydro_iact.h"
#define SPH_IMPLEMENTATION "
SPHENIX
(Borrow+
2020
)"
#elif defined(ANARCHY_PU_SPH)
#include
"./hydro/AnarchyPU/hydro.h"
#include
"./hydro/AnarchyPU/hydro_iact.h"
...
...
src/hydro/
AnarchyDU
/hydro.h
→
src/hydro/
SPHENIX
/hydro.h
View file @
b61090f9
...
...
@@ -17,14 +17,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#ifndef SWIFT_
ANARCHY_DU
_HYDRO_H
#define SWIFT_
ANARCHY_DU
_HYDRO_H
#ifndef SWIFT_
SPHENIX
_HYDRO_H
#define SWIFT_
SPHENIX
_HYDRO_H
/**
* @file
AnarchyDU
/hydro.h
* @file
SPHENIX
/hydro.h
* @brief Density-Energy conservative implementation of SPH,
* with added ANARCHY physics (Cullen & Denhen 2011 AV,
* Price 2008 thermal diffusion (Non-neighbour loop
* with added SPHENIX physics (Borrow 2020) (Non-neighbour loop
* equations)
*/
...
...
@@ -1083,4 +1082,4 @@ hydro_set_init_internal_energy(struct part *p, float u_init) {
p
->
u
=
u_init
;
}
#endif
/* SWIFT_
ANARCHY_DU
_HYDRO_H */
#endif
/* SWIFT_
SPHENIX
_HYDRO_H */
src/hydro/
AnarchyDU
/hydro_debug.h
→
src/hydro/
SPHENIX
/hydro_debug.h
View file @
b61090f9
...
...
@@ -18,14 +18,13 @@
*
******************************************************************************/
#ifndef SWIFT_
ANARCHY_DU
_HYDRO_DEBUG_H
#define SWIFT_
ANARCHY_DU
_HYDRO_DEBUG_H
#ifndef SWIFT_
SPHENIX
_HYDRO_DEBUG_H
#define SWIFT_
SPHENIX
_HYDRO_DEBUG_H
/**
* @file
AnarchyDU
/hydro_debug.h
* @file
SPHENIX
/hydro_debug.h
* @brief Density-Energy conservative implementation of SPH,
* with added ANARCHY physics (Cullen & Denhen 2011 AV,
* Price 2008 thermal diffusion (Debugging routines)
* with added SPHENIX physics (Borrow 2020) (Debugging routines)
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_debug_particle
(
...
...
@@ -44,4 +43,4 @@ __attribute__((always_inline)) INLINE static void hydro_debug_particle(
p
->
viscosity
.
alpha
,
p
->
time_bin
);
}
#endif
/* SWIFT_
ANARCHY_DU
_HYDRO_DEBUG_H */
#endif
/* SWIFT_
SPHENIX
_HYDRO_DEBUG_H */
src/hydro/
AnarchyDU
/hydro_iact.h
→
src/hydro/
SPHENIX
/hydro_iact.h
View file @
b61090f9
...
...
@@ -17,14 +17,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#ifndef SWIFT_
ANARCHY_DU
_HYDRO_IACT_H
#define SWIFT_
ANARCHY_DU
_HYDRO_IACT_H
#ifndef SWIFT_
SPHENIX
_HYDRO_IACT_H
#define SWIFT_
SPHENIX
_HYDRO_IACT_H
/**
* @file
AnarchyDU
/hydro_iact.h
* @file
SPHENIX
/hydro_iact.h
* @brief Density-Energy conservative implementation of SPH,
* with added ANARCHY physics (Cullen & Denhen 2011 AV,
* Price 2008 thermal diffusion (interaction routines)
* with added SPHENIX physics (Borrow 2020) (interaction routines)
*/
#include
"adiabatic_index.h"
...
...
@@ -572,4 +571,4 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force(
pi
->
viscosity
.
v_sig
=
max
(
pi
->
viscosity
.
v_sig
,
v_sig
);
}
#endif
/* SWIFT_
ANARCHY_DU
_HYDRO_IACT_H */
#endif
/* SWIFT_
SPHENIX
_HYDRO_IACT_H */
src/hydro/
AnarchyDU
/hydro_io.h
→
src/hydro/
SPHENIX
/hydro_io.h
View file @
b61090f9
...
...
@@ -17,14 +17,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#ifndef SWIFT_
ANARCHY_DU
_HYDRO_IO_H
#define SWIFT_
ANARCHY_DU
_HYDRO_IO_H
#ifndef SWIFT_
SPHENIX
_HYDRO_IO_H
#define SWIFT_
SPHENIX
_HYDRO_IO_H
/**
* @file
AnarchyDU
/hydro_io.h
* @file
SPHENIX
/hydro_io.h
* @brief Density-Energy conservative implementation of SPH,
* with added ANARCHY physics (Cullen & Denhen 2011 AV,
* Price 2008 thermal diffusion (i/o routines)
* with added SPHENIX physics (Borrow 2020) (i/o routines)
*/
#include
"adiabatic_index.h"
...
...
@@ -236,4 +235,4 @@ INLINE static void hydro_write_flavour(hid_t h_grpsph) {
*/
INLINE
static
int
writeEntropyFlag
(
void
)
{
return
0
;
}
#endif
/* SWIFT_
ANARCHY_DU
_HYDRO_IO_H */
#endif
/* SWIFT_
SPHENIX
_HYDRO_IO_H */
src/hydro/
AnarchyDU
/hydro_parameters.h
→
src/hydro/
SPHENIX
/hydro_parameters.h
View file @
b61090f9
...
...
@@ -18,8 +18,8 @@
*
******************************************************************************/
#ifndef SWIFT_
ANARCHY_DU
_HYDRO_PARAMETERS_H
#define SWIFT_
ANARCHY_DU
_HYDRO_PARAMETERS_H
#ifndef SWIFT_
SPHENIX
_HYDRO_PARAMETERS_H
#define SWIFT_
SPHENIX
_HYDRO_PARAMETERS_H
/* Configuration file */
#include
"config.h"
...
...
@@ -35,10 +35,9 @@
#include
"inline.h"
/**
* @file
AnarchyDU
/hydro_parameters.h
* @file
SPHENIX
/hydro_parameters.h
* @brief Density-Energy conservative implementation of SPH,
* with added ANARCHY physics (Cullen & Denhen 2011 AV,
* Price 2008 thermal diffusion (default compile-time
* with added SPHENIX physics (Borrow 2020) (default compile-time
* parameters).
*
* This file defines a number of things that are used in
...
...
@@ -301,4 +300,4 @@ static INLINE void diffusion_print_snapshot(
}
#endif
#endif
/* SWIFT_
ANARCHY_DU
_HYDRO_PARAMETERS_H */
#endif
/* SWIFT_
SPHENIX
_HYDRO_PARAMETERS_H */
src/hydro/
AnarchyDU
/hydro_part.h
→
src/hydro/
SPHENIX
/hydro_part.h
View file @
b61090f9
...
...
@@ -17,14 +17,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#ifndef SWIFT_
ANARCHY_DU
_HYDRO_PART_H
#define SWIFT_
ANARCHY_DU
_HYDRO_PART_H
#ifndef SWIFT_
SPHENIX
_HYDRO_PART_H
#define SWIFT_
SPHENIX
_HYDRO_PART_H
/**
* @file
AnarchyDU
/hydro_part.h
* @file
SPHENIX
/hydro_part.h
* @brief Density-Energy conservative implementation of SPH,
* with added ANARCHY physics (Cullen & Denhen 2011 AV,
* Price 2008 thermal diffusion (particle definition)
* with added SPHENIX physics (Borrow 2020) (particle definition)
*/
#include
"black_holes_struct.h"
...
...
@@ -216,4 +215,4 @@ struct part {
}
SWIFT_STRUCT_ALIGN
;
#endif
/* SWIFT_
ANARCHY_DU
_HYDRO_PART_H */
#endif
/* SWIFT_
SPHENIX
_HYDRO_PART_H */
src/hydro_io.h
View file @
b61090f9
...
...
@@ -41,8 +41,8 @@
#include
"./hydro/Shadowswift/hydro_io.h"
#elif defined(PLANETARY_SPH)
#include
"./hydro/Planetary/hydro_io.h"
#elif defined(
ANARCHY_DU
_SPH)
#include
"./hydro/
AnarchyDU
/hydro_io.h"
#elif defined(
SPHENIX
_SPH)
#include
"./hydro/
SPHENIX
/hydro_io.h"
#elif defined(ANARCHY_PU_SPH)
#include
"./hydro/AnarchyPU/hydro_io.h"
#else
...
...
src/hydro_parameters.h
View file @
b61090f9
...
...
@@ -47,8 +47,8 @@
#include
"./hydro/Shadowswift/hydro_parameters.h"
#elif defined(PLANETARY_SPH)
#include
"./hydro/Planetary/hydro_parameters.h"
#elif defined(
ANARCHY_DU
_SPH)
#include
"./hydro/
AnarchyDU
/hydro_parameters.h"
#elif defined(
SPHENIX
_SPH)
#include
"./hydro/
SPHENIX
/hydro_parameters.h"
#elif defined(ANARCHY_PU_SPH)
#include
"./hydro/AnarchyPU/hydro_parameters.h"
#else
...
...
src/part.h
View file @
b61090f9
...
...
@@ -74,8 +74,8 @@
#elif defined(PLANETARY_SPH)
#include
"./hydro/Planetary/hydro_part.h"
#define hydro_need_extra_init_loop 0
#elif defined(
ANARCHY_DU
_SPH)
#include
"./hydro/
AnarchyDU
/hydro_part.h"
#elif defined(
SPHENIX
_SPH)
#include
"./hydro/
SPHENIX
/hydro_part.h"
#define hydro_need_extra_init_loop 0
#define EXTRA_HYDRO_LOOP
#elif defined(ANARCHY_PU_SPH)
...
...
tests/test125cells.c
View file @
b61090f9
...
...
@@ -113,7 +113,7 @@ void set_energy_state(struct part *part, enum pressure_field press, float size,
part
->
u
=
pressure
/
(
hydro_gamma_minus_one
*
density
);
#elif defined(MINIMAL_SPH) || defined(HOPKINS_PU_SPH) || \
defined(HOPKINS_PU_SPH_MONAGHAN) || defined(ANARCHY_PU_SPH) || \
defined(
ANARCHY_DU
_SPH) || defined(DEFAULT_SPH)
defined(
SPHENIX
_SPH) || defined(DEFAULT_SPH)
part
->
u
=
pressure
/
(
hydro_gamma_minus_one
*
density
);
#elif defined(PLANETARY_SPH)
part
->
u
=
pressure
/
(
hydro_gamma_minus_one
*
density
);
...
...
@@ -406,7 +406,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell,
defined(GIZMO_MFV_SPH) || defined(SHADOWFAX_SPH) || \
defined(HOPKINS_PU_SPH) || defined(HOPKINS_PU_SPH_MONAGHAN)
0
.
f
,
#elif defined(ANARCHY_PU_SPH) || defined(
ANARCHY_DU
_SPH) || defined(DEFAULT_SPH)
#elif defined(ANARCHY_PU_SPH) || defined(
SPHENIX
_SPH) || defined(DEFAULT_SPH)
main_cell
->
hydro
.
parts
[
pid
].
viscosity
.
div_v
,
#else
main_cell
->
hydro
.
parts
[
pid
].
density
.
div_v
,
...
...
@@ -427,7 +427,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell,
defined(HOPKINS_PU_SPH_MONAGHAN)
main_cell
->
hydro
.
parts
[
pid
].
force
.
v_sig
,
0
.
f
,
main_cell
->
hydro
.
parts
[
pid
].
u_dt
#elif defined(ANARCHY_PU_SPH) || defined(
ANARCHY_DU
_SPH) || defined(DEFAULT_SPH)
#elif defined(ANARCHY_PU_SPH) || defined(
SPHENIX
_SPH) || defined(DEFAULT_SPH)
main_cell
->
hydro
.
parts
[
pid
].
viscosity
.
v_sig
,
0
.
f
,
main_cell
->
hydro
.
parts
[
pid
].
u_dt
#else
...
...
tests/test27cells.c
View file @
b61090f9
...
...
@@ -289,7 +289,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell,
main_cell
->
hydro
.
parts
[
pid
].
density
.
rot_v
[
0
],
main_cell
->
hydro
.
parts
[
pid
].
density
.
rot_v
[
1
],
main_cell
->
hydro
.
parts
[
pid
].
density
.
rot_v
[
2
]
#elif defined(ANARCHY_PU_SPH) || defined(
ANARCHY_DU
_SPH) || defined(DEFAULT_SPH)
#elif defined(ANARCHY_PU_SPH) || defined(
SPHENIX
_SPH) || defined(DEFAULT_SPH)
/* this is required because of the variable AV scheme */
main_cell
->
hydro
.
parts
[
pid
].
viscosity
.
div_v
,
main_cell
->
hydro
.
parts
[
pid
].
density
.
rot_v
[
0
],
...
...
@@ -334,7 +334,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell,
cj
->
hydro
.
parts
[
pjd
].
density
.
rot_v
[
0
],
cj
->
hydro
.
parts
[
pjd
].
density
.
rot_v
[
1
],
cj
->
hydro
.
parts
[
pjd
].
density
.
rot_v
[
2
]
#elif defined(ANARCHY_PU_SPH) || defined(
ANARCHY_DU
_SPH) || defined(DEFAULT_SPH)
#elif defined(ANARCHY_PU_SPH) || defined(
SPHENIX
_SPH) || defined(DEFAULT_SPH)
/* this is required because of the variable AV scheme */
cj
->
hydro
.
parts
[
pjd
].
viscosity
.
div_v
,
cj
->
hydro
.
parts
[
pjd
].
density
.
rot_v
[
0
],
...
...
tests/testActivePair.c
View file @
b61090f9
...
...
@@ -113,7 +113,7 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
part
->
entropy
=
1
.
f
;
#elif defined(MINIMAL_SPH) || defined(HOPKINS_PU_SPH) || \
defined(HOPKINS_PU_SPH_MONAGHAN) || defined(ANARCHY_PU_SPH) || \
defined(
ANARCHY_DU
_SPH) || defined(DEFAULT_SPH)
defined(
SPHENIX
_SPH) || defined(DEFAULT_SPH)
part
->
u
=
1
.
f
;
#elif defined(HOPKINS_PE_SPH)
part
->
entropy
=
1
.
f
;
...
...
@@ -197,7 +197,7 @@ void zero_particle_fields_force(struct cell *c, const struct cosmology *cosmo,
p
->
density
.
rot_v
[
2
]
=
0
.
f
;
p
->
density
.
div_v
=
0
.
f
;
#endif
/* GADGET-2 */
#if defined(MINIMAL_SPH) || defined(
ANARCHY_DU
_SPH) || defined(DEFAULT_SPH)
#if defined(MINIMAL_SPH) || defined(
SPHENIX
_SPH) || defined(DEFAULT_SPH)
p
->
rho
=
1
.
f
;
p
->
density
.
rho_dh
=
0
.
f
;
p
->
density
.
wcount
=
48
.
f
/
(
kernel_norm
*
pow_dimension
(
p
->
h
));
...
...
@@ -220,7 +220,7 @@ void zero_particle_fields_force(struct cell *c, const struct cosmology *cosmo,
p
->
density
.
wcount
=
48
.
f
/
(
kernel_norm
*
pow_dimension
(
p
->
h
));
p
->
density
.
wcount_dh
=
0
.
f
;
#endif
/* PRESSURE-ENERGY */
#if defined(ANARCHY_PU_SPH) || defined(
ANARCHY_DU
_SPH)
#if defined(ANARCHY_PU_SPH) || defined(
SPHENIX
_SPH)
/* Initialise viscosity variables */
p
->
force
.
pressure
=
hydro_get_comoving_pressure
(
p
);
p
->
viscosity
.
alpha
=
0
.
8
;
...
...
tests/testInteractions.c
View file @
b61090f9
...
...
@@ -114,8 +114,7 @@ void prepare_force(struct part *parts, size_t count) {
#if !defined(GIZMO_MFV_SPH) && !defined(SHADOWFAX_SPH) && \
!defined(MINIMAL_SPH) && !defined(PLANETARY_SPH) && \
!defined(HOPKINS_PU_SPH) && !defined(HOPKINS_PU_SPH_MONAGHAN) && \
!defined(ANARCHY_PU_SPH) && !defined(ANARCHY_DU_SPH) && \
!defined(DEFAULT_SPH)
!defined(ANARCHY_PU_SPH) && !defined(SPHENIX_SPH) && !defined(DEFAULT_SPH)
struct
part
*
p
;
for
(
size_t
i
=
0
;
i
<
count
;
++
i
)
{
p
=
&
parts
[
i
];
...
...
@@ -158,7 +157,7 @@ void dump_indv_particle_fields(char *fileName, struct part *p) {
p
->
force
.
v_sig
,
0
.
f
,
p
->
force
.
u_dt
#elif defined(MINIMAL_SPH) || defined(HOPKINS_PU_SPH) || \
defined(HOPKINS_PU_SPH_MONAGHAN) || defined(ANARCHY_PU_SPH) || \
defined(
ANARCHY_DU
_SPH) || defined(DEFAULT_SPH)
defined(
SPHENIX
_SPH) || defined(DEFAULT_SPH)
p
->
force
.
v_sig
,
0
.
f
,
p
->
u_dt
#else
0
.
f
,
0
.
f
,
0
.
f
...
...
@@ -563,7 +562,7 @@ void test_force_interactions(struct part test_part, struct part *parts,
rhoiq
[
i
]
=
pi_vec
.
rho
;
grad_hiq
[
i
]
=
pi_vec
.
force
.
f
;
#if !defined(HOPKINS_PU_SPH) && !defined(HOPKINS_PU_SPH_MONAGHAN) && \
!defined(ANARCHY_PU_SPH) && !defined(
ANARCHY_DU
_SPH)
!defined(ANARCHY_PU_SPH) && !defined(
SPHENIX
_SPH)
pOrhoi2q
[
i
]
=
pi_vec
.
force
.
P_over_rho2
;
#endif
balsaraiq
[
i
]
=
pi_vec
.
force
.
balsara
;
...
...
@@ -577,7 +576,7 @@ void test_force_interactions(struct part test_part, struct part *parts,
rhojq
[
i
]
=
pj_vec
[
i
].
rho
;
grad_hjq
[
i
]
=
pj_vec
[
i
].
force
.
f
;
#if !defined(HOPKINS_PU_SPH) && !defined(HOPKINS_PU_SPH_MONAGHAN) && \
!defined(ANARCHY_PU_SPH) && !defined(
ANARCHY_DU
_SPH)
!defined(ANARCHY_PU_SPH) && !defined(
SPHENIX
_SPH)
pOrhoj2q
[
i
]
=
pj_vec
[
i
].
force
.
P_over_rho2
;
#endif
balsarajq
[
i
]
=
pj_vec
[
i
].
force
.
balsara
;
...
...
@@ -660,7 +659,7 @@ void test_force_interactions(struct part test_part, struct part *parts,
VEC_HADD
(
h_dtSum
,
piq
[
0
]
->
force
.
h_dt
);
VEC_HMAX
(
v_sigSum
,
piq
[
0
]
->
force
.
v_sig
);
#if !defined(HOPKINS_PU_SPH) && !defined(HOPKINS_PU_SPH_MONAGHAN) && \
!defined(ANARCHY_PU_SPH) && !defined(
ANARCHY_DU
_SPH)
!defined(ANARCHY_PU_SPH) && !defined(
SPHENIX
_SPH)
VEC_HADD
(
entropy_dtSum
,
piq
[
0
]
->
entropy_dt
);
#endif
...
...
Prev
1
2
Next
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