diff --git a/configure.ac b/configure.ac index cc478943d695126150edf6e5c3842faadb2be757..7ec56702eddbf286613c669cc218e6349f89170a 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/doc/RTD/source/HydroSchemes/anarchy_sph.rst b/doc/RTD/source/HydroSchemes/anarchy_sph.rst index 267842936bddaf70f36c4aa4f53c27eb8c802108..aedd65ca61dc56676b77f48d7cd69d6f32e27878 100644 --- a/doc/RTD/source/HydroSchemes/anarchy_sph.rst +++ b/doc/RTD/source/HydroSchemes/anarchy_sph.rst @@ -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``. diff --git a/doc/RTD/source/HydroSchemes/index.rst b/doc/RTD/source/HydroSchemes/index.rst index 7331331bda7c28fad2f471dedb1335f1201d4a21..807ef42ddca8b4269a1007c4bbcdc2d3e8558971 100644 --- a/doc/RTD/source/HydroSchemes/index.rst +++ b/doc/RTD/source/HydroSchemes/index.rst @@ -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 diff --git a/doc/RTD/source/HydroSchemes/sphenix_sph.rst b/doc/RTD/source/HydroSchemes/sphenix_sph.rst new file mode 100644 index 0000000000000000000000000000000000000000..7e6af5dced10bcb7291bb5962b94f27c82450c08 --- /dev/null +++ b/doc/RTD/source/HydroSchemes/sphenix_sph.rst @@ -0,0 +1,69 @@ +.. 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``. diff --git a/src/Makefile.am b/src/Makefile.am index 04f9e7c58ed10435f7ba3f636ca841fdd81c40ab..54b766c46eebe536179d5c4e1ef60513f34296bc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 \ diff --git a/src/debug.c b/src/debug.c index 1b3e9f834cd06958d4ff024acd1fe0efe2dcf252..fba8db46661e9624f9332c74d0d76c435cb9a6d2 100644 --- a/src/debug.c +++ b/src/debug.c @@ -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 diff --git a/src/hydro.h b/src/hydro.h index 76160b8957f7ac99000363faa1114fe9373556f8..b38276c3d482bcbbbb39595ecf29cbb8dba23459 100644 --- a/src/hydro.h +++ b/src/hydro.h @@ -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" diff --git a/src/hydro/AnarchyDU/hydro.h b/src/hydro/SPHENIX/hydro.h similarity index 99% rename from src/hydro/AnarchyDU/hydro.h rename to src/hydro/SPHENIX/hydro.h index dbeb8d27e4acb5710cbfdcf987f85867b853d854..668ceb4ebe85078df6df188a0b233505abc3a853 100644 --- a/src/hydro/AnarchyDU/hydro.h +++ b/src/hydro/SPHENIX/hydro.h @@ -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 */ diff --git a/src/hydro/AnarchyDU/hydro_debug.h b/src/hydro/SPHENIX/hydro_debug.h similarity index 86% rename from src/hydro/AnarchyDU/hydro_debug.h rename to src/hydro/SPHENIX/hydro_debug.h index bc72bec62f8ddff6086516a32a4b86651e6aa66a..62d134f4e19411be3405bd29453bf2f20592fa8e 100644 --- a/src/hydro/AnarchyDU/hydro_debug.h +++ b/src/hydro/SPHENIX/hydro_debug.h @@ -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 */ diff --git a/src/hydro/AnarchyDU/hydro_iact.h b/src/hydro/SPHENIX/hydro_iact.h similarity index 98% rename from src/hydro/AnarchyDU/hydro_iact.h rename to src/hydro/SPHENIX/hydro_iact.h index 12cb7c84896bded4e43894b0c3dbad2e258928f5..012f70200405b998c12944cbfdb86e27f123c7f0 100644 --- a/src/hydro/AnarchyDU/hydro_iact.h +++ b/src/hydro/SPHENIX/hydro_iact.h @@ -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 */ diff --git a/src/hydro/AnarchyDU/hydro_io.h b/src/hydro/SPHENIX/hydro_io.h similarity index 97% rename from src/hydro/AnarchyDU/hydro_io.h rename to src/hydro/SPHENIX/hydro_io.h index b402ac30279015c16e6ca7b5f1b28e2bfe380850..ca333d4ed68e0a7f4e734b5cb3bead609afc90a5 100644 --- a/src/hydro/AnarchyDU/hydro_io.h +++ b/src/hydro/SPHENIX/hydro_io.h @@ -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 */ diff --git a/src/hydro/AnarchyDU/hydro_parameters.h b/src/hydro/SPHENIX/hydro_parameters.h similarity index 97% rename from src/hydro/AnarchyDU/hydro_parameters.h rename to src/hydro/SPHENIX/hydro_parameters.h index a9226eb0f01351163b560f573a37f181f99490c2..d77693a50e2b33c4e5917badbd937af50da4892e 100644 --- a/src/hydro/AnarchyDU/hydro_parameters.h +++ b/src/hydro/SPHENIX/hydro_parameters.h @@ -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 */ diff --git a/src/hydro/AnarchyDU/hydro_part.h b/src/hydro/SPHENIX/hydro_part.h similarity index 95% rename from src/hydro/AnarchyDU/hydro_part.h rename to src/hydro/SPHENIX/hydro_part.h index 10da77140145db191648237377631edee8807b49..93bf2913bc82894e332afeae0ca9355f6dcf3209 100644 --- a/src/hydro/AnarchyDU/hydro_part.h +++ b/src/hydro/SPHENIX/hydro_part.h @@ -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 */ diff --git a/src/hydro_io.h b/src/hydro_io.h index 95aa8afc7b3d06deb8c67b4fa10a5392b2e69e4e..d3e98771898f6cfdd8b7758932fd65b8534b5f27 100644 --- a/src/hydro_io.h +++ b/src/hydro_io.h @@ -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 diff --git a/src/hydro_parameters.h b/src/hydro_parameters.h index c6edb646e10e52e96e3a0a00aae6bfb3457ff202..852e510c1a46fb72bf1f949dd3dea753aeabe75a 100644 --- a/src/hydro_parameters.h +++ b/src/hydro_parameters.h @@ -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 diff --git a/src/part.h b/src/part.h index e89f6004a31842e7094616809d8cbaab1931a6f7..d0ff99089526c223f148d32058003edaf474126d 100644 --- a/src/part.h +++ b/src/part.h @@ -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) diff --git a/tests/test125cells.c b/tests/test125cells.c index 725018316c8ff5834e94633a76a7a4a912446aab..27ba35a16fca416d7829ffb84d5677170b40fbbb 100644 --- a/tests/test125cells.c +++ b/tests/test125cells.c @@ -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 diff --git a/tests/test27cells.c b/tests/test27cells.c index e403cc1469cb53cdeea5e248bb8b16a301b70e0c..0fc075d11e8144e22712b33ce4fd14ab236ec84c 100644 --- a/tests/test27cells.c +++ b/tests/test27cells.c @@ -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], diff --git a/tests/testActivePair.c b/tests/testActivePair.c index 4cb5e93f39bd0945cc635609d542e61ce0d89445..3cc12ee74af6d26c9284fe1b32a60f5716d94cd9 100644 --- a/tests/testActivePair.c +++ b/tests/testActivePair.c @@ -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; diff --git a/tests/testInteractions.c b/tests/testInteractions.c index ef4f0e4c69e7770b032af7c9fb5dc8335fc48c11..0881d9d27f8990b5eb67ad5b3cbfb7023ebaf5e4 100644 --- a/tests/testInteractions.c +++ b/tests/testInteractions.c @@ -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 diff --git a/tests/testPeriodicBC.c b/tests/testPeriodicBC.c index f19ec46620955d29b73113ddae1ab5680f7e7303..b23effea0c6159f9a70f4983bc0b45fa716152df 100644 --- a/tests/testPeriodicBC.c +++ b/tests/testPeriodicBC.c @@ -249,7 +249,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell, int i, int j, 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(DEFAULT_SPH) || defined(ANARCHY_PU_SPH) || defined(ANARCHY_DU_SPH) +#elif defined(DEFAULT_SPH) || defined(ANARCHY_PU_SPH) || defined(SPHENIX_SPH) main_cell->hydro.parts[pid].viscosity.div_v, main_cell->hydro.parts[pid].density.rot_v[0], main_cell->hydro.parts[pid].density.rot_v[1],