# Define the system of units to use internally. 
InternalUnitSystem:
  UnitMass_in_cgs:     1.98841e43    # 10^10 M_sun in grams
  UnitLength_in_cgs:   3.08567758e24 # Mpc in centimeters
  UnitVelocity_in_cgs: 1e5           # km/s in centimeters per second
  UnitCurrent_in_cgs:  1.            # Amperes
  UnitTemp_in_cgs:     1.            # Kelvin

# Cosmological parameters
Cosmology:
  h:              0.6777        # Reduced Hubble constant
  a_begin:        0.090909      # Initial scale-factor of the simulation (z = 10.0)
  a_end:          1.0           # Final scale factor of the simulation
  Omega_cdm:      0.2587481     # Cold Dark Matter density parameter
  Omega_lambda:   0.693         # Dark-energy density parameter
  Omega_b:        0.0482519     # Baryon density parameter

# Parameters governing the time integration
TimeIntegration:
  dt_min:     1e-7  # The minimal time-step size of the simulation (in internal units).
  dt_max:     5e-3  # The maximal time-step size of the simulation (in internal units).

# Parameters governing the snapshots
Snapshots:
  basename:            stellar_evolution # Common part of the name of output files
  delta_time:          1.013
  scale_factor_first:  0.091
  compression:         4

# Parameters governing the conserved quantities statistics
Statistics:
  scale_factor_first:  0.0991
  delta_time:          1.5

# Parameters for the hydrodynamics scheme
SPH:
  resolution_eta:        1.2348   # Target smoothing length in units of the mean inter-particle separation 
  CFL_condition:         0.1      # Courant-Friedrich-Levy condition for time integration.
  minimal_temperature:   100.     # Kelvin

# Properties of the stars
Stars:
  overwrite_birth_time: 1
  birth_time:           0.090908  # Give the star in the ICs a decent birth time
  luminosity_filename:   ./photometry

# Parameters related to the initial conditions
InitialConditions:
  file_name:  ./stellar_evolution.hdf5       # The file to read
  periodic:   1
  
Scheduler:
  max_top_level_cells: 8

# Parameters for the EAGLE "equation of state"
EAGLEEntropyFloor:
  Jeans_density_threshold_H_p_cm3: 0.1       # Physical density above which the EAGLE Jeans limiter entropy floor kicks in expressed in Hydrogen atoms per cm^3.
  Jeans_over_density_threshold:    10.       # Overdensity above which the EAGLE Jeans limiter entropy floor can kick in.
  Jeans_temperature_norm_K:        8000      # Temperature of the EAGLE Jeans limiter entropy floor at the density threshold expressed in Kelvin.
  Jeans_gamma_effective:           1.3333333 # Slope the of the EAGLE Jeans limiter entropy floor
  Cool_density_threshold_H_p_cm3: 1e-5       # Physical density above which the EAGLE Cool limiter entropy floor kicks in expressed in Hydrogen atoms per cm^3.
  Cool_over_density_threshold:    10.        # Overdensity above which the EAGLE Cool limiter entropy floor can kick in.
  Cool_temperature_norm_K:        8000       # Temperature of the EAGLE Cool limiter entropy floor at the density threshold expressed in Kelvin.
  Cool_gamma_effective:           1.         # Slope the of the EAGLE Cool limiter entropy floor

# Metallicites read in for the gas and star
EAGLEChemistry:              
  init_abundance_metal:      0.01
  init_abundance_Hydrogen:   0.752
  init_abundance_Helium:     0.248
  init_abundance_Carbon:     0.0
  init_abundance_Nitrogen:   0.0
  init_abundance_Oxygen:     0.0
  init_abundance_Neon:       0.0
  init_abundance_Magnesium:  0.0
  init_abundance_Silicon:    0.0
  init_abundance_Iron:       0.0

# Standard EAGLE cooling options
EAGLECooling:
  dir_name:                ./coolingtables/  # Location of the Wiersma+08 cooling tables
  H_reion_z:               11.5              # Redshift of Hydrogen re-ionization
  H_reion_eV_p_H:          2.0
  He_reion_z_centre:       3.5               # Redshift of the centre of the Helium re-ionization Gaussian
  He_reion_z_sigma:        0.5               # Spread in redshift of the  Helium re-ionization Gaussian
  He_reion_eV_p_H:         2.0               # Energy inject by Helium re-ionization in electron-volt per Hydrogen atom

# Properties of the EAGLE feedback and enrichment model. This matches the EAGLE-Ref (Schaye+2015) model.
EAGLEFeedback:
  use_SNII_feedback:                    0               # Global switch for SNII thermal (stochastic) feedback.
  use_SNIa_feedback:                    0               # Global switch for SNIa thermal (continuous) feedback.
  use_AGB_enrichment:                   1               # Global switch for enrichement from AGB stars.
  use_SNII_enrichment:                  1               # Global switch for enrichement from SNII stars.
  use_SNIa_enrichment:                  1               # Global switch for enrichement from SNIa stars.
  filename:                             ./yieldtables/  # Path to the directory containing the EAGLE yield tables.
  IMF_min_mass_Msun:                    0.1             # Minimal stellar mass considered for the Chabrier IMF in solar masses.
  IMF_max_mass_Msun:                  100.0             # Maximal stellar mass considered for the Chabrier IMF in solar masses.
  SNII_min_mass_Msun:                   6.0             # Minimal mass considered for SNII stars in solar masses.
  SNII_max_mass_Msun:                 100.0             # Maximal mass considered for SNII stars in solar masses.
  SNII_feedback_model:                  Random          # Feedback modes: Random, Isotropic, MinimumDistance, MinimumDensity
  SNII_sampled_delay:                   0               # Sample the SNII lifetimes to do feedback.
  SNII_wind_delay_Gyr:                  0.03            # Time in Gyr between a star's birth and the SNII thermal feedback event when not sampling.
  SNII_delta_T_K:                       3.16228e7       # Change in temperature to apply to the gas particle in a SNII thermal feedback event in Kelvin.
  SNII_energy_erg:                      1.0e51          # Energy of one SNII explosion in ergs.
  SNII_energy_fraction_min:             0.3             # Minimal fraction of energy applied in a SNII feedback event.
  SNII_energy_fraction_max:             3.0             # Maximal fraction of energy applied in a SNII feedback event.
  SNII_energy_fraction_Z_0:             0.0012663729    # Pivot point for the metallicity dependance of the SNII energy fraction (metal mass fraction).
  SNII_energy_fraction_n_0_H_p_cm3:     0.67            # Pivot point for the birth density dependance of the SNII energy fraction in cm^-3.
  SNII_energy_fraction_n_Z:             0.8686          # Power-law for the metallicity dependance of the SNII energy fraction.
  SNII_energy_fraction_n_n:             0.8686          # Power-law for the birth density dependance of the SNII energy fraction.
  SNII_energy_fraction_use_birth_density: 0             # Are we using the density and metallicity at birth to compute f_E or at feedback time?
  SNII_energy_fraction_use_birth_metallicity: 0         # Are we using the density and metallicity at birth to compute f_E or at feedback time?
  SNIa_DTD:                             Exponential     # Use the EAGLE-Ref SNIa DTD.
  SNIa_DTD_delay_Gyr:                   0.04            # Age of the most massive SNIa in Gyr.
  SNIa_DTD_exp_timescale_Gyr:           2.0             # Time-scale of the exponential decay of the SNIa rates in Gyr.
  SNIa_DTD_exp_norm_p_Msun:             0.002           # Normalisation of the SNIa rates in inverse solar masses.
  SNIa_energy_erg:                     1.0e51           # Energy of one SNIa explosion in ergs.
  AGB_ejecta_velocity_km_p_s:          10.0             # Velocity of the AGB ejectas in km/s.
  stellar_evolution_age_cut_Gyr:        0.1             # Age in Gyr above which the enrichment is downsampled.
  stellar_evolution_sampling_rate:       10             # Number of time-steps in-between two enrichment events for a star above the age threshold.
  SNII_yield_factor_Hydrogen:           1.0             # (Optional) Correction factor to apply to the Hydrogen yield from the SNII channel.
  SNII_yield_factor_Helium:             1.0             # (Optional) Correction factor to apply to the Helium yield from the SNII channel.
  SNII_yield_factor_Carbon:             0.5             # (Optional) Correction factor to apply to the Carbon yield from the SNII channel.
  SNII_yield_factor_Nitrogen:           1.0             # (Optional) Correction factor to apply to the Nitrogen yield from the SNII channel.
  SNII_yield_factor_Oxygen:             1.0             # (Optional) Correction factor to apply to the Oxygen yield from the SNII channel.
  SNII_yield_factor_Neon:               1.0             # (Optional) Correction factor to apply to the Neon yield from the SNII channel.
  SNII_yield_factor_Magnesium:          2.0             # (Optional) Correction factor to apply to the Magnesium yield from the SNII channel.
  SNII_yield_factor_Silicon:            1.0             # (Optional) Correction factor to apply to the Silicon yield from the SNII channel.
  SNII_yield_factor_Iron:               0.5             # (Optional) Correction factor to apply to the Iron yield from the SNII channel.

# Parameters for the COLIBRE "equation of state"
COLIBREEntropyFloor:
  Jeans_density_norm_H_p_cm3: 0.1        # Physical density above which the COLIBRE Jeans limiter entropy floor kicks in expressed in Hydrogen atoms per cm^3.
  Jeans_temperature_norm_K:   10.        # Temperature of the COLIBRE Jeans limiter entropy floor at the density normalisation expressed in Kelvin.
  Jeans_gamma_effective:      1.3333333  # Slope the of the COLIBRE Jeans limiter entropy floor
  Cool_density_norm_H_p_cm3:  1e-5       # Physical density above which the COLIBRE Cool limiter entropy floor kicks in expressed in Hydrogen atoms per cm^3.
  Cool_temperature_norm_K:    -1.        # Temperature of the COLIBRE Cool limiter entropy floor at the density normalisation expressed in Kelvin.
  Cool_gamma_effective:       1.         # Slope the of the COLIBRE Cool limiter entropy floor


# Standard COLIBRE cooling options
COLIBRECooling:
  dir_name:                UV_dust1_CR1_G1_shield1.hdf5 # Location of the cooling tables
  H_reion_z:               11.5              # Redshift of Hydrogen re-ionization
  H_reion_eV_p_H:          2.0
  He_reion_z_centre:       3.5               # Redshift of the centre of the Helium re-ionization Gaussian
  He_reion_z_sigma:        0.5               # Spread in redshift of the  Helium re-ionization Gaussian
  He_reion_eV_p_H:         2.0               # Energy inject by Helium re-ionization in electron-volt per Hydrogen atom
  delta_logTEOS_subgrid_properties: 0.2      # delta log T above the EOS below which the subgrid properties use Teq assumption
  rapid_cooling_threshold:          0.333333 # Switch to rapid cooling regime for dt / t_cool above this threshold.

# Solar abundances
COLIBREChemistry:
  init_abundance_metal:      0.01           # Inital fraction of particle mass in *all* metals 
  init_abundance_Hydrogen:   0.752
  init_abundance_Helium:     0.248
  init_abundance_Carbon:     0.0
  init_abundance_Nitrogen:   0.0
  init_abundance_Oxygen:     0.0
  init_abundance_Neon:       0.0
  init_abundance_Magnesium:  0.0
  init_abundance_Silicon:    0.0
  init_abundance_Iron:       0.0
  init_abundance_Europium:   0.0
  metal_diffusion_constant:         0.   # No diffusion
  metal_diffusion_timestep_mult:    100. # No diffusion

# COLIBRE feedback model
COLIBREFeedback:
  use_SNII_feedback:                0               # Global switch for SNII thermal (stochastic) feedback.
  use_SNIa_feedback:                0               # Global switch for SNIa thermal (continuous) feedback.
  use_AGB_enrichment:               1               # Global switch for enrichement from AGB stars.
  use_SNII_enrichment:              1               # Global switch for enrichement from SNII stars.
  use_SNIa_enrichment:              1               # Global switch for enrichement from SNIa stars.
  with_r_process_enrichment:        1               # Global switch for r process enrichment from neutron star mergers and rare core-collapse SN (collapsars and common envelop jets SN).
  with_HIIRegions:                  0               # Switch for early feedback (HII regions).
  with_StellarWinds:                0               # Switch for early feedback (Stellar winds).
  filename:                         ./yieldtables/  # Path to the directory containing the EAGLE yield tables.
  IMF_min_mass_Msun:                0.1             # Minimal stellar mass considered for the Chabrier IMF in solar masses.
  IMF_max_mass_Msun:              100.0             # Maximal stellar mass considered for the Chabrier IMF in solar masses.
  SNII_min_mass_Msun:               6.0             # Minimal mass considered for SNII feedback (not SNII enrichment!) in solar masses.
  SNII_max_mass_Msun:             100.0             # Maximal mass considered for SNII feedback (not SNII enrichment!) in solar masses.
  SNII_wind_delay_Gyr:              0.03            # Time in Gyr between a star's birth and the SNII thermal feedback event.
  SNII_delta_T_K:                   3.16228e7       # Change in temperature to apply to the gas particle in a SNII thermal feedback event in Kelvin.
  SNII_energy_erg:                  1.0e51          # Energy of one SNII explosion in ergs.
  SNII_delta_v_km_p_s:              25.0            # Change in the gas-particle velocity that is kicked in a SNII kinetic feedback event
  SNII_f_kinetic:                   0.1             # Fraction of SNII energy injected into the gas in kinetic form (the remaining fraction is injected in thermal form).
  SNII_energy_fraction_min:         0.3             # Maximal fraction of energy applied in a SNII feedback event.
  SNII_energy_fraction_max:         3.0             # Minimal fraction of energy applied in a SNII feedback event.
  SNII_energy_fraction_Z_0:         0.0012663729    # Pivot point for the metallicity dependance of the SNII energy fraction (metal mass fraction).
  SNII_energy_fraction_n_0_H_p_cm3: 0.67            # Pivot point for the birth density dependance of the SNII energy fraction in cm^-3.
  SNII_energy_fraction_n_Z:         0.8686          # Power-law for the metallicity dependance of the SNII energy fraction.
  SNII_energy_fraction_n_n:         0.8686          # Power-law for the birth density dependance of the SNII energy fraction.
  SNIa_energy_erg:                 1.0e51           # Energy of one SNIa explosion in ergs.
  AGB_ejecta_velocity_km_p_s:      10.0             # Velocity of the AGB ejectas in km/s.
  stellar_evolution_age_cut_Gyr:       0.1          # Stellar age in Gyr above which the enrichment is down-sampled.
  stellar_evolution_sampling_age_fraction: 0.05     # Time-step of the stars in units of the star's current age when the star is older than the age cut.
  SNII_yield_factor_Hydrogen:       1.0             # (Optional) Correction factor to apply to the Hydrogen yield from the SNII channel.
  SNII_yield_factor_Helium:         1.0             # (Optional) Correction factor to apply to the Helium yield from the SNII channel.
  SNII_yield_factor_Carbon:         0.5             # (Optional) Correction factor to apply to the Carbon yield from the SNII channel.
  SNII_yield_factor_Nitrogen:       1.0             # (Optional) Correction factor to apply to the Nitrogen yield from the SNII channel.
  SNII_yield_factor_Oxygen:         1.0             # (Optional) Correction factor to apply to the Oxygen yield from the SNII channel.
  SNII_yield_factor_Neon:           1.0             # (Optional) Correction factor to apply to the Neon yield from the SNII channel.
  SNII_yield_factor_Magnesium:      2.0             # (Optional) Correction factor to apply to the Magnesium yield from the SNII channel.
  SNII_yield_factor_Silicon:        1.0             # (Optional) Correction factor to apply to the Silicon yield from the SNII channel.
  SNII_yield_factor_Iron:           0.5             # (Optional) Correction factor to apply to the Iron yield from the SNII channel.
  Momentum_desired_delta_v:         -1.0            # Desired kick in km/s (Done stochastically given the amount of momentum available - v<0 for the code to decide the kick - ) 
  SNIa_delta_T_K:                   3.16228e7       # Change in temperature to apply to the gas particle in a SNIa thermal feedback event in Kelvin.
  SNIa_energy_fraction:             1.0             # Fraction of energy applied in a SNIa feedback event.
  HIIregion_ionization_fraction:    1.0             # Ionization fraction for gas particles tagged as HII regions (between 0.5 and 1.)
  HIIregion_temperature_K:          1.e4            # Temperature of gas particles tagged as HII regions
  num_of_NSM_per_Msun:              1.54e-5         # Number of neutron star mergers per Msolar.
  yield_Eu_from_NSM_event_Msun:     1.5e-5          # Amount of europium (in units of Msolar) released by NSM.
  num_of_CEJSN_per_Msun:            1.22e-5         # Number of rare core-collapse SN (CEJSN) per Msolar.
  yield_Eu_from_CEJSN_event_Msun:   1e-5            # Amount of europium (in units of Msolar) released by CEJSN(=Common envelop jet SN).
  num_of_collapsar_per_Msun:        4.53e-7         # Number of rare core-collapse SN (collapsars) per Msolar.
  yield_Eu_from_collapsar_event_Msun: 1e-4          # Amount of europium (in units of Msolar) released by collapsars.
  collapsar_min_mass_Msun:          10.0            # Minimal mass considered for collapsar events in solar masses.
  collapsar_max_mass_Msun:         100.0            # Maximal mass considered for collapsar events in solar masses.

# COLIBRE feedback SNIa delay time distribution struct
SNIaDTD:
  SNIa_efficiency_p_Msun:       0.001       # Normalisation of the SNIa rates in inverse solar masses, used when there is only one functional form in the DTD.
  normalization_timescale_Gyr:  13.6        # Normalization time for DTDs that cannot be integrated to infinity 
  SNIa_delay_time_Gyr:          0.04        # Delay time before the DTD kicks in.
  
Event_logger:
  delta_time_SNIa_Myr:        10
  delta_time_SNII_Myr:        1
  delta_time_r_processes_Myr: 10
