hydrogen

hydrogen.radiative_processes_exact(spectrum_at_planet, r_grid, density, f_r, h_fraction)[source]

Calculate the photoionization rate of hydrogen as a function of radius based on the EUV spectrum arriving at the planet and the neutral H density profile.

Parameters
spectrum_at_planet (``dict``):

Spectrum of the host star arriving at the planet covering fluxes at least up to the wavelength corresponding to the energy to ionize hydrogen (13.6 eV, or 911.65 Angstrom).

r_grid (``array``):

Radius grid for the calculation, in units of cm.

density (``array``):

Number density profile for the atmosphere, in units of 1 / cm ** 3.

f_r (``array``):

Ionization fraction profile for the atmosphere.

h_fraction (``float``):

Hydrogen number fraction of the outflow.

Returns
phi_prime (float):

Ionization rate of hydrogen for each point on r_grid in unit of 1 / s.

hydrogen.radiative_processes(spectrum_at_planet)[source]

Calculate the photoionization rate of hydrogen at null optical depth based on the EUV spectrum arriving at the planet.

Parameters
spectrum_at_planet (``dict``):

Spectrum of the host star arriving at the planet covering fluxes at least up to the wavelength corresponding to the energy to ionize hydrogen (13.6 eV, or 911.65 Angstrom).

Returns
phi (float):

Ionization rate of hydrogen at null optical depth in unit of 1 / s.

a_0 (float):

Flux-averaged photoionization cross-section of hydrogen in unit of cm ** 2.

hydrogen.radiative_processes_mono(flux_euv, average_photon_energy=20.0)[source]

Calculate the photoionization rate of hydrogen at null optical depth based on the monochromatic EUV flux arriving at the planet.

Parameters
flux_euv (``float``):

Monochromatic extreme-ultraviolet (0 - 912 Angstrom) flux arriving at the planet in unit of erg / s / cm ** 2.

average_photon_energy (``float``, optional):

Average energy of the photons ionizing H in unit of eV. Default is 20 eV (as in Murray-Clay et al 2009, Allan & Vidotto 2019).

Returns
phi (float):

Ionization rate of hydrogen at null optical depth in unit of 1 / s.

a_0 (float):

Flux-averaged photoionization cross-section of hydrogen in unit of cm ** 2.

hydrogen.recombination(temperature)[source]

Calculates the case-B hydrogen recombination rate for a gas at a certain temperature.

Parameters
temperature (``float``):

Isothermal temperature of the upper atmosphere in unit of Kelvin.

Returns
alpha_rec (float):

Recombination rate of hydrogen in units of cm ** 3 / s.

hydrogen.ion_fraction(radius_profile, planet_radius, temperature, h_fraction, mass_loss_rate, planet_mass, average_ion_fraction=0.0, spectrum_at_planet=None, flux_euv=None, initial_f_ion=0.0, relax_solution=False, convergence=0.01, max_n_relax=10, exact_phi=False, **options_solve_ivp)[source]

Calculate the fraction of ionized hydrogen in the upper atmosphere in function of the radius in unit of planetary radius.

Parameters
radius_profile (``numpy.ndarray``):

Radius in unit of planetary radii.

planet_radius (``float``):

Planetary radius in unit of Jupiter radius.

temperature (``float``):

Isothermal temperature of the upper atmosphere in unit of Kelvin.

h_fraction (``float``):

Total (ion + neutral) H number fraction of the atmosphere.

mass_loss_rate (``float``):

Mass loss rate of the planet in units of g / s.

planet_mass (``float``):

Planetary mass in unit of Jupiter mass.

average_ion_fraction (``float``):

Average ion fraction in the upper atmosphere.

spectrum_at_planet (``dict``, optional):

Spectrum of the host star arriving at the planet covering fluxes at least up to the wavelength corresponding to the energy to ionize hydrogen (13.6 eV, or 911.65 Angstrom). Can be generated using tools.make_spectrum_dict. If None, then flux_euv must be provided instead. Default is None.

flux_euv (``float``, optional):

Extreme-ultraviolet (0-911.65 Angstrom) flux arriving at the planet in units of erg / s / cm ** 2. If None, then spectrum_at_planet must be provided instead. Default is None.

initial_f_ion (``float``, optional):

The initial ionization fraction at the layer near the surface of the planet. Default is 0.0, i.e., 100% neutral.

relax_solution (``bool``, optional):

The first solution is calculating by initially assuming the entire atmosphere is in neutral state. If True, the solution will be re-calculated in a loop until it converges to a delta_f of 1%, or for a maximum of 10 loops (default parameters). Default is False.

convergence (``float``, optional):

Value of delta_f at which to stop the relaxation of the solution for f_r. Default is 0.01.

max_n_relax (``int``, optional):

Maximum number of loops to perform the relaxation of the solution for f_r. Default is 10.

**options_solve_ivp:

Options to be passed to the scipy.integrate.solve_ivp() solver. You may want to change the options method (integration method; default is 'RK45'), atol (absolute tolerance; default is 1E-6) or rtol (relative tolerance; default is 1E-3). If you are having numerical issues, you may want to decrease the tolerance by a factor of 10 or 100, or 1000 in extreme cases.

Returns
f_r (numpy.ndarray):

Values of the fraction of ionized hydrogen in function of the radius.