carmapy.chemistry#
Functions to determine the chemical properties of the atmosphere
Functions
Uses Young's Equation to calculate the cosine of contact angle between
Locates the P-T coordianates of the cloud base.
Uses fastchem to calculate the gas phase abundances of the provided species at the provided T-P points
Set the number mixing ratios below the cloud base.
Calculates the saturation vapor pressure for carmapy default gases.
- carmapy.chemistry.calculate_mucos(core, shell, T_ref, surften_interface=0.0)#
- Uses Young’s Equation to calculate the cosine of contact angle between
the seed particle and the condensing shell. Limits the value to be between +/- cos(0.1 degrees)
- Parameters:
core (
Union[str, Gas]) – The gas that condensed to form the core (either as a Gas object or the name of the carmapy default condensate)shell (
Union[str, Gas]) – The gas that condenses onto the CCN (either as a Gas object or the name of the carmapy default condensate)T_ref (
float) – The temperature at which to calculate the surface tensions [K]surften_interface (float, optional) – The surface tension at the interface of the core material and the outer shell, by default 0.0
- Returns:
The cosine of the contact angle between ther materials
- Return type:
float
- carmapy.chemistry.find_cloud_base(carma, species)#
Locates the P-T coordianates of the cloud base.
- Parameters:
carma (Carma) – A carma object with initialized gases, P-T structure, and log metallicity
species (
str) – Either the name of the carmapy default gas to find the cloud base of or the hill notation chemical formula of the species
- Return type:
tuple[float,float]- Returns:
P (float) – The pressure at the cloud base [barye]
T (float) – The temperature at the cloud base [K]
- carmapy.chemistry.get_fastchem_abundances(T, P, species, metallicity=1)#
Uses fastchem to calculate the gas phase abundances of the provided species at the provided T-P points
- Parameters:
T (
ndarray) – Temperature profile of the atmosphere [K]P (
ndarray) – Pressure profile of the atmosphere [barye]species (
list[str]) – List of species in Hill Notation (so TiO2 would be “O2Ti1”)metallicity (
float) – metallicity relative to solar (not log), by default 1
- Returns:
A 1-D (if only 1 species provided) or 2-D (if more than 1 species provided) array of the number mixing ratio of each species at each P-T point
- Return type:
ndarray
- carmapy.chemistry.populate_abundances_at_cloud_base(carma)#
Set the number mixing ratios below the cloud base. Uses the equilibrium concentration at the cloud base to determine what the mixing ratio should be
- Parameters:
carma (Carma) – A carma object with initialized gases, P-T structure, and log metallicity
- Return type:
None
- carmapy.chemistry.saturation_vapor_pressure(P, T, log_met, gas)#
Calculates the saturation vapor pressure for carmapy default gases.
- Parameters:
P (
TypeAliasType) – Atmospheric Pressure [barye]T (
TypeAliasType) – Temperature [K]log_met (
float) – Log solar metallicitygas (
Union[str, Gas]) – carma Gas object or name of the carmapy default gas
- Returns:
The saturation vapor pressure of the gas at each requested P-T point
- Return type:
TypeAliasType