afivo-streamer  1.1
1D/2D/3D streamer simulations with AMR
Data Types | Functions/Subroutines | Variables
m_chemistry Module Reference

Module for handling chemical reactions. More...

Functions/Subroutines

subroutine, public chemistry_initialize (tree, cfg)
 Initialize module and load chemical reactions. More...
 
subroutine chemistry_modify_rates (cfg)
 Modify reaction rates for sensitivity analysis. More...
 
subroutine, public chemistry_write_summary (fname)
 Write a summary of the reactions (TODO) and the ionization and attachment coefficients (if working at constant pressure) More...
 
subroutine check_charge_conservation ()
 
subroutine, public chemistry_get_breakdown_field (field_td, min_growth_rate)
 Get the breakdown field in Townsend. More...
 
subroutine, public get_rates (fields, rates, n_cells, energy_eV)
 Compute reaction rates. More...
 
subroutine, public get_derivatives (dens, rates, derivs, n_cells)
 Compute derivatives due to chemical reactions. Note that the 'rates' argument is modified. More...
 
subroutine, public read_reactions (filename, read_success)
 Read reactions from a file. More...
 
subroutine parse_reaction (reaction_text, reaction, ignored_species, keep_reaction)
 Parse a reaction and store it. More...
 
elemental integer function, public species_index (name)
 Find index of a species, return -1 if not found. More...
 

Variables

integer, parameter, public ionization_reaction = 1
 Identifier for ionization reactions. More...
 
integer, parameter, public attachment_reaction = 2
 Identifier for attachment reactions. More...
 
integer, parameter, public recombination_reaction = 3
 Identifier for recombination reactions. More...
 
integer, parameter, public detachment_reaction = 4
 Identifier for detachment reactions. More...
 
integer, parameter, public general_reaction = 5
 Identifier for general reactions (not of any particular type) More...
 
character(len=20), dimension(*), parameter, public reaction_names = [character(len=20) :: "ionization", "attachment", "recombination", "detachment", "general"]
 
integer, public, protected n_species = 0
 Number of species present. More...
 
integer, public, protected n_gas_species = 0
 Number of gas species present. More...
 
integer, public, protected n_plasma_species = 0
 Number of plasma species present. More...
 
integer, public, protected n_reactions = 0
 Number of reactions present. More...
 
character(len=comp_len), dimension(max_num_species), public, protected species_list
 List of the species. More...
 
integer, dimension(max_num_species), public, protected species_charge = 0
 Charge of the species. More...
 
integer, dimension(max_num_species), public, protected species_itree
 species_itree(n) holds the index of species n in the tree (cell-centered variables) More...
 
type(reaction_t), dimension(max_num_reactions), public, protected reactions
 List of reactions. More...
 
integer, dimension(:), allocatable, public, protected charged_species_itree
 List with indices of charged species. More...
 
integer, dimension(:), allocatable, public, protected charged_species_charge
 List with charges of charged species. More...
 

Detailed Description

Module for handling chemical reactions.

Function/Subroutine Documentation

◆ check_charge_conservation()

subroutine m_chemistry::check_charge_conservation

Definition at line 503 of file m_chemistry.f90.

◆ chemistry_get_breakdown_field()

subroutine, public m_chemistry::chemistry_get_breakdown_field ( real(dp), intent(out)  field_td,
real(dp), intent(in)  min_growth_rate 
)

Get the breakdown field in Townsend.

Parameters
[out]field_tdBreakdown field in Townsend
[in]min_growth_rateMinimal growth rate for breakdown

Definition at line 518 of file m_chemistry.f90.

Here is the call graph for this function:

◆ chemistry_initialize()

subroutine, public m_chemistry::chemistry_initialize ( type(af_t), intent(inout)  tree,
type(cfg_t), intent(inout)  cfg 
)

Initialize module and load chemical reactions.

Definition at line 177 of file m_chemistry.f90.

Here is the call graph for this function:

◆ chemistry_modify_rates()

subroutine m_chemistry::chemistry_modify_rates ( type(cfg_t), intent(inout)  cfg)

Modify reaction rates for sensitivity analysis.

Definition at line 390 of file m_chemistry.f90.

◆ chemistry_write_summary()

subroutine, public m_chemistry::chemistry_write_summary ( character(len=*), intent(in)  fname)

Write a summary of the reactions (TODO) and the ionization and attachment coefficients (if working at constant pressure)

Definition at line 428 of file m_chemistry.f90.

Here is the call graph for this function:

◆ get_derivatives()

subroutine, public m_chemistry::get_derivatives ( real(dp), dimension(n_cells, n_species), intent(in)  dens,
real(dp), dimension(n_cells, n_reactions), intent(inout)  rates,
real(dp), dimension(n_cells, n_species), intent(out)  derivs,
integer, intent(in)  n_cells 
)

Compute derivatives due to chemical reactions. Note that the 'rates' argument is modified.

Parameters
[in]densSpecies densities
[in,out]ratesOn input, reaction rate coefficients. On output, actual reaction rates.
[out]derivsDerivatives of the chemical species

Definition at line 657 of file m_chemistry.f90.

◆ get_rates()

subroutine, public m_chemistry::get_rates ( real(dp), dimension(n_cells), intent(in)  fields,
real(dp), dimension(n_cells, n_reactions), intent(out)  rates,
integer, intent(in)  n_cells,
real(dp), dimension(n_cells), intent(in), optional  energy_eV 
)

Compute reaction rates.

Todo:
These reactions do not take into account a variable gas_temperature
Parameters
[in]n_cellsNumber of cells
[in]fieldsThe field (in Td) in the cells
[out]ratesThe reaction rates
[in]energy_evElectron energy in eV

Definition at line 565 of file m_chemistry.f90.

◆ parse_reaction()

subroutine m_chemistry::parse_reaction ( character(len=*), intent(in)  reaction_text,
type(reaction_t), intent(out)  reaction,
character(len=comp_len), dimension(:), intent(in)  ignored_species,
logical, intent(out)  keep_reaction 
)

Parse a reaction and store it.

Definition at line 1036 of file m_chemistry.f90.

Here is the call graph for this function:

◆ read_reactions()

subroutine, public m_chemistry::read_reactions ( character(len=*), intent(in)  filename,
logical, intent(out)  read_success 
)

Read reactions from a file.

Definition at line 741 of file m_chemistry.f90.

Here is the call graph for this function:

◆ species_index()

elemental integer function, public m_chemistry::species_index ( character(len=*), intent(in)  name)

Find index of a species, return -1 if not found.

Definition at line 1161 of file m_chemistry.f90.

Variable Documentation

◆ attachment_reaction

integer, parameter, public m_chemistry::attachment_reaction = 2

Identifier for attachment reactions.

Definition at line 16 of file m_chemistry.f90.

◆ charged_species_charge

integer, dimension(:), allocatable, public, protected m_chemistry::charged_species_charge

List with charges of charged species.

Definition at line 160 of file m_chemistry.f90.

◆ charged_species_itree

integer, dimension(:), allocatable, public, protected m_chemistry::charged_species_itree

List with indices of charged species.

Definition at line 157 of file m_chemistry.f90.

◆ detachment_reaction

integer, parameter, public m_chemistry::detachment_reaction = 4

Identifier for detachment reactions.

Definition at line 20 of file m_chemistry.f90.

◆ general_reaction

integer, parameter, public m_chemistry::general_reaction = 5

Identifier for general reactions (not of any particular type)

Definition at line 22 of file m_chemistry.f90.

◆ ionization_reaction

integer, parameter, public m_chemistry::ionization_reaction = 1

Identifier for ionization reactions.

Definition at line 14 of file m_chemistry.f90.

◆ n_gas_species

integer, public, protected m_chemistry::n_gas_species = 0

Number of gas species present.

Definition at line 127 of file m_chemistry.f90.

◆ n_plasma_species

integer, public, protected m_chemistry::n_plasma_species = 0

Number of plasma species present.

Definition at line 130 of file m_chemistry.f90.

◆ n_reactions

integer, public, protected m_chemistry::n_reactions = 0

Number of reactions present.

Definition at line 133 of file m_chemistry.f90.

◆ n_species

integer, public, protected m_chemistry::n_species = 0

Number of species present.

Definition at line 124 of file m_chemistry.f90.

◆ reaction_names

character(len=20), dimension(*), parameter, public m_chemistry::reaction_names = [character(len=20) :: "ionization", "attachment", "recombination", "detachment", "general"]

Definition at line 24 of file m_chemistry.f90.

◆ reactions

type(reaction_t), dimension(max_num_reactions), public, protected m_chemistry::reactions

List of reactions.

Definition at line 145 of file m_chemistry.f90.

◆ recombination_reaction

integer, parameter, public m_chemistry::recombination_reaction = 3

Identifier for recombination reactions.

Definition at line 18 of file m_chemistry.f90.

◆ species_charge

integer, dimension(max_num_species), public, protected m_chemistry::species_charge = 0

Charge of the species.

Definition at line 139 of file m_chemistry.f90.

◆ species_itree

integer, dimension(max_num_species), public, protected m_chemistry::species_itree

species_itree(n) holds the index of species n in the tree (cell-centered variables)

Definition at line 142 of file m_chemistry.f90.

◆ species_list

character(len=comp_len), dimension(max_num_species), public, protected m_chemistry::species_list

List of the species.

Definition at line 136 of file m_chemistry.f90.