(My game called star system generator) Formula for critical distance from star where gas giant will become chthonian planet


Creating a detailed calculation for determining the critical distance at which a gas giant may become a chthonian planet involves making several assumptions and simplifications since the real-world physics can be quite complex. Let's break this down into a step-by-step approach, integrating some basic physics principles.
Assumptions:

    Stellar Luminosity and Temperature: Assume the star emits energy uniformly (a blackbody approximation).
    Simplified Atmosphere Loss: Use basic thermal escape velocity for atmospheric particles.
    Planetary Structure: Assume a homogeneous spherical gas giant for simplicity.

Parameters Needed:

    ( L ): Luminosity of the star (in watts).
    ( T_{\text{eff}} ): Effective temperature of the planet's atmosphere (in Kelvin).
    ( R_p ): Radius of the planet (in meters).
    ( M_p ): Mass of the planet (in kilograms).
    ( \rho_p ): Density of the planet (in kg/m³).
    ( M_s ): Mass of the star (in kilograms).
    ( \rho_s ): Density of the star (in kg/m³).
    ( m ): Mean molecular mass of atmospheric particles (in kilograms, e.g., molecular hydrogen is ( \approx 2 \times 1.67 \times 10^{-27} ) kg).
    ( G ): Gravitational constant (( 6.674 \times 10^{-11} , \text{m}^3/\text{kg}/\text{s}^2 )).
    ( \sigma ): Stefan-Boltzmann constant (( 5.67 \times 10^{-8} , \text{W}/\text{m}^2/\text{K}^4 )).

Step-by-step Calculation:
1. Calculate the Energy Received by the Planet:

The power per unit area (flux) received by the planet from the star is given by:

[
F = \frac{L}{4\pi d^2}
]

Where ( d ) is the distance from the star.
2. Determine the Temperature of the Planet's Atmosphere:

Assume the planet is in thermal equilibrium, meaning it radiates as much energy as it receives:

[
\sigma T_{\text{eff}}^4 = \frac{L}{4\pi d^2}
]

Solve for ( T_{\text{eff}} ):

[
T_{\text{eff}} = \left(\frac{L}{4\pi \sigma d^2}\right)^{1/4}
]
3. Thermal Escape Velocity Check:

Atmospheric particles escape when thermal velocites exceed escape velocity of planet. Average thermal velocity ( v ) is:

[
v = \sqrt{\frac{8kT_{\text{eff}}}{\pi m}}
]

where ( k ) is the Boltzmann constant (( 1.38 \times 10^{-23} , \text{J/K} )).

Escape velocity from planet's surface:

[
v_{\text{esc}} = \sqrt{\frac{2G M_p}{R_p}}
]

Set ( v \approx v_{\text{esc}} ) to find limit:

[
\sqrt{\frac{8kT_{\text{eff}}}{\pi m}} \approx \sqrt{\frac{2G M_p}{R_p}}
]

Solve for ( d ):

[
T_{\text{eff}} = \left(\frac{L}{4\pi \sigma d^2}\right)^{1/4} \geq \frac{G M_p m}{R_p k}
]

Re-arrange to solve for ( d ).
4. Roche Limit for Structural Integrity:

Check if the planet is within the Roche limit (a different consideration from atmospheric loss):

[
d_{\text{Roche}} \approx 2.44 \cdot R_s \cdot \left( \frac{\rho_s}{\rho_p} \right)^{1/3}
]
Implement

    Calculate ( d ) for atmospheric loss using the energy and escape velocity balance.
    Ensure ( d > d_{\text{Roche}} ) to avoid tidal disruption.

Note: Exact equations and thresholds depend on your simulation's physics fidelity and computational constraints. The above combines essential concepts with simplified assumptions for illustrative purposes.