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

Cosmology:                      # WMAP9 cosmology
  Omega_cdm:      0.2305
  Omega_lambda:   0.724
  Omega_b:        0.0455
  h:              0.703
  a_begin:        0.019607843	# z_ini = 50.
  a_end:          1.0		# z_end = 0.

# Parameters governing the time integration
TimeIntegration:
  dt_min:     1e-8
  dt_max:     1e-2 

# Parameters for the self-gravity scheme
Gravity:
  eta:          0.025
  MAC:          adaptive
  theta_cr:     0.7
  epsilon_fmm:  0.001
  comoving_DM_softening:         0.0889     # 1/25th of the mean inter-particle separation: 88.9 kpc
  max_physical_DM_softening:     0.0889     # 1/25th of the mean inter-particle separation: 88.9 kpc
  comoving_baryon_softening:     0.0889     # 1/25th of the mean inter-particle separation: 88.9 kpc
  max_physical_baryon_softening: 0.0889     # 1/25th of the mean inter-particle separation: 88.9 kpc
  mesh_side_length:       64

# Parameters of the hydro scheme
SPH:
  resolution_eta:      1.2348   # "48 Ngb" with the cubic spline kernel
  h_min_ratio:         0.1
  CFL_condition:       0.1
  initial_temperature: 7075.    # (1 + z_ini)^2 * 2.72K
  minimal_temperature: 100.

# Parameters governing the snapshots
Snapshots:
  subdir:              snapshots
  basename:            snap
  delta_time:          1.02
  scale_factor_first:  0.02
  compression:         4
  
# Parameters governing the conserved quantities statistics
Statistics:
  delta_time:          1.01
  scale_factor_first:  0.02
  
Scheduler:
  max_top_level_cells: 8
  cell_split_size:     50
  
# Parameters related to the initial conditions
InitialConditions:
  file_name:  small_cosmo_volume.hdf5
  periodic:                    1
  cleanup_h_factors:           1    
  cleanup_velocity_factors:    1  
  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.

# Constant lambda cooling function
LambdaCooling:
  lambda_nH2_cgs:              1e-26 # Cooling rate divided by square Hydrogen number density (in cgs units [erg * s^-1 * cm^3])

# EAGLE cooling function
EAGLECooling:
  dir_name:                 ./coolingtables/
  H_reion_z:               11.5
  H_reion_eV_p_H:          2.0
  He_reion_z_centre:       3.5
  He_reion_z_sigma:        0.5
  He_reion_eV_p_H:         2.0

# PS2020 cooling parameters
PS2020Cooling:
  dir_name:                ./UV_dust1_CR1_G1_shield1.hdf5
  H_reion_z:               11.5
  H_reion_eV_p_H:          2.0
  He_reion_z_centre:       3.5
  He_reion_z_sigma:        0.5
  He_reion_eV_p_H:         2.0
  delta_logTEOS_subgrid_properties: 0.5
  rapid_cooling_threshold:          0.333333

# Impose primoridal metallicity
EAGLEChemistry:
  init_abundance_metal:     0.0
  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

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

GEARPressureFloor:
  jeans_factor: 10.       # Number of particles required to suppose a resolved clump and avoid the pressure floor.


# Cooling with Grackle 3.0
GrackleCooling:
  cloudy_table: CloudyData_UVB=HM2012.h5       # Name of the Cloudy Table (available on the grackle bitbucket repository)
  with_UV_background: 1                        # Enable or not the UV background
  redshift: 0                                  # Redshift to use (-1 means time based redshift)
  with_metal_cooling: 1                        # Enable or not the metal cooling
  provide_volumetric_heating_rates: 0          # (optional) User provide volumetric heating rates
  provide_specific_heating_rates: 0            # (optional) User provide specific heating rates
  max_steps: 10000                             # (optional) Max number of step when computing the initial composition
  convergence_limit: 1e-2                      # (optional) Convergence threshold (relative) for initial composition
  thermal_time_myr: 5                          # (optional) Time (in Myr) for adiabatic cooling after a feedback event.
  self_shielding_method: -1                    # (optional) Grackle (1->3 for Grackle's ones, 0 for none and -1 for GEAR)
  self_shielding_threshold_atom_per_cm3: 0.007 # Required only with GEAR's self shielding. Density threshold of the self shielding
  maximal_density_Hpcm3: -1                 # Maximal density (in hydrogen atoms/cm^3) for cooling. Higher densities are floored to this value to ensure grackle works properly when interpolating beyond the cloudy_table maximal density. A value < 0 deactivates this parameter.


# GEAR chemistry model (Revaz and Jablonka 2018)
GEARChemistry:
  initial_metallicity: 1         # Initial metallicity of the gas (mass fraction)
  scale_initial_metallicity: 1   # Should we scale the initial metallicity with the solar one?

  # GEAR star formation model (Revaz and Jablonka 2018)
GEARStarFormation:
  star_formation_efficiency: 0.01   # star formation efficiency (c_*)
  maximal_temperature_K:  3e4       # Upper limit to the temperature of a star forming particle
  density_threshold_Hpcm3: 5        # Density threshold in Hydrogen atoms/cm3
  n_stars_per_particle: 4
  min_mass_frac: 0.5

# GEAR feedback model
GEARFeedback:
  supernovae_energy_erg: 0.1e51                            # Energy released by a single supernovae.
  yields_table: chemistry-AGB+OMgSFeZnSrYBaEu-16072013.h5  # Table containing the yields.
  discrete_yields: 0                                       # Should we use discrete yields or the IMF integrated one?
