const.h 5.02 KB
Newer Older
1
/*******************************************************************************
2
 * This file is part of SWIFT.
3
 * Copyright (c) 2012 Pedro Gonnet (ptcedro.gonnet@durham.ac.uk)
4
 *                    Matthieu Schaller (matthieu.schaller@durham.ac.uk)
5
 *
6
7
8
9
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
10
 *
11
12
13
14
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
15
 *
16
17
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
 *
19
 ******************************************************************************/
20
21
#ifndef SWIFT_CONST_H
#define SWIFT_CONST_H
22

23
/* SPH Viscosity constants. */
24
25
/* Cosmology defaults: a=0.8, b=3.0. Planetary defaults: a=1.5, b=4.0 
 * Beta is defined as in e.g. Price (2010) Eqn (103) */ 
26
#define const_viscosity_alpha 0.8f
27
#define const_viscosity_beta 3.0f
28

29
30
31
32
33
34
#define const_viscosity_alpha_min \
  0.1f /* Values taken from (Price,2004), not used in legacy gadget mode */
#define const_viscosity_alpha_max \
  2.0f /* Values taken from (Price,2004), not used in legacy gadget mode */
#define const_viscosity_length \
  0.1f /* Values taken from (Price,2004), not used in legacy gadget mode */
35
36

/* SPH Thermal conductivity constants. */
37
38
#define const_conductivity_alpha \
  1.f /* Value taken from (Price,2008), not used in legacy gadget mode */
39
40

/* Time integration constants. */
41
#define const_max_u_change 0.1f
42

Tom Theuns's avatar
Tom Theuns committed
43
44
45
46
47
48
49
50
51
/* Type of gradients to use (GIZMO_SPH only) */
/* If no option is chosen, no gradients are used (first order scheme) */
//#define GRADIENTS_SPH
#define GRADIENTS_GIZMO

/* Types of slope limiter to use (GIZMO_SPH only) */
/* Different slope limiters can be combined */
#define SLOPE_LIMITER_PER_FACE
#define SLOPE_LIMITER_CELL_WIDE
52

53
54
55
/* Types of flux limiter to use (GIZMO_SPH only) */
#define GIZMO_FLUX_LIMITER

56
57
/* Options to control the movement of particles for GIZMO_SPH. */
/* This option disables particle movement */
58
//#define GIZMO_FIX_PARTICLES
59
/* Try to keep cells regular by adding a correction velocity. */
Bert Vandenbroucke's avatar
Bert Vandenbroucke committed
60
61
//#define GIZMO_STEER_MOTION
/* Use the total energy instead of the thermal energy as conserved variable. */
62
//#define GIZMO_TOTAL_ENERGY
63

64
65
66
67
68
69
70
71
72
73
74
75
/* Options to control handling of unphysical values (GIZMO_SPH only). */
/* In GIZMO, mass and energy (and hence density and pressure) can in principle
   become negative, which will cause unwanted behaviour that can make the code
   crash.
   If no options are selected below, we assume (and pray) that this will not
   happen, and add no restrictions to how these variables are treated. */
/* Check for unphysical values and crash if they occur. */
//#define GIZMO_UNPHYSICAL_ERROR
/* Check for unphysical values and reset them to safe values. */
#define GIZMO_UNPHYSICAL_RESCUE
/* Show a warning message if an unphysical value was reset (only works if
   GIZMO_UNPHYSICAL_RESCUE is also selected). */
76
#ifdef SWIFT_DEBUG_CHECKS
77
#define GIZMO_UNPHYSICAL_WARNING
78
#endif
79
80
81
82

/* Parameters that control how GIZMO handles pathological particle
   configurations. */
/* Show a warning message if a pathological configuration has been detected. */
83
//#define GIZMO_PATHOLOGICAL_WARNING
84
/* Crash if a pathological configuration has been detected. */
85
//#define GIZMO_PATHOLOGICAL_ERROR
86
87
88
89
90
91
92
93
94
95
96
97
98
/* Maximum allowed gradient matrix condition number. If the condition number of
   the gradient matrix (defined in equation C1 in Hopkins, 2015) is larger than
   this value, we artificially increase the number of neighbours to get a more
   homogeneous sampling. */
#define const_gizmo_max_condition_number 100.0f
/* Correction factor applied to the particle wcount to force more neighbours if
   the condition number is too large. */
#define const_gizmo_w_correction_factor 0.9f
/* Lower limit on the wcount correction factor. If the condition number is still
   too high after this wcount correction has been applied, we give up on the
   gradient matrix and use SPH gradients instead. */
#define const_gizmo_min_wcorr 0.5f

99
100
101
102
103
104
105
106
/* Types of gradients to use for SHADOWFAX_SPH */
/* If no option is chosen, no gradients are used (first order scheme) */
#define SHADOWFAX_GRADIENTS

/* SHADOWFAX_SPH slope limiters */
#define SHADOWFAX_SLOPE_LIMITER_PER_FACE
#define SHADOWFAX_SLOPE_LIMITER_CELL_WIDE

107
108
/* Options to control SHADOWFAX_SPH */
/* This option disables cell movement */
109
110
111
112
//#define SHADOWFAX_FIX_CELLS
/* This option enables cell steering, i.e. trying to keep the cells regular by
   adding a correction to the cell velocities.*/
#define SHADOWFAX_STEER_CELL_MOTION
113
114
/* This option evolves the total energy instead of the thermal energy */
//#define SHADOWFAX_TOTAL_ENERGY
115

Tom Theuns's avatar
Tom Theuns committed
116
/* Source terms */
Tom Theuns's avatar
Tom Theuns committed
117
118
#define SOURCETERMS_NONE
//#define SOURCETERMS_SN_FEEDBACK
Tom Theuns's avatar
Tom Theuns committed
119

120
#endif /* SWIFT_CONST_H */