uclchem.makerates.reaction#

Module Contents#

Classes#

Attributes#

class uclchem.makerates.reaction.CoupledReaction(input)[source]#

Bases: Reaction

get_partner()[source]#
set_partner(partner: Reaction)[source]#
partner = None[source]#
class uclchem.makerates.reaction.Reaction(inputRow, reaction_source=None)[source]#
NANCheck(a)[source]#

Convert any Falsy statement to a NAN string

Parameters:

a – thing to check for falsiness

Returns:

input a if truthy, otherwise NAN

Return type:

bool

changes_surface_count()[source]#

This checks whether a grain reaction changes number of particles on the surface 2 reactants to 2 products won’t but two reactants combining to one will.

changes_total_mantle()[source]#

Check if the total grains on the mantle are changed by the reaction.

check_charge_conservation() None[source]#
check_element_conservation() None[source]#
check_temperature_collision(other) bool[source]#

Check if two reactions have overlapping temperature ranges, returning True means there is a collision.

Parameters:

other – Another reaction

Raises:

NotImplementedError – Currently we can only compare against instantiated Reaction objects.

Returns:

Whether there is a collision (True), or not (False)

Return type:

bool

convert_gas_to_surf() None[source]#

Convert the gas-phase species to surface species in place for this reaction. If any ions are produced, the ion is assumed to become neutral because it is on the surface. If any electrons are produced, they are assumed to be absorbed by the grain.

convert_surf_to_bulk() None[source]#

Convert the surface species to bulk species in place for this reaction.

generate_ode_bit(i: int, species_names: list)[source]#
get_alpha() float[source]#

Get the alpha parameter from the Kooij-Arrhenius equation

Returns:

the alpha parameter of the reaction

Return type:

float

get_beta() float[source]#

Get the beta parameter from the Kooij-Arrhenius equation

Returns:

the beta parameter of the reaction

Return type:

float

get_extrapolation() bool[source]#
get_gamma() float[source]#

Get the gamma parameter from the Kooij-Arrhenius equation

Returns:

the gamma parameter of the reaction

Return type:

float

get_products() list[str][source]#

Get the four products present in the reaction, padded with NAN for nonexistent

Parameters:

reactants (list[str]) – The four products names

get_pure_products() list[str][source]#

Get only the pure species that are products, no reaction types and NAN entries

Returns:

The list of produced species.

Return type:

list[str]

get_pure_reactants() list[str][source]#

Get only the pure species, no reaction types and NAN entries

Returns:

The list of reacting species.

Return type:

list[str]

get_reactants() list[str][source]#

Get the four reactants present in the reaction, padded with NAN for nonexistent

Returns:

The four reactants names

Return type:

list[str]

get_reaction_type() str[source]#

Get the type of a reaction from the reactants First check the third reactant for a reaction type, then the second. If there are none in there, it will be regarded as a two body reaction.

Return type:

str

get_reduced_mass() float[source]#

Get the reduced mass to be used to calculate tunneling rate in AMU

Returns:

reduced mass of moving atoms

Return type:

float

get_sorted_products() list[str][source]#

Get the four products present in the reaction, sorted for fast comparisons

Parameters:

products (list[str]) – The four sorted products names

get_sorted_reactants() list[str][source]#

Get the four reactants present in the reaction, sorted for fast comparisons

Parameters:

reactants (list[str]) – The four sorted reactant names

get_source() str[source]#

Get the source of the reaction

Returns:

The source of the reaction

Return type:

str

get_temphigh() float[source]#

Get the higher temperature boundary of the reaction in Kelvin

Returns:

the higher temperature boundary

Return type:

float

get_templow() float[source]#

Get the lower temperature boundary of the reaction in Kelvin

Returns:

the lower temperature boundary

Return type:

float

is_bulk_reaction(include_reactants=True, include_products=True, strict=False) bool[source]#

Check whether it is a bulk reaction, defaults to non-strict since many important bulk reactions interact with the surface.

By default it is NOT strict (strict=False); any species in the bulk returns true If strict=True; all species must be on the ice phase

Parameters:
  • include_reactants (bool, optional) – Include the reactants. Defaults to True.

  • include_products (bool, optional) – Include the products. Defaults to True.

  • strict (bool, optional) – Choose between all (true) or any (false) must in the bulk . Defaults to False.

Returns:

Is it a bulk reaction?

Return type:

bool

is_gas_reaction(include_reactants=True, include_products=True, strict=True) bool[source]#

Check whether it is a gas reaction, by default it is strict - all reactions must be in the gas-phase - if strict=False; any reaction in the gas-phase returns true.

Parameters:
  • include_reactants (bool, optional) – Include the reactants. Defaults to True.

  • include_products (bool, optional) – Include the products. Defaults to True.

  • strict (bool, optional) – Choose between all (true) or any (false) must be gas phase . Defaults to True.

Returns:

Is it a gas phase reaction?

Return type:

bool

is_ice_reaction(include_reactants=True, include_products=True, strict=True) bool[source]#

Check whether it is an ice (surface OR bulk) reaction

By default it is strict (strict=True); all species must be in the ice phase If strict=False; any species in ice phase returns True

Parameters:
  • include_reactants (bool, optional) – Include the reactants. Defaults to True.

  • include_products (bool, optional) – Include the products. Defaults to True.

  • strict (bool, optional) – Choose between all (true) or any (false) must be ice phase . Defaults to True.

Returns:

Is it an ice phase reaction?

Return type:

bool

is_surface_reaction(include_reactants=True, include_products=True, strict=False) bool[source]#

Check whether it is a surface reaction, defaults to non-strict since many important surface reactions can lead to desorption in some way.

By default it is NOT strict (strict=False); any species on the surface returns true If strict=True; all species must be on the ice phase

Parameters:
  • include_reactants (bool, optional) – Include the reactants. Defaults to True.

  • include_products (bool, optional) – Include the products. Defaults to True.

  • strict (bool, optional) – Choose between all (true) or any (false) must be on the surface . Defaults to False.

Returns:

Is it a surface reaction?

Return type:

bool

predict_reduced_mass() None[source]#

Predict the reduced mass of the tunneling particle in this reaction. This is used in the calculation of the tunneling rates.

set_alpha(alpha: float) None[source]#

Set the alpha parameter from the Kooij-Arrhenius equation

Parameters:

alpha (float) – the alpha parameter of the reaction

set_beta(beta: float) None[source]#

Set the beta parameter from the Kooij-Arrhenius equation

Parameters:

beta (float) – the beta parameter of the reaction

set_extrapolation(flag: bool) None[source]#
set_gamma(gamma: float) None[source]#

Set the gamma parameter from the Kooij-Arrhenius equation

Parameters:

gamma (float) – the gamma parameter of the reaction

set_products(products: list[str]) None[source]#

Set the four products present in the reaction, padded with NAN for nonexistent

Parameters:

products (list[str]) – The four products names

set_reactants(reactants: list[str]) None[source]#

Set the four reactants present in the reaction, padded with NAN for nonexistent

Parameters:

reactants (list[str]) – The four reactants names

set_reduced_mass(reduced_mass: float) None[source]#

Set the reduced mass to be used to calculate tunneling rate in AMU

Parameters:

reduced_mass (float) – reduced mass of moving atoms

set_source(source: str) None[source]#

Set the source of the reaction

Parameters:

source (str) – The source of the reaction

set_temphigh(temphigh: float) None[source]#

Set the higher temperature boundary of the reaction in Kelvin

Parameters:

templow (float) – the higher temperature boundary

set_templow(templow: float) None[source]#

Set the lower temperature boundary of the reaction in Kelvin

Parameters:

templow (float) – the lower temperature boundary

to_UCL_format()[source]#

Convert a reaction to UCLCHEM reaction file format

body_count = -1[source]#
duplicate = False[source]#
source = None[source]#
uclchem.makerates.reaction.reaction_types = ['PHOTON', 'CRP', 'CRPHOT', 'FREEZE', 'DESORB', 'THERM', 'DESOH2', 'DESCR', 'DEUVCR', 'H2FORM',...[source]#
uclchem.makerates.reaction.tunneling_reaction_types = ['LH', 'LHDES', 'ER', 'ERDES'][source]#