# Define the system of units to use internally. 
InternalUnitSystem:
  UnitMass_in_cgs:     1.98848e43    # 10^10 M_sun in grams
  UnitLength_in_cgs:   3.08567758e21 # kpc 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.5           # Initial scale-factor of the simulation
  a_end:          1.0           # Final scale factor of the simulation
  Omega_m:        0.307         # Matter density parameter
  Omega_lambda:   0.693         # Dark-energy density parameter
  Omega_b:        0.0455        # Baryon density parameter

# Parameters governing the time integration
TimeIntegration:
  time_begin: 0      # The starting time of the simulation (in internal units).
  time_end:   0.5    # The end time of the simulation (in internal units).
  dt_min:     1e-10  # The minimal time-step size of the simulation (in internal units).
  dt_max:     1e-5   # The maximal time-step size of the simulation (in internal units).

# Parameters governing the snapshots
Snapshots:
  basename:            output # Common part of the name of output files
  time_first:          0.       # Time of the first output (in internal units)
  delta_time:          0.001    # Time difference between consecutive outputs without cosmology (internal units)

# Parameters governing the conserved quantities statistics
Statistics:
  time_first:          0.
  delta_time:          1.e-2  # non cosmology time between statistics output
  scale_factor_first:  0.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:   10.      # Kelvin

# Properties of the stars
Stars:
  birth_time:  0.   # Give the star in the ICs a decent birth time
  
# Parameters related to the initial conditions
InitialConditions:
  file_name:  ./ics.hdf5       # The file to read
  periodic:   1
  
Scheduler:
  max_top_level_cells: 8

# Solar abundances
COLIBREChemistry:
  init_abundance_metal:     0.0133714      # Inital fraction of particle mass in *all* metals 
  init_abundance_Hydrogen:  0.73738788833  # Inital fraction of particle mass in Hydrogen
  init_abundance_Helium:    0.24924186942  # Inital fraction of particle mass in Helium
  init_abundance_Carbon:    0.0023647215   # Inital fraction of particle mass in Carbon
  init_abundance_Nitrogen:  0.0006928991   # Inital fraction of particle mass in Nitrogen
  init_abundance_Oxygen:    0.00573271036  # Inital fraction of particle mass in Oxygen
  init_abundance_Neon:      0.00125649278  # Inital fraction of particle mass in Neon
  init_abundance_Magnesium: 0.00070797838  # Inital fraction of particle mass in Magnesium
  init_abundance_Silicon:   0.00066495154  # Inital fraction of particle mass in Silicon
  init_abundance_Iron:      0.00129199252  # Inital fraction of particle mass in Iron
  init_abundance_Europium:  0.0            # Inital fraction of particle mass in Europium
  metal_diffusion_constant:         0.01           # Metal diffusion constant (Smagorinsky constant)
  metal_diffusion_timestep_mult:    0.2            # Run-time parameter to control the time-step condition based on the diffusion rate.


# Feedback parameter
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:                  1               # Switch for early feedback (HII regions).
  with_StellarWinds:                1               # Switch for early feedback (Stellar winds).
  with_RadiationPressure:           1               # Switch for early feedback (Radiation pressure).
  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:              -1.           # Time in Gyr between a star's birth and the SNII thermal feedback event. (< 0. for continuous SNe)
  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.0             # Fraction of SNII energy injected into the gas in kinetic form (the remaining fraction is injected in thermal form)
  SNII_energy_fraction_min:         1.0             # Maximal fraction of energy applied in a SNII feedback event.
  SNII_energy_fraction_max:         1.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.
  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.
  AGB_ejecta_velocity_km_p_s:      10.0             # Velocity of the AGB ejectas in km/s.
  stellar_evolution_age_cut_Gyr:    100             # Stellar age in Gyr above which the enrichment is down-sampled.
  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.
  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 - ) 
  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
  HIIregion_rebuild_dt_Myr:         2.0             # Time between rebuilding the HII region in Myr 
  earlyfb_filename:                 Early_stellar_feedback.hdf5  # Location of file for early feedback, no needed if stellarwind_maxage_Myr = HIIregion_maxage_Myr = 0.
  stellarwind_maxage_Myr:           1000.           # (Optional) Maximum age in Myr of star particle to inject momentum by stellar winds. Default: 250 Myr, maximum (table) = 1000 Myr
  HIIregion_maxage_Myr:             1000.           # (Optional) same as stellarwind_maxage_Myr, but for HII regions. Default: 50 Myr, maximum (table) = 1000 Myr
  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 r-process enrichment from collapsars in solar masses.
  collapsar_max_mass_Msun:          100.0           # Maximal mass considered for r-process enrichment from collapsars in solar masses.

# The SNIa DTD properties in the COLIBRE feedback
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.

# 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.3      # 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.

Event_logger:
  delta_time_SNIa_Myr:        10
  delta_time_SNII_Myr:        1
  delta_time_r_processes_Myr: 10
