Skip to content

Support using the Jeans length as the star formation threshold#420

Open
hsinhaoHHuang wants to merge 34 commits intogamer-project:mainfrom
hsinhaoHHuang:JeansLengthStarFormation
Open

Support using the Jeans length as the star formation threshold#420
hsinhaoHHuang wants to merge 34 commits intogamer-project:mainfrom
hsinhaoHHuang:JeansLengthStarFormation

Conversation

@hsinhaoHHuang
Copy link
Contributor

@hsinhaoHHuang hsinhaoHHuang commented Jan 26, 2025

Goal

  • To support using the local Jeans length $\lambda_J=\sqrt{\frac{\pi c_s^2}{G\rho}}$ as the star formation threshold

Changes

  • Generalize the original SF_CreateStar_AGORA() as SF_CreateStar_GeneralGalaxy() for general local star formation recipes.

    • Separate the part checking the star formation threshold to SF_CreateStar_Check.cpp
    • Separate the part deciding the star mass to SF_CreateStar_GetStarMass.cpp
  • Add a new star formation scheme SF_CREATE_STAR_SCHEME = 2 to use the Jeans length as the star formation threshold.

  • Add a new runtime parameter SF_CREATE_STAR_MAX_GAS_JEANSL, where the star will only form when the local Jeans length is less than dh*SF_CREATE_STAR_MAX_GAS_JEANSL.

  • Add a new test problem, Hydro/StarFormationThreshold, to test the implementation of star formation.

    • With varying temperature and density in the initial conditions.
    • Both particles and fluid are frozen and reset to initial conditions. Only stars keep forming.

Verifications

  • With the modifications, we can still reproduce the results of the original Hydro/AGORA_IsolatedGalaxy test problem (tested with BITWISE_REPRODUCIBILITY on).

  • In the new Hydro/StarFormationThreshold test problem, the star forms in the expected region with the expected star mass and star formation rate.

    • Setups

      • BoxSize: 8 kpc
      • Grids: 128x128x32
      • MAX_LEVEL 0
      • No initial particle
      • OPT__FREEZE_PAR 1
      • OPT__FREEZE_FLUID 1
      • OPT__RESET_FLUID 1
      • SF_CREATE_STAR_MASS_EFF 1.0e-2
      • SF_CREATE_STAR_MIN_STAR_MASS 1.0e3 (Msun)
      • SF_CREATE_STAR_MAX_STAR_MFRAC 0.5
    • Initial conditions

      • T-rho phase diagram = x-y spatial distribution
        image
    • SF_CREATE_STAR_SCHEME = 1, which uses density = 8.37e-24 g cm^-3 as the threshold

      • Star formation threshold
        image
        image
      • Star formation mass distribution
        image
      • Star formation rate
        image
    • SF_CREATE_STAR_SCHEME = 2, which uses Jeans length = 1 dh as the threshold

      • Star formation threshold
        image
        image
      • Star formation mass distribution
        image
      • Star formation rate
        image
        • The periodic pattern in the star formation rate seems related to the smaller time step close to the timing of Output_DumpData and the number of bins in the calculation. Due to (1) the large number of star-forming cells and (2) the total star masses dominated by the high-density cells, the variance due to the stochastic star formation is probably unobservable. For the cells (8~9th grids from the right) that will form a star with 50% probability, the theoretical sigma/mean = 1/sqrt(~32*96) < 2%.
      Test with `OPT__RESET_FLUID = 0`, fluid was removed every step

      image

      image

      image

Copy link
Collaborator

@ChunYen-Chen ChunYen-Chen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hsinhaoHHuang Thanks for the contribution. I have left some comments including some bugs. Also, please update your branch to solve the conflict.

Copy link
Contributor Author

@hsinhaoHHuang hsinhaoHHuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChunYen-Chen
Thank you so much for your review. I have modified the code accordingly.

About adding the new runtime parameter in the doc/wiki, I plan to wait for #431 and update it (or I will update that PR if this PR is merged earlier), since all the star formation runtime parameters are completed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants