Skip to content
Snippets Groups Projects
Commit 1a28d405 authored by Martin Deimel's avatar Martin Deimel
Browse files

MAINT Update 'proc_syntax.rst'

parent ee87891d
No related branches found
No related tags found
1 merge request!288Rework and update documentation
.. _proc_mini_language:
The Process Syntax
=========================
==================
In KMC language a process is uniquely defined by a configuration `before` the process is executed,
a configuration `after` the process is executed, and a rate constant. Here, this model is used to
define a process by giving it a:
In kMC language a process is uniquely defined by a
configuration `before` the process is executed,
a configuration `after` the process is executed,
and a rate constant. Here this model is used to
define a process by giving it a :
- ``condition_list``
- ``action_list``
- ``rate_constant``
- condition_list
- action_list
- rate_constant
As you might guess, each `condition` corresponds to one `before`, and each `action` corresponds to
one `after`. In fact, conditions and actions are actually of the same class or data type: each
condition and action consists of a coordinate and a species which `has to be` or `will be` at the
coordinate. This model of process definition also means that each process in one unit cell has to
be defined explicitly. Typically, on a single crystal surface one will have not only one diffusion
per species, but as many as there are equivalent directions:
- ``species_diffusion_right``
- ``species_diffusion_up``
- ``species_diffusion_left``
- ``species_diffusion_down``
As you might guess, each `condition` corresponds to one
`before`, and each `action` corresponds to one `after`.
In fact conditions and actions are actually of the same
class or data type: each condition and action consists of
a coordinate and a species which has to `be` or `will be` at
the coordinate. This model of process definition also
means that each process in one unit cell has to be
defined explicitly. Typically, on a single crystal
surface one will have not only one diffusion per species, but
as many as there are equivalent directions :
- species_diffusion_right
- species_diffusion_up
- species_diffusion_left
- species_diffusion_down
While it may seem like a lot of work to define that
many processes, it allows for a very clean and straightforward
definition of a process itself. Later you can use
geometric measures to abstract these cases as you will see
further down.
While it may seem like a lot of work to define that many processes, it allows for a very clean and
straightforward definition of a process itself. Later you can use geometric measures to abstract
these cases as you will see further down.
Adsorption
^^^^^^^^^^
Let's start with a very simple and basic process: molecular
adsorption of a gas phase species, let call it ``A`` on a
surface site. For this we need a species ::
Let's start with a very simple and basic process: molecular adsorption of a gas phase species,
let's call it ``A``, on a surface site. For this we need a species ::
from kmos3.types import *
kmc_model = kmos3.create_kmc_model()
......@@ -54,91 +42,73 @@ surface site. For this we need a species ::
empty = Species(name='empty')
kmc_model.add_species(empty)
and the coordinate of a surface site ::
and the coordinates of a surface site ::
layer = Layer(name='default')
kmc_model.add_layer(layer)
layer.sites.append(Site(name='a'))
coord = kmc_model.lattice.generate_coord('a.(0,0,0).default')
which is for now all we need to define an adsorption
process::
which is for now all we need to define an adsorption process ::
adsorption = Process(name='adsorption_A_a',
condition_list=[Condition(coord=coord,
species='empty')],
action_list=[Action(coord=coord,
species='A')])
adsorption = Process(
name='adsorption_A_a',
condition_list=[Condition(coord=coord, species='empty')],
action_list=[Action(coord=coord, species='A')]
)
kmc_model.add_process(adsorption)
Now this wasn't hard, was it?
Diffusion
^^^^^^^^^
Let's move to another example, namely the `diffusion` of
a particle to the next unit cell in the y-direction.
Initially, you need the coordinate of the final site ::
Let's move to another example, namely the `diffusion` of a particle to the next unit cell in the
y-direction. Initially, you need the coordinate of the final site ::
final = kmc_model.lattice.generate_coord('a.(0,1,0).default')
and you are good to go ::
diffusion_up = Process('diffusion_A_up',
condition_list=[Condition(coord=coord,
species='A'),
Condition(coord=final,
species='empty')],
condition_list=[Condition(coord=coord,
species='empty'),
Condition(coord=final,
species='A')],
diffusion_up = Process(
name='diffusion_A_up',
condition_list=[Condition(coord=coord, species='A'),
Condition(coord=final, species='empty')],
condition_list=[Condition(coord=coord, species='empty'),
Condition(coord=final, species='A')],
)
kmc_model.add_process(diffusion_up)
You can complicate this `ad infinitum` but you already know all the elements
necessary to define processes.
You can complicate this ad infinitum but you already know all the elements necessary to define
processes.
Avoid Double Counting
^^^^^^^^^^^^^^^^^^^^^^^^
Finally a word of warning: `double counting` is a phenomenon
that can arise for certain processes where there are more
than one equivalent directions and coordinates.
Consider, for example, the dissociative oxygen adsorption.
Novices typically collect all possible directions (e.g. right, up,
left, down) and then define this process for each direction.
However, this approach may be incorrect depending on
how the rate constant value was defined.
If the rate constant represents a net rate for
adsorption/desorption from a pair of sites (from an average or
from a single transition state that bridges two sites),
then the right, up, left, down procedures will result in `double counting`.
This is because, for example, adsorption_up is the same process
as adsorption_down, just executed from one site above or below.
To address this issue, one can compensate by dividing each
adsorption and desorption rate constant by 2.
Alternatively, one can avoid double counting by only defining geometrically equivalent
sites once per unit cell: a simple trick to achieve this is to
only consider processes in the `positive` directions, for example.
However, it's crucial to recognize that in cases where there are two
transition state possibilities (one above each site) due to a
heterolytic cleavage transition state, it's essential to acknowledge
and include both processes. These processes should not be dismissed
as 'double counting' because they represent distinct pathways with
unique transition states sharing the same reactants and products.
Most rate constants in the literature for dissociative adsorption
are defined as an average for the two sites,
or involve a single homolytic transition state,
and thus most cases of dissociate adsorption should have a single process
between up and down as well as between left and right
^^^^^^^^^^^^^^^^^^^^^
Finally a word of warning: `double counting` is a phenomenon that can arise for certain processes
where there are more than one equivalent directions and coordinates. Consider, for example, the
dissociative oxygen adsorption. Novices typically collect all possible directions (e.g., right,
up, left, down) and then define this process for each direction. However, this approach may be
incorrect depending on how the rate constant value was defined. If the rate constant represents a
net rate for adsorption/desorption from a pair of sites (from an average or from a single
transition state that bridges two sites), then the right, up, left, down procedures will result in
`double counting`. This is because, for example, ``adsorption_up`` is the same process as
``adsorption_down``, just executed from one site above or below. To address this issue, one can
compensate by dividing each adsorption and desorption rate constant by 2. Alternatively, one can
avoid double counting by only defining geometrically equivalent sites once per unit cell: a simple
trick to achieve this is to only consider processes in the `positive` directions, for example.
However, it's crucial to recognize that in cases where there are two transition state
possibilities (one above each site) due to a heterolytic cleavage transition state, it's essential
to acknowledge and include both processes. These processes should not be dismissed as `double
counting` because they represent distinct pathways with unique transition states sharing the same
reactants and products.
Most rate constants in the literature for dissociative adsorption are defined as an average for
the two sites, or involve a single homolytic transition state, and thus most cases of dissociative
adsorption should have a single process between up and down as well as between left and right
(yielding two processes, not four, for a simple cubic system).
Taking It Home
^^^^^^^^^^^^^^^
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment