Skip to content

Commit 46cf7dd

Browse files
darwin-roduitMatthieuSchaller
authored andcommitted
GEAR tracers
1 parent 827912a commit 46cf7dd

26 files changed

Lines changed: 650 additions & 31 deletions

File tree

configure.ac

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2024,6 +2024,7 @@ case "$with_subgrid" in
20242024
GEAR)
20252025
with_subgrid_cooling=grackle_0
20262026
with_subgrid_chemistry=GEAR_10
2027+
with_subgrid_tracers=GEAR
20272028
with_subgrid_pressure_floor=GEAR
20282029
with_subgrid_stars=GEAR
20292030
with_subgrid_star_formation=GEAR
@@ -2036,6 +2037,7 @@ case "$with_subgrid" in
20362037
GEAR-G3)
20372038
with_subgrid_cooling=grackle_3
20382039
with_subgrid_chemistry=GEAR_10
2040+
with_subgrid_tracers=GEAR
20392041
with_subgrid_pressure_floor=none
20402042
with_subgrid_stars=GEAR
20412043
with_subgrid_star_formation=GEAR
@@ -2689,7 +2691,7 @@ fi
26892691
# Particle tracers
26902692
AC_ARG_WITH([tracers],
26912693
[AS_HELP_STRING([--with-tracers=<function>],
2692-
[chemistry function @<:@none, EAGLE default: none@:>@]
2694+
[chemistry function @<:@none, EAGLE, GEAR default: none@:>@]
26932695
)],
26942696
[with_tracers="$withval"],
26952697
[with_tracers="none"]
@@ -2710,6 +2712,9 @@ case "$with_tracers" in
27102712
EAGLE)
27112713
AC_DEFINE([TRACERS_EAGLE], [1], [Tracers taken from the EAGLE model])
27122714
;;
2715+
GEAR)
2716+
AC_DEFINE([TRACERS_GEAR], [1], [Tracers taken from the GEAR model])
2717+
;;
27132718
*)
27142719
AC_MSG_ERROR([Unknown tracers choice: $with_tracers])
27152720
;;

doc/RTD/source/SubgridModels/GEAR/dev_notes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.. GEAR sub-grid model
2-
Darwin Roduit, 5h January 2025
2+
Darwin Roduit, 5th January 2026
33
44
.. _gear_dev_notes:
55

doc/RTD/source/SubgridModels/GEAR/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ This model can be selected with the configuration option ``--with-subgrid=GEAR``
1818
supernova_feedback
1919
sinks/index
2020
output
21+
tracers
2122
dev_notes
2223

doc/RTD/source/SubgridModels/GEAR/output.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Snapshots ouputs
88

99
Here, we provide a summary of the quantities written in the snapshots, in addition to positions, velocities, masses, smoothing lengths and particle IDs.
1010

11+
The tracer outputs are summarised on the :ref:`gear_tracers` page.
1112

1213
Sink particles
1314
~~~~~~~~~~~~~~
@@ -38,8 +39,15 @@ Sink particles
3839
+---------------------------------------+---------------------------------------------+------------------------+---------------------------------------------------+
3940
| ``BirthTimes`` | | Time when the sink was created | [U_T] | | Only used in *non-cosmological* runs. |
4041
+---------------------------------------+---------------------------------------------+------------------------+---------------------------------------------------+
41-
42-
42+
| ``BirthDensities`` | | Physical densities at the time of birth | [U_M U_L^{-3}] | | Stored at birth time/redshift. |
43+
+---------------------------------------+---------------------------------------------+------------------------+---------------------------------------------------+
44+
| ``BirthTemperatures`` | | Temperatures at the time of birth | [U_K] | | Stored at birth time/redshift. |
45+
+---------------------------------------+---------------------------------------------+------------------------+---------------------------------------------------+
46+
| ``AccretionRates`` | | Physical instantaneous accretion rates | [U_M U_T^{-1}] | | At the current step |
47+
+---------------------------------------+---------------------------------------------+------------------------+---------------------------------------------------+
48+
| ``StarFormationRates`` | | Star formation rates of the particles | [U_M U_T^{-1}] | | If negative, stores last time/scale-factor |
49+
| | | | | at which gas was star-forming. |
50+
+---------------------------------------+---------------------------------------------+------------------------+---------------------------------------------------+
4351

4452
Stars
4553
~~~~~
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.. GEAR sub-grid model
2+
Darwin Roduit, 10th April 2026
3+
4+
.. _gear_tracers:
5+
6+
Particle tracers
7+
~~~~~~~~~~~~~~~~
8+
9+
Over the course of the simulation, the gas, sink and star particles record some information about their evolution. These are updated for a given particle every time it is active. The GEAR tracers module is located in the directory ``src/tracers/GEAR/``. To enable GEAR tracers, add ``--with-tracers=GEAR`` to your configuration options.
10+
11+
Currently, GEAR tracers are only implemented for sink particles.
12+
13+
Sink tracers
14+
------------
15+
16+
The tracers track the long-term evolution of the sinks' accretion rates and SFR between different time slices. These tracers are used to capture the high-frequency variability of the the accretion rate and SFR that might be lost between snapshots.
17+
18+
The time slices are specified by ``Snapshots:recording_triggers_sink``. By default, the number of recording time slices is 3. You can change this value in ``src/tracers_triggers.h`` and then recompile the code. These outputs are arrays of length ``num_snapshot_triggers_sink``.
19+
20+
+---------------------------------------+---------------------------------------------+-----------------------------+---------------------------------------------------+
21+
| Name | Description | Units | Comments |
22+
+=======================================+=============================================+=============================+===================================================+
23+
| ``AveragedAccretionRates`` | | Accretion rates averaged over the | [U_M U_T^{-1}] | | Averaged over the period set by the |
24+
| | | snapshot trigger intervals | | | first N snapshot triggers. |
25+
+---------------------------------------+---------------------------------------------+-----------------------------+---------------------------------------------------+
26+
| ``AveragedStarFormationRates`` | | Star formation rates averaged over the | [U_M U_T^{-1}] | | Averaged over the period set by the |
27+
| | | snapshot trigger intervals | | | first N snapshot triggers. |
28+
+---------------------------------------+---------------------------------------------+-----------------------------+---------------------------------------------------+

examples/IsolatedGalaxy/IsolatedGalaxy_multi_component/GEAR/params.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ TimeIntegration:
2626

2727
# Parameters governing the snapshots
2828
Snapshots:
29-
subdir: snap # snapshot directory
30-
basename: snapshot # Common part of the name of output files
31-
time_first: 0. # Time of the first output (in internal units)
32-
delta_time: 1e-2 # Time difference between consecutive outputs (in internal units)
29+
subdir: snap # snapshot directory
30+
basename: snapshot # Common part of the name of output files
31+
time_first: 0. # Time of the first output (in internal units)
32+
delta_time: 1e-2 # Time difference between consecutive outputs (in internal units)
3333
compression: 4
34+
recording_triggers_sink: [1e-2, 1e-3, 1e-4] # Recording starts 10M, 1M and 0.1M years before a snapshot
3435

3536
# Parameters governing the conserved quantities statistics
3637
Statistics:

examples/IsolatedGalaxy/IsolatedGalaxy_sink/isolated_galaxy.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ TimeIntegration:
2525

2626
# Parameters governing the snapshots
2727
Snapshots:
28-
basename: output # Common part of the name of output files
29-
time_first: 0. # (Optional) Time of the first output if non-cosmological time-integration (in internal units)
30-
delta_time: 0.01 # Time difference between consecutive outputs (in internal units)
28+
basename: output # Common part of the name of output files
29+
time_first: 0. # (Optional) Time of the first output if non-cosmological time-integration (in internal units)
30+
delta_time: 0.01 # Time difference between consecutive outputs (in internal units)
31+
recording_triggers_sink: [1e-2, 1e-3, 1e-4] # Recording starts 10M, 1M and 0.1M years before a snapshot
3132

3233
Scheduler:
33-
cell_extra_gparts: 100 # (Optional) Number of spare sparts per top-level allocated at rebuild time for on-the-fly creation.
34-
cell_extra_sinks: 100 # (Optional) Number of spare sparts per top-level allocated at rebuild time for on-the-fly creation.
35-
cell_extra_sparts: 100 # (Optional) Number of spare sparts per top-level allocated at rebuild time for on-the-fly creation.
34+
cell_extra_gparts: 100 # (Optional) Number of spare sparts per top-level allocated at rebuild time for on-the-fly creation.
35+
cell_extra_sinks: 100 # (Optional) Number of spare sparts per top-level allocated at rebuild time for on-the-fly creation.
36+
cell_extra_sparts: 100 # (Optional) Number of spare sparts per top-level allocated at rebuild time for on-the-fly creation.
3637

3738
# Parameters governing the conserved quantities statistics
3839
Statistics:

examples/SinkParticles/HomogeneousBox/params.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ Snapshots:
3232
subdir: snap
3333
basename: snapshot # Common part of the name of output files
3434
time_first: 0. # (Optional) Time of the first output if non-cosmological time-integration (in internal units)
35-
delta_time: 1e-3 # Time difference between consecutive outputs (in internal units)
35+
delta_time: 1e-2 # Time difference between consecutive outputs (in internal units)
36+
recording_triggers_sink: [1e-2, 1e-3, 1e-4] # Recording starts 10M, 1M and 0.1M years before a snapshot
3637

3738
# Parameters governing the scheduler.
3839
Scheduler:

examples/SinkParticles/HomogeneousBox/params_debug.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Snapshots:
2929
basename: snapshot # Common part of the name of output files
3030
time_first: 0. # (Optional) Time of the first output if non-cosmological time-integration (in internal units)
3131
delta_time: 0.01 # Time difference between consecutive outputs (in internal units)
32+
recording_triggers_sink: [1e-2, 1e-3, 1e-4] # Recording starts 10M, 1M and 0.1M years before a snapshot
3233

3334
# Parameters governing the restarts
3435
Restarts:

examples/SinkParticles/HomogeneousBoxSinkParticles/params.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,17 @@ TimeIntegration:
2727
Snapshots:
2828
subdir: snap
2929
basename: snapshot # Common part of the name of output files
30-
time_first: 0. #230 Myr # (Optional) Time of the first output if non-cosmological time-integration (in internal units)
30+
time_first: 0. # (Optional) Time of the first output if non-cosmological time-integration (in internal units)
3131
delta_time: 10e-3 # Time difference between consecutive outputs (in internal units)
32+
recording_triggers_sink: [-1, -1, -1] # No recording needed in this example
3233

3334
Scheduler:
3435
cell_extra_gparts: 100 # (Optional) Number of spare sparts per top-level allocated at rebuild time for on-the-fly creation.
3536
cell_extra_sinks: 100 # (Optional) Number of spare sparts per top-level allocated at rebuild time for on-the-fly creation.
3637
cell_extra_sparts: 100 # (Optional) Number of spare sparts per top-level allocated at rebuild time for on-the-fly creation.
3738
max_top_level_cells: 3 #
3839
dependency_graph_frequency: 1 # (Optional) Dumping frequency of the dependency graph. By default, writes only at the first step.
39-
mpi_message_limit: 4 #Default: 4
40+
mpi_message_limit: 4 # Default: 4
4041
dependency_graph_cell: 0
4142
links_per_tasks: 35
4243

0 commit comments

Comments
 (0)