Skip to content

Conversation

@davidfarinajr
Copy link
Contributor

@davidfarinajr davidfarinajr commented May 31, 2021

Motivation or Problem

Some surface reaction families have training data with mixed kinetics types (SurfaceArrhenius and StickingCoeff). We need methods to convert SurfaceArrhenius to StickingCoeff and vice versa so that we can convert the training data to the same kinetics type so that we can average them.

Description of Changes

  • created methods to convert StickingCoeff to SurfaceArrhneius and SurfaceArrhenius to StickingCoeff
  • added a check to make sure that the kinetics types are all the same when averaging kinetics

Testing

@Tingchenlee
Copy link
Contributor

I also ran a test(which included CH4, NH3, and O2species) with all new libraries and surface families, and the model was completed.

@codecov
Copy link

codecov bot commented May 31, 2021

Codecov Report

Merging #2148 (46141b1) into master (336273d) will increase coverage by 0.05%.
The diff coverage is 60.00%.

❗ Current head 46141b1 differs from pull request most recent head bc78dbb. Consider uploading reports for the commit bc78dbb to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2148      +/-   ##
==========================================
+ Coverage   47.84%   47.89%   +0.05%     
==========================================
  Files         102      102              
  Lines       27120    27069      -51     
  Branches     6958     6946      -12     
==========================================
- Hits        12976    12966      -10     
+ Misses      12753    12716      -37     
+ Partials     1391     1387       -4     
Impacted Files Coverage Δ
rmgpy/data/kinetics/rules.py 49.87% <60.00%> (-0.13%) ⬇️
rmgpy/data/kinetics/library.py 41.52% <0.00%> (-0.83%) ⬇️
rmgpy/data/solvation.py 56.92% <0.00%> (-0.46%) ⬇️
rmgpy/rmg/main.py 22.51% <0.00%> (-0.11%) ⬇️
rmgpy/data/kinetics/family.py 47.38% <0.00%> (-0.01%) ⬇️
arkane/kinetics.py 12.24% <0.00%> (ø)
rmgpy/molecule/filtration.py 88.33% <0.00%> (+0.13%) ⬆️
rmgpy/rmg/input.py 41.26% <0.00%> (+0.25%) ⬆️
arkane/encorr/bac.py 75.77% <0.00%> (+0.47%) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 336273d...bc78dbb. Read the comment docs.

@rwest
Copy link
Member

rwest commented Jun 4, 2021

These are useful methods to have, to convert back and forth, and we should keep them, but I feel like training reactions should all be in the same format in the database, and the person adding them to the database should convert at that point, rather than when loading the database at run time. This will greatly simplify the averaging, and the interpretation of averaging, and Matt's auto tree generation, etc.

So I suggest a unit test added to the database checks to ensure all training reactions in adsorption reaction families are in StickingCoefficient form (and perhaps prints the helpful conversion in the error report if it's in SurfaceArrhenius, to facilitate changing it). It could also warn you if the converted value exceeds 1.0 at some temperatures.

@rwest
Copy link
Member

rwest commented Jun 4, 2021

Worth checking we do this: things entered in the reverse direction (i.e. desorption) will be a SurfaceArrhenius with units of 1/s. These will need converting into a StickingCoefficient, not just a reversed SurfaceArrhenius.

@davidfarinajr davidfarinajr requested a review from mazeau June 24, 2021 17:46
Copy link
Contributor

@mazeau mazeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! I just am not a fan of the hard coded stuff

elif isinstance(data, SurfaceArrhenius):
if has_sticking_coeff:
if surface_site_density is None:
surface_site_density = 2.483e-09
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think instead of having this hard coded in, you should load it from the metal database

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't remember what the units are in the db, so this might affect your reaction.py additions

data = SurfaceArrheniusBEP(
if has_sticking_coeff:
if surface_site_density is None:
surface_site_density = 2.483e-09
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here as well

@davidfarinajr davidfarinajr removed the Status: WIP This is currently work-in-progress label Jul 15, 2021
ChrisBNEU
ChrisBNEU previously approved these changes Jul 15, 2021
Copy link
Contributor

@ChrisBNEU ChrisBNEU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some nitpicky comments, but these two new functions are tools that are not used in the main RMG model building code, so I think it is good to go.

if adsorbate is None:
adsorbate = r
else:
logging.error("Error in kinetics for reaction {0!s}: "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpicky, but do we have adsorption reactions that have multiple adsorbates? I think this is really testing if the reaction is the correct type (i.e. adsorption). maybe the text could say "multiple adsorbates detected, reaction probably isn't adsorption"?

sticking_coefficient = self.kinetics.get_rate_coefficient(Tlist[i])
sticking_coefficient /= math.sqrt(constants.kB * Tlist[i] / (2 * math.pi * molecular_weight_kg))
klist[i] = sticking_coefficient
for i in range(number_of_sites):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpicky, but this could just be klist *= surface_site_density**number_of_sites.

@davidfarinajr davidfarinajr changed the base branch from master to main October 1, 2021 17:39
@github-actions
Copy link

This pull request is being automatically marked as stale because it has not received any interaction in the last 90 days. Please leave a comment if this is still a relevant pull request, otherwise it will automatically be closed in 30 days.

@github-actions github-actions bot added the stale stale issue/PR as determined by actions bot label Jun 21, 2023
@github-actions github-actions bot added the abandoned abandoned issue/PR as determined by actions bot label Jul 23, 2023
@github-actions github-actions bot closed this Jul 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

abandoned abandoned issue/PR as determined by actions bot stale stale issue/PR as determined by actions bot Topic: Catalysis Topic: Kinetics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants