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
903f845a
Commit
903f845a
authored
Jan 03, 2019
by
Matthieu Schaller
Browse files
Naming convention improvements in the EAGLE cooling section of the YAML file. Code formatting.
parent
8266849a
Changes
12
Hide whitespace changes
Inline
Side-by-side
doc/RTD/source/SubgridModels/EAGLE/index.rst
View file @
903f845a
...
...
@@ -98,32 +98,30 @@ In the snapshots, we output for each gas and star particle:
| | | smoothed over SPH neighbours | | |
+----------------------------------+-------------------------------------+-----------+-----------------------------+
The stars will lose mass over their lifetime (up to ~45%). The
fractions will remain unchanged but if one is interested in computing
an absolute metal mass (say) for a star, the ``InitialMass`` (see
below) of the star must be used.
The chemistry model only requires a small number of parameters to be
specified in the `EAGLEChemistry` section of the YAML file. These are
the initial values of the metallicity and element mass
fractions. These are then applied at the start of a simulation to
*all* the *gas* particles. All 9 elements have to be specified An
example section, for primordial abundances (typical for a cosmological
run), is:
The stars will lose mass over their lifetime (up to ~45%). The fractions will
remain unchanged but if one is interested in computing an absolute metal mass
(say) for a star, the ``InitialMass`` (see below) of the star must be used.
The chemistry model only requires a small number of parameters to be specified
in the `EAGLEChemistry` section of the YAML file. These are the initial values
of the metallicity and element mass fractions. These are then applied at the
start of a simulation to *all* the *gas* particles. All 9 traced elements have
to be specified An example section, for primordial abundances (typical for a
cosmological run), is:
.. code:: YAML
EAGLEChemistry:
Metallicity:
0. # Mass fraction in all metals
I
nit
A
bundance_Hydrogen: 0.755 # Mass fraction in Hydrogen
I
nit
A
bundance_Helium: 0.245 # Mass fraction in Helium
I
nit
A
bundance_Carbon: 0. # Mass fraction in Carbon
I
nit
A
bundance_Nitrogen: 0. # Mass fraction in Nitrogen
I
nit
A
bundance_Oxygen: 0. # Mass fraction in Oxygen
I
nit
A
bundance_Neon: 0. # Mass fraction in Neon
I
nit
A
bundance_Magnesium: 0. # Mass fraction in Magnesium
I
nit
A
bundance_Silicon: 0. # Mass fraction in Silicon
I
nit
A
bundance_Iron: 0. # Mass fraction in Iron
init_abundance_metal:
0. # Mass fraction in
*
all
*
metals
i
nit
_a
bundance_Hydrogen: 0.755 # Mass fraction in Hydrogen
i
nit
_a
bundance_Helium: 0.245 # Mass fraction in Helium
i
nit
_a
bundance_Carbon: 0. # Mass fraction in Carbon
i
nit
_a
bundance_Nitrogen: 0. # Mass fraction in Nitrogen
i
nit
_a
bundance_Oxygen: 0. # Mass fraction in Oxygen
i
nit
_a
bundance_Neon: 0. # Mass fraction in Neon
i
nit
_a
bundance_Magnesium: 0. # Mass fraction in Magnesium
i
nit
_a
bundance_Silicon: 0. # Mass fraction in Silicon
i
nit
_a
bundance_Iron: 0. # Mass fraction in Iron
Whilst one would use the following values for solar abundances
(typical for an idealised low-redshift run):
...
...
@@ -131,16 +129,16 @@ Whilst one would use the following values for solar abundances
.. code:: YAML
EAGLEChemistry:
Metallicity:
0.014 # Mass fraction in all metals
I
nit
A
bundance_Hydrogen: 0.70649785 # Mass fraction in Hydrogen
I
nit
A
bundance_Helium: 0.28055534 # Mass fraction in Helium
I
nit
A
bundance_Carbon: 2.0665436e-3 # Mass fraction in Carbon
I
nit
A
bundance_Nitrogen: 8.3562563e-4 # Mass fraction in Nitrogen
I
nit
A
bundance_Oxygen: 5.4926244e-3 # Mass fraction in Oxygen
I
nit
A
bundance_Neon: 1.4144605e-3 # Mass fraction in Neon
I
nit
A
bundance_Magnesium: 5.907064e-4 # Mass fraction in Magnesium
I
nit
A
bundance_Silicon: 6.825874e-4 # Mass fraction in Silicon
I
nit
A
bundance_Iron: 1.1032152e-3 # Mass fraction in Iron
init_abundance_metal:
0.014 # Mass fraction in
*
all
*
metals
i
nit
_a
bundance_Hydrogen: 0.70649785 # Mass fraction in Hydrogen
i
nit
_a
bundance_Helium: 0.28055534 # Mass fraction in Helium
i
nit
_a
bundance_Carbon: 2.0665436e-3 # Mass fraction in Carbon
i
nit
_a
bundance_Nitrogen: 8.3562563e-4 # Mass fraction in Nitrogen
i
nit
_a
bundance_Oxygen: 5.4926244e-3 # Mass fraction in Oxygen
i
nit
_a
bundance_Neon: 1.4144605e-3 # Mass fraction in Neon
i
nit
_a
bundance_Magnesium: 5.907064e-4 # Mass fraction in Magnesium
i
nit
_a
bundance_Silicon: 6.825874e-4 # Mass fraction in Silicon
i
nit
_a
bundance_Iron: 1.1032152e-3 # Mass fraction in Iron
...
...
examples/CoolingBox/coolingBox.yml
View file @
903f845a
...
...
@@ -59,17 +59,17 @@ EAGLECooling:
He_reion_z_sigma
:
0.5
He_reion_eV_p_H
:
2.0
EAGLEChemistry
:
I
nit
Metallicity
:
0.014
I
nit
A
bundance_Hydrogen
:
0.70649785
I
nit
A
bundance_Helium
:
0.28055534
I
nit
A
bundance_Carbon
:
2.0665436e-3
I
nit
A
bundance_Nitrogen
:
8.3562563e-4
I
nit
A
bundance_Oxygen
:
5.4926244e-3
I
nit
A
bundance_Neon
:
1.4144605e-3
I
nit
A
bundance_Magnesium
:
5.907064e-4
I
nit
A
bundance_Silicon
:
6.825874e-4
I
nit
A
bundance_Iron
:
1.1032152e-3
EAGLEChemistry
:
# Solar abundances
i
nit
_abundance_metal
:
0.014
i
nit
_a
bundance_Hydrogen
:
0.70649785
i
nit
_a
bundance_Helium
:
0.28055534
i
nit
_a
bundance_Carbon
:
2.0665436e-3
i
nit
_a
bundance_Nitrogen
:
8.3562563e-4
i
nit
_a
bundance_Oxygen
:
5.4926244e-3
i
nit
_a
bundance_Neon
:
1.4144605e-3
i
nit
_a
bundance_Magnesium
:
5.907064e-4
i
nit
_a
bundance_Silicon
:
6.825874e-4
i
nit
_a
bundance_Iron
:
1.1032152e-3
GearChemistry
:
InitialMetallicity
:
0.01295
examples/CoolingRates/cooling_rates.yml
View file @
903f845a
...
...
@@ -16,16 +16,16 @@ Cosmology:
Omega_b
:
0.0455
# Baryon density parameter
EAGLEChemistry
:
I
nit
Metallicity
:
0.014
I
nit
A
bundance_Hydrogen
:
0.70649785
I
nit
A
bundance_Helium
:
0.28055534
I
nit
A
bundance_Carbon
:
2.0665436e-3
I
nit
A
bundance_Nitrogen
:
8.3562563e-4
I
nit
A
bundance_Oxygen
:
5.4926244e-3
I
nit
A
bundance_Neon
:
1.4144605e-3
I
nit
A
bundance_Magnesium
:
5.907064e-4
I
nit
A
bundance_Silicon
:
6.825874e-4
I
nit
A
bundance_Iron
:
1.1032152e-3
i
nit
_abundance_metal
:
0.014
i
nit
_a
bundance_Hydrogen
:
0.70649785
i
nit
_a
bundance_Helium
:
0.28055534
i
nit
_a
bundance_Carbon
:
2.0665436e-3
i
nit
_a
bundance_Nitrogen
:
8.3562563e-4
i
nit
_a
bundance_Oxygen
:
5.4926244e-3
i
nit
_a
bundance_Neon
:
1.4144605e-3
i
nit
_a
bundance_Magnesium
:
5.907064e-4
i
nit
_a
bundance_Silicon
:
6.825874e-4
i
nit
_a
bundance_Iron
:
1.1032152e-3
EAGLECooling
:
dir_name
:
./coolingtables/
...
...
examples/EAGLE_12/eagle_12.yml
View file @
903f845a
...
...
@@ -57,17 +57,17 @@ InitialConditions:
cleanup_h_factors
:
1
# Remove the h-factors inherited from Gadget
cleanup_velocity_factors
:
1
# Remove the sqrt(a) factor in the velocities inherited from Gadget
EAGLEChemistry
:
# Solar abundances
I
nit
Metallicity
:
0.014
I
nit
A
bundance_Hydrogen
:
0.70649785
I
nit
A
bundance_Helium
:
0.28055534
I
nit
A
bundance_Carbon
:
2.0665436e-3
I
nit
A
bundance_Nitrogen
:
8.3562563e-4
I
nit
A
bundance_Oxygen
:
5.4926244e-3
I
nit
A
bundance_Neon
:
1.4144605e-3
I
nit
A
bundance_Magnesium
:
5.907064e-4
I
nit
A
bundance_Silicon
:
6.825874e-4
I
nit
A
bundance_Iron
:
1.1032152e-3
EAGLEChemistry
:
# Solar abundances
i
nit
_abundance_metal
:
0.014
i
nit
_a
bundance_Hydrogen
:
0.70649785
i
nit
_a
bundance_Helium
:
0.28055534
i
nit
_a
bundance_Carbon
:
2.0665436e-3
i
nit
_a
bundance_Nitrogen
:
8.3562563e-4
i
nit
_a
bundance_Oxygen
:
5.4926244e-3
i
nit
_a
bundance_Neon
:
1.4144605e-3
i
nit
_a
bundance_Magnesium
:
5.907064e-4
i
nit
_a
bundance_Silicon
:
6.825874e-4
i
nit
_a
bundance_Iron
:
1.1032152e-3
EAGLECooling
:
dir_name
:
./coolingtables/
...
...
examples/EAGLE_25/eagle_25.yml
View file @
903f845a
...
...
@@ -66,18 +66,18 @@ InitialConditions:
cleanup_h_factors
:
1
# Remove the h-factors inherited from Gadget
cleanup_velocity_factors
:
1
# Remove the sqrt(a) factor in the velocities inherited from Gadget
EAGLEChemistry
:
# Solar abundances
I
nit
Metallicity
:
0.014
I
nit
A
bundance_Hydrogen
:
0.70649785
I
nit
A
bundance_Helium
:
0.28055534
I
nit
A
bundance_Carbon
:
2.0665436e-3
I
nit
A
bundance_Nitrogen
:
8.3562563e-4
I
nit
A
bundance_Oxygen
:
5.4926244e-3
I
nit
A
bundance_Neon
:
1.4144605e-3
I
nit
A
bundance_Magnesium
:
5.907064e-4
I
nit
A
bundance_Silicon
:
6.825874e-4
I
nit
A
bundance_Iron
:
1.1032152e-3
EAGLEChemistry
:
# Solar abundances
i
nit
_abundance_metal
:
0.014
i
nit
_a
bundance_Hydrogen
:
0.70649785
i
nit
_a
bundance_Helium
:
0.28055534
i
nit
_a
bundance_Carbon
:
2.0665436e-3
i
nit
_a
bundance_Nitrogen
:
8.3562563e-4
i
nit
_a
bundance_Oxygen
:
5.4926244e-3
i
nit
_a
bundance_Neon
:
1.4144605e-3
i
nit
_a
bundance_Magnesium
:
5.907064e-4
i
nit
_a
bundance_Silicon
:
6.825874e-4
i
nit
_a
bundance_Iron
:
1.1032152e-3
EAGLECooling
:
dir_name
:
./coolingtables/
H_reion_z
:
11.5
...
...
examples/EAGLE_50/eagle_50.yml
View file @
903f845a
...
...
@@ -59,18 +59,18 @@ InitialConditions:
cleanup_h_factors
:
1
# Remove the h-factors inherited from Gadget
cleanup_velocity_factors
:
1
# Remove the sqrt(a) factor in the velocities inherited from Gadget
EAGLEChemistry
:
# Solar abundances
I
nit
Metallicity
:
0.014
I
nit
A
bundance_Hydrogen
:
0.70649785
I
nit
A
bundance_Helium
:
0.28055534
I
nit
A
bundance_Carbon
:
2.0665436e-3
I
nit
A
bundance_Nitrogen
:
8.3562563e-4
I
nit
A
bundance_Oxygen
:
5.4926244e-3
I
nit
A
bundance_Neon
:
1.4144605e-3
I
nit
A
bundance_Magnesium
:
5.907064e-4
I
nit
A
bundance_Silicon
:
6.825874e-4
I
nit
A
bundance_Iron
:
1.1032152e-3
EAGLEChemistry
:
# Solar abundances
i
nit
_abundance_metal
:
0.014
i
nit
_a
bundance_Hydrogen
:
0.70649785
i
nit
_a
bundance_Helium
:
0.28055534
i
nit
_a
bundance_Carbon
:
2.0665436e-3
i
nit
_a
bundance_Nitrogen
:
8.3562563e-4
i
nit
_a
bundance_Oxygen
:
5.4926244e-3
i
nit
_a
bundance_Neon
:
1.4144605e-3
i
nit
_a
bundance_Magnesium
:
5.907064e-4
i
nit
_a
bundance_Silicon
:
6.825874e-4
i
nit
_a
bundance_Iron
:
1.1032152e-3
EAGLECooling
:
dir_name
:
./coolingtables/
H_reion_z
:
11.5
...
...
examples/EAGLE_6/eagle_6.yml
View file @
903f845a
...
...
@@ -70,17 +70,17 @@ InitialConditions:
cleanup_h_factors
:
1
# Remove the h-factors inherited from Gadget
cleanup_velocity_factors
:
1
# Remove the sqrt(a) factor in the velocities inherited from Gadget
EAGLEChemistry
:
# Solar abundances
I
nit
Metallicity
:
0.014
I
nit
A
bundance_Hydrogen
:
0.70649785
I
nit
A
bundance_Helium
:
0.28055534
I
nit
A
bundance_Carbon
:
2.0665436e-3
I
nit
A
bundance_Nitrogen
:
8.3562563e-4
I
nit
A
bundance_Oxygen
:
5.4926244e-3
I
nit
A
bundance_Neon
:
1.4144605e-3
I
nit
A
bundance_Magnesium
:
5.907064e-4
I
nit
A
bundance_Silicon
:
6.825874e-4
I
nit
A
bundance_Iron
:
1.1032152e-3
EAGLEChemistry
:
# Solar abundances
i
nit
_abundance_metal
:
0.014
i
nit
_a
bundance_Hydrogen
:
0.70649785
i
nit
_a
bundance_Helium
:
0.28055534
i
nit
_a
bundance_Carbon
:
2.0665436e-3
i
nit
_a
bundance_Nitrogen
:
8.3562563e-4
i
nit
_a
bundance_Oxygen
:
5.4926244e-3
i
nit
_a
bundance_Neon
:
1.4144605e-3
i
nit
_a
bundance_Magnesium
:
5.907064e-4
i
nit
_a
bundance_Silicon
:
6.825874e-4
i
nit
_a
bundance_Iron
:
1.1032152e-3
EAGLECooling
:
dir_name
:
./coolingtables/
...
...
examples/SantaBarbara/santa_barbara.yml
View file @
903f845a
...
...
@@ -59,17 +59,18 @@ InitialConditions:
generate_gas_in_ics
:
1
# Generate gas particles from the DM-only ICs
cleanup_smoothing_lengths
:
1
# Since we generate gas, make use of the (expensive) cleaning-up procedure.
# Impose primoridal metallicity
EAGLEChemistry
:
I
nit
Metallicity
:
0.0
I
nit
A
bundance_Hydrogen
:
0.752
I
nit
A
bundance_Helium
:
0.248
I
nit
A
bundance_Carbon
:
0.0
I
nit
A
bundance_Nitrogen
:
0.0
I
nit
A
bundance_Oxygen
:
0.0
I
nit
A
bundance_Neon
:
0.0
I
nit
A
bundance_Magnesium
:
0.0
I
nit
A
bundance_Silicon
:
0.0
I
nit
A
bundance_Iron
:
0.0
i
nit
_abundance_metal
:
0.0
i
nit
_a
bundance_Hydrogen
:
0.752
i
nit
_a
bundance_Helium
:
0.248
i
nit
_a
bundance_Carbon
:
0.0
i
nit
_a
bundance_Nitrogen
:
0.0
i
nit
_a
bundance_Oxygen
:
0.0
i
nit
_a
bundance_Neon
:
0.0
i
nit
_a
bundance_Magnesium
:
0.0
i
nit
_a
bundance_Silicon
:
0.0
i
nit
_a
bundance_Iron
:
0.0
EAGLECooling
:
dir_name
:
./coolingtables/
...
...
examples/SmallCosmoVolume_cooling/small_cosmo_volume.yml
View file @
903f845a
...
...
@@ -72,13 +72,13 @@ EAGLECooling:
# Impose primoridal metallicity
EAGLEChemistry
:
I
nit
Metallicity
:
0.0
I
nit
A
bundance_Hydrogen
:
0.75
5
I
nit
A
bundance_Helium
:
0.24
5
I
nit
A
bundance_Carbon
:
0.
I
nit
A
bundance_Nitrogen
:
0.
I
nit
A
bundance_Oxygen
:
0.
I
nit
A
bundance_Neon
:
0.
I
nit
A
bundance_Magnesium
:
0.
I
nit
A
bundance_Silicon
:
0.
I
nit
A
bundance_Iron
:
0.
i
nit
_abundance_metal
:
0.0
i
nit
_a
bundance_Hydrogen
:
0.75
2
i
nit
_a
bundance_Helium
:
0.24
8
i
nit
_a
bundance_Carbon
:
0.
0
i
nit
_a
bundance_Nitrogen
:
0.
0
i
nit
_a
bundance_Oxygen
:
0.
0
i
nit
_a
bundance_Neon
:
0.
0
i
nit
_a
bundance_Magnesium
:
0.
0
i
nit
_a
bundance_Silicon
:
0.
0
i
nit
_a
bundance_Iron
:
0.
0
examples/parameter_example.yml
View file @
903f845a
...
...
@@ -276,16 +276,16 @@ GrackleCooling:
# EAGLE model
EAGLEChemistry
:
I
nit
Metallicity
:
0.
# Inital fraction of particle mass in *all* metals
I
nit
A
bundance_Hydrogen
:
0.752
# Inital fraction of particle mass in Hydrogen
I
nit
A
bundance_Helium
:
0.248
# Inital fraction of particle mass in Helium
I
nit
A
bundance_Carbon
:
0.000
# Inital fraction of particle mass in Carbon
I
nit
A
bundance_Nitrogen
:
0.000
# Inital fraction of particle mass in Nitrogen
I
nit
A
bundance_Oxygen
:
0.000
# Inital fraction of particle mass in Oxygen
I
nit
A
bundance_Neon
:
0.000
# Inital fraction of particle mass in Neon
I
nit
A
bundance_Magnesium
:
0.000
# Inital fraction of particle mass in Magnesium
I
nit
A
bundance_Silicon
:
0.000
# Inital fraction of particle mass in Silicon
I
nit
A
bundance_Iron
:
0.000
# Inital fraction of particle mass in Iron
i
nit
_abundance_metal
:
0.
# Inital fraction of particle mass in *all* metals
i
nit
_a
bundance_Hydrogen
:
0.752
# Inital fraction of particle mass in Hydrogen
i
nit
_a
bundance_Helium
:
0.248
# Inital fraction of particle mass in Helium
i
nit
_a
bundance_Carbon
:
0.000
# Inital fraction of particle mass in Carbon
i
nit
_a
bundance_Nitrogen
:
0.000
# Inital fraction of particle mass in Nitrogen
i
nit
_a
bundance_Oxygen
:
0.000
# Inital fraction of particle mass in Oxygen
i
nit
_a
bundance_Neon
:
0.000
# Inital fraction of particle mass in Neon
i
nit
_a
bundance_Magnesium
:
0.000
# Inital fraction of particle mass in Magnesium
i
nit
_a
bundance_Silicon
:
0.000
# Inital fraction of particle mass in Silicon
i
nit
_a
bundance_Iron
:
0.000
# Inital fraction of particle mass in Iron
# Structure finding options (requires velociraptor)
StructureFinding
:
...
...
src/chemistry/EAGLE/chemistry.h
View file @
903f845a
...
...
@@ -154,6 +154,7 @@ __attribute__((always_inline)) INLINE static void chemistry_first_init_part(
if
(
data
->
initial_metal_mass_fraction_total
!=
-
1
)
{
p
->
chemistry_data
.
metal_mass_fraction_total
=
data
->
initial_metal_mass_fraction_total
;
for
(
int
elem
=
0
;
elem
<
chemistry_element_count
;
++
elem
)
p
->
chemistry_data
.
metal_mass_fraction
[
elem
]
=
data
->
initial_metal_mass_fraction
[
elem
];
...
...
@@ -176,13 +177,13 @@ static INLINE void chemistry_init_backend(struct swift_params* parameter_file,
/* Read the total metallicity */
data
->
initial_metal_mass_fraction_total
=
parser_get_opt_param_float
(
parameter_file
,
"EAGLEChemistry:
I
nit
Metallicity
"
,
-
1
);
parameter_file
,
"EAGLEChemistry:
i
nit
_abundance_metal
"
,
-
1
);
if
(
data
->
initial_metal_mass_fraction_total
!=
-
1
)
{
/* Read the individual mass fractions */
for
(
int
elem
=
0
;
elem
<
chemistry_element_count
;
++
elem
)
{
char
buffer
[
50
];
sprintf
(
buffer
,
"EAGLEChemistry:
I
nit
A
bundance_%s"
,
sprintf
(
buffer
,
"EAGLEChemistry:
i
nit
_a
bundance_%s"
,
chemistry_get_element_name
((
enum
chemistry_element
)
elem
));
data
->
initial_metal_mass_fraction
[
elem
]
=
...
...
src/cooling/EAGLE/cooling.c
View file @
903f845a
...
...
@@ -740,8 +740,8 @@ void cooling_init_backend(struct swift_params *parameter_file,
/* read some parameters */
parser_get_param_string
(
parameter_file
,
"EAGLECooling:dir_name"
,
cooling
->
cooling_table_path
);
cooling
->
H_reion_z
=
parser_get_param_float
(
parameter_file
,
"EAGLECooling:H_reion_z"
);
cooling
->
H_reion_z
=
parser_get_param_float
(
parameter_file
,
"EAGLECooling:H_reion_z"
);
cooling
->
He_reion_z_centre
=
parser_get_param_float
(
parameter_file
,
"EAGLECooling:He_reion_z_centre"
);
cooling
->
He_reion_z_sigma
=
...
...
@@ -754,7 +754,7 @@ void cooling_init_backend(struct swift_params *parameter_file,
parameter_file
,
"EAGLECooling:Ca_over_Si_in_solar"
,
1
.
f
);
cooling
->
S_over_Si_ratio_in_solar
=
parser_get_opt_param_float
(
parameter_file
,
"EAGLECooling:S_over_Si_in_solar"
,
1
.
f
);
/* convert to cgs */
cooling
->
He_reion_heat_cgs
*=
phys_const
->
const_electron_volt
*
...
...
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