carbon
- carbon.radiative_processes(spectrum_at_planet)[source]
Calculate the photoionization rate of carbon 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 carbon (11.26 eV, or 1101 Angstrom).
- spectrum_at_planet
- Returns:
- phi_ci
float
Ionization rate of C I at null optical depth in unit of 1 / s.
- phi_cii
float
Ionization rate of C II at null optical depth in unit of 1 / s.
- a_ci
float
Flux-averaged photoionization cross-section of C I in unit of cm ** 2.
- a_cii
float
Flux-averaged photoionization cross-section of C II in unit of cm ** 2.
- a_h_ci
float
Flux-averaged photoionization cross-section of H I in the range absorbed by C I in unit of cm ** 2.
- a_h_cii
float
Flux-averaged photoionization cross-section of H I in the range absorbed by C II in unit of cm ** 2.
- a_he
float
Flux-averaged photoionization cross-section of He I in unit of cm ** 2.
- phi_ci
- carbon.electron_impact_ionization(electron_temperature)[source]
Calculates the electron impact ionization rate that consumes neutral C and produces singly-ionized C. Based on the formula of Voronov 1997 (https://ui.adsabs.harvard.edu/abs/1997ADNDT..65….1V/abstract).
- Parameters:
- electron_temperature
float
Temperature of the plasma where the electrons are embedded in unit of Kelvin.
- electron_temperature
- Returns:
- ionization_rate_ci
float
Ionization rate of neutral C into singly-ionized C in unit of cm ** 3 / s.
- ionization_rate_cii
float
Ionization rate of singly-ionized C into doubly-ionized C in unit of cm ** 3 / s.
- ionization_rate_ci
- carbon.recombination(electron_temperature)[source]
Calculates the rate of recombination of singly-ionized C with an electron to produce a neutral C atom. Based on the formulation of Woodall et al. 2007 (https://ui.adsabs.harvard.edu/abs/2007A%26A…466.1197W/abstract). Also calculates the recombination of doubly-ionized C with an electron to produce a singly-ionized C ion. Based on the formulation of Aldrovandi & Péquignot 1973 (https://ui.adsabs.harvard.edu/abs/1973A%26A….25..137A/abstract).
- Parameters:
- electron_temperature
float
Temperature of the plasma where the electrons are embedded in unit of Kelvin.
- electron_temperature
- Returns:
- alpha_rec_ci
float
Recombination rate of C II into C I in units of cm ** 3 / s.
- alpha_rec_cii
float
Recombination rate of C III into C II in units of cm ** 3 / s.
- alpha_rec_ci
- carbon.charge_transfer(temperature)[source]
Calculates the charge exchange rates of C with H, He and Si nuclei. Based on the formulation of Stancil et al. 1998 (https://ui.adsabs.harvard.edu/abs/1998ApJ…502.1006S/abstract), Woodall et al. 2007 (https://ui.adsabs.harvard.edu/abs/2007A%26A…466.1197W/abstract), Glover & Jappsen 2007 (https://ui.adsabs.harvard.edu/abs/2007ApJ…666….1G/abstract), Kingdon & Ferland 1996 (https://ui.adsabs.harvard.edu/abs/1996ApJS..106..205K/abstract), and Brown 1972 (https://ui.adsabs.harvard.edu/abs/1972ApJ…174..511B/abstract).
- Parameters:
- temperature
float
Isothermal temperature of the upper atmosphere in unit of Kelvin.
- temperature
- Returns:
- ct_rate_ci_hp
float
Charge transfer rate between neutral C and H+ in units of cm ** 3 / s.
- ct_rate_cii_h
float
Charge transfer rate between C+ and neutral H in units of cm ** 3 / s.
- ct_rate_ci_hep
float
Charge transfer rate between neutral C and He+ in units of cm ** 3 / s.
- ct_rate_cii_sii
float
Charge transfer rate between C+ and neutral Si in units of cm ** 3 / s.
- ct_rate_ciii_h
float
) Charge transfer rate between C++ and neutral H in units of cm ** 3 / s.
- ct_rate_ciii_he
float
) Charge transfer rate between C++ and neutral He in units of cm ** 3 / s.
- ct_rate_ci_hp
- carbon.ion_fraction(radius_profile, velocity, density, hydrogen_ion_fraction, helium_ion_fraction, planet_radius, temperature, h_fraction, speed_sonic_point, radius_sonic_point, density_sonic_point, spectrum_at_planet, c_fraction=0.0002691534803926914, initial_f_c_ion=array([0., 0.]), relax_solution=False, convergence=0.01, max_n_relax=10, method='odeint', return_rates=False, **options_solve_ivp)[source]
Calculates the fractions of singly- and doubly-ionized carbon 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.
- velocity
numpy.ndarray
Velocities sampled at the values of
radius_profile
in units of sound speed. Similar to the output ofparker.structure()
.- density
numpy.ndarray
Densities sampled at the values of
radius_profile
in units of density at the sonic point. Similar to the output ofparker.structure()
.- hydrogen_ion_fraction
numpy.ndarray
Number fraction of H ion over total H in the upper atmosphere in function of radius. Similar to the output of
hydrogen.ion_fraction()
.- helium_ion_fraction
numpy.ndarray
Number fraction of He ion over total He in the upper atmosphere in function of radius. Similar to the output of
helium.population_fraction()
, but should be1 - f_1_r - f_3_r
.- 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.
- speed_sonic_point
float
Speed of sound in the outflow in units of km / s.
- radius_sonic_point
float
Radius of the sonic point in unit of Jupiter radius.
- density_sonic_point
float
Density at the sonic point in units of g / cm ** 3.
- 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 carbon (11.26 eV, or 1101 Angstrom). Can be generated using
tools.make_spectrum_dict
.- c_fraction
float
, optional Fraction of total carbon in the upper atmosphere. Default value assumes solar abundance.
- initial_f_c_ion
numpy.ndarray
, optional The initial ion fractions are the y0 of the differential equation to be solved. This array has two items: the initial fraction of singly-ionized and doubly-ionized carbon in the inner layer of the atmosphere. The default value for this parameter is
numpy.array([0.0, 0.0])
, i.e., fully neutral at the inner layer.- 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 isFalse
.- 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 the ion fractions. Default is 10.
- method
str
, optional If method is
'odeint'
, thenscipy.integrate.odeint()
is used instead ofscipy.integrate.solve_ivp()
to calculate the steady-state distribution of helium. The first seems to be at least twice faster than the second in some situations. Any other method will fall back to an option ofsolve_ivp()
methods. For example, ifmethod
is set to'Radau'
, then usesolve_ivp(method='Radau')
. Default is'odeint'
.- return_rates
bool
, optional If
True
, then this function also returns adict
object containing the various reaction rates in function of radius and in units of 1 / s. Default isFalse
.- **options_solve_ivp:
Options to be passed to the
scipy.integrate.solve_ivp()
solver. You may want to change the optionsatol
(absolute tolerance; default is 1E-6) orrtol
(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.
- radius_profile
- Returns:
- f_cii_r
numpy.ndarray
Fraction of singly-ionized carbon in function of radius.
- f_ciii_r
numpy.ndarray
Fraction of doubly-ionized carbon in function of radius.
- reaction_rates
dict
Dictionary containing the reaction rates in function of radius and in units of 1 / s. Only returned when
return_rates
is set toTrue
. Here is a short description of the dict keys:ionization_CI: Photoionization of C I into C II
ionization_CII: Photoionization of C II into C III
recombination_CII: Recombination of C II into C I
recombination_CIII: Recombination of C III into C II
e_impact_ion_CI: Electron impact ionization of C I into C II
e_impact_ion_CII: Electron impact ionization of C II into C III
charge_exchange_CI_HII: Charge exchange between C I and H II
charge_exchange_CI_HeII: Charge exchange between C I and He II
charge_exchange_CII_HI: Charge exchange between C II and H I
charge_exchange_CIII_HI: Charge exchange between C III and H I
charge_exchange_CIII_HeI: Charge exchange between C III and He I
- f_cii_r