Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electrochemistry! (finally) a.k.a. RMG-electrocat #2598

Merged
merged 109 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
4106219
Add reaction library to test example for liquidSurfaceReactor
mjohnson541 Sep 4, 2021
be8b9a7
added Faraday's Constant and vacuum permittivity
davidfarinajr May 12, 2021
b79efe8
added Potential as `V` quantity
davidfarinajr May 12, 2021
900d9e6
added `H+` and `e` atomtypes and increment/decrement charge attributes
davidfarinajr May 12, 2021
1f54116
Added increment_charge and decrement_charge to Rx
ssun30 Mar 29, 2024
b4f0e4b
added `gain_charge` and `lose_charge` actions
davidfarinajr May 12, 2021
f2dcafd
added `is_proton` and `is_electron` methods
davidfarinajr May 12, 2021
5160292
added updated charge method and revised `update` Molecule method
davidfarinajr May 12, 2021
a2537c4
added `get_net_charge` method for Species
davidfarinajr May 12, 2021
8241d42
do not raise charge exception by default
davidfarinajr May 12, 2021
82fb9b1
try to generate_resonance_structures, and return a deep copy of the m…
davidfarinajr May 12, 2021
4dbb61a
added molecule.pxd declarations
davidfarinajr May 12, 2021
118271a
do not forbid ions
davidfarinajr May 12, 2021
e271046
added `SurfaceChargeTransfer` and `SurfaceChargeTransferBEP` kinetic …
davidfarinajr May 12, 2021
67fe9f2
making rules for SurfaceChargeTransfer training reactions
davidfarinajr May 12, 2021
5ae918a
added `electrons` reaction attr and reaction methods for charge trans…
davidfarinajr May 12, 2021
476a714
adding charged species and electrons to family.py
davidfarinajr May 12, 2021
90ff67b
added group unit tests
davidfarinajr May 12, 2021
1924cc2
added Molecule unit tests
davidfarinajr May 12, 2021
9bf64aa
added reaction tests for charge transfer reactions
davidfarinajr May 12, 2021
6b1585d
added family test for `Surface_Proton_Electron_Reduction_Alpha` family
davidfarinajr May 12, 2021
21a09c2
update charge before updating lone pairs for solvation `transform_lon…
davidfarinajr May 12, 2021
4266462
update_atomtypes -> update in translator.py
davidfarinajr May 12, 2021
4b934ce
added `adsorption_groups` attr to thermoDB
davidfarinajr Sep 2, 2021
bfd9f5a
added fluorine to thermo `correct_binding_energy` method
davidfarinajr Sep 2, 2021
341601e
added Li/Li0/Li+ atomtype
mjohnson541 Oct 4, 2021
0a2f429
add LiH and LiF to atom energy corrections fitting species list
mjohnson541 Oct 4, 2021
cc059ad
handle SurfaceChargeTransfer in to_rms
mjohnson541 Oct 8, 2021
e3344f5
filter out resonance structures that try to put - charges on Li
mjohnson541 Dec 7, 2021
8e855e6
ensure atomtypes get updated on loading in thermo entries
mjohnson541 Jan 11, 2022
b03dd98
add solute data to KineticsModel and Arrhenius
mjohnson541 Jan 11, 2022
d03c9b0
add index of refraction to SolventData objects
mjohnson541 Sep 9, 2022
42c96a7
added ArrheniusChargeTransfer kinetics type
mjohnson541 Jan 11, 2022
cf1e222
added ArrheniusChargeTransferBM type
mjohnson541 Jan 11, 2022
a490666
add ChargeTransfer types to kinetics/__init__.py
mjohnson541 Jan 11, 2022
a3bf771
handle ChargeTransfer kinetics with in reaction.py
mjohnson541 Jan 11, 2022
1ee3cf0
handle ArrheniusChargeTransfer => Arrheniusq
mjohnson541 Jun 18, 2022
7cba511
add charge transfer types to database context
mjohnson541 Jan 11, 2022
81c6996
enable use of non-surface charge transfer families
mjohnson541 Jan 11, 2022
b207876
enable surface and bulk potentials to be specified separately
mjohnson541 Jan 11, 2022
c9343c2
avoid issue with auto decay reactions
mjohnson541 Jan 11, 2022
eaf8fc6
Added Charge Transfer types to average_kinetics
rwest Jul 17, 2023
226af17
update rule fitting
mjohnson541 Jan 11, 2022
c870e52
Allow approximating a solvent not in the database with another solvent
mjohnson541 Feb 28, 2022
4374232
standardize ascend option in cross validate
mjohnson541 Jan 11, 2022
d012688
Average kinetics when n=1 or E0<0*
mjohnson541 Feb 28, 2022
34631b4
fix BM fitting
mjohnson541 Feb 28, 2022
f58e7d5
add functions for solvent correcting kinetics
mjohnson541 Jun 18, 2022
a4cb1d4
add functionality for site specific solvent corrections
mjohnson541 Jun 18, 2022
63ea35d
apply_solvent_correction in fix_barrier_height
mjohnson541 Jun 18, 2022
9a00ce1
enable solvent parameters to be directly specified in input file
mjohnson541 Jun 18, 2022
d6810aa
fix KineticsModel outputs
mjohnson541 Jan 9, 2023
0f6ab88
add SoluteTSData object
mjohnson541 Jan 9, 2023
e35980c
add SoluteTSDIffData object
mjohnson541 Jan 9, 2023
a9e29bf
add function to convert SoluteData and SoluteTSDiffData to SoluteTSData
mjohnson541 Jan 9, 2023
5196b53
Enable LibraryReaction to handle SoluteTSData
mjohnson541 Jan 9, 2023
2b6ce7e
Enable TemplateReaction to handle new TS solvent corrections
mjohnson541 Jan 9, 2023
3b73ed8
Enable database to understand new objects
mjohnson541 Jan 9, 2023
cc7d620
only use kinetics that have arrhenius forms for tree generation
mjohnson541 Jan 9, 2023
1f9cc40
enable solute data to be pulled from further up the tree as necessary
mjohnson541 Jan 9, 2023
605d92d
enable fitting of TS solute rules
mjohnson541 Jan 9, 2023
1afbe5e
allow training reaction notebook to handle reactions without gas phas…
mjohnson541 Jan 9, 2023
e94af50
added arrhenius test
mjohnson541 May 7, 2023
d1dd0fb
Fix ArrheniusBM.get_activation_energy unit test.
rwest Jul 18, 2023
2e41f01
modifed arrbm `fit_to_data` unit test
davidfarinajr Jan 18, 2022
de545c0
handle charge properly in fragment smiles hack
mjohnson541 May 7, 2023
70659ab
skip nodes that are empty when pulling solute data
mjohnson541 May 7, 2023
3faaf7f
update product template after generation
mjohnson541 May 9, 2023
aecd710
add Li adsorption to test data
ssun30 Nov 6, 2024
79fc764
don't check collision limit for reactions without kinetics
mjohnson541 Jun 3, 2023
1a7175d
fix charge handling in make sample molecule
mjohnson541 Jun 10, 2023
aa88c7e
Refactor some rate fitting in rule generation.
rwest Jul 17, 2023
4dad2b7
Minor refactor.
rwest Jul 18, 2023
b187f35
Consistently use T=298. K for fitting and evaluating Blowers-Masel ra…
rwest Jul 18, 2023
3e3316e
Fixes and tweaks to Blowers Masel classes' fit_to_reactions methods.
rwest Jul 18, 2023
236f4bc
allow `cat` of regression diff to fail, print a warning instead
JacksonBurns Jul 28, 2023
699143e
combine the messy Cython declarations (and remove dupes) in reaction.py
JacksonBurns Feb 1, 2024
fecd202
Ported all echem-related unit tests to new style
JacksonBurns Feb 1, 2024
f9d8bf9
skip a test in solvation
JacksonBurns Feb 1, 2024
4199606
add missing kwarg to fragment update method
JacksonBurns Feb 1, 2024
a14d22b
Fixed some tests from bad automated conversions
JacksonBurns Feb 1, 2024
6634774
enable fitting of TS solute rules
mjohnson541 Jan 9, 2023
cadb334
allow inclusion of refractive index in Solvent object
mjohnson541 Dec 8, 2023
a52274a
change TS solvation handling to new system
mjohnson541 Dec 8, 2023
e6bd498
added Marcus kinetics
mjohnson541 Mar 10, 2024
21c960f
allow direct specification of viscosity and electrode distance for th…
mjohnson541 Mar 10, 2024
d339918
handle electronchange when constructing RMS objects
mjohnson541 Mar 10, 2024
f4fa9bf
handle Marcus in RMS yaml constructionn
mjohnson541 Mar 10, 2024
54ea6e3
handle Marcus kinetics in fix_barrier_height
mjohnson541 Mar 10, 2024
2fcea6d
handle solvation for Marcus kinetics
mjohnson541 Mar 10, 2024
7051f57
handle kinetics averaging for Marcus
mjohnson541 Mar 10, 2024
1d1cd1c
handle Marcus kinetics within tree generation and rule generation
mjohnson541 Mar 10, 2024
f34cb2d
add ethylene carbonate and acetonitrile SEI examples
mjohnson541 Mar 10, 2024
f9c1988
fix bug with species initialization
mjohnson541 Mar 10, 2024
5286c95
Fixed a typo in test lose charge
ssun30 Mar 15, 2024
ce4f3e1
Add set_reference_potential for SurfaceChargeTransfer
ssun30 Apr 12, 2024
e1169c9
Set reference potential now always sets to 300 K
ssun30 Nov 6, 2024
69f4ee1
Fixed A-factor correction for SurfaceChargeTransfer
ssun30 Nov 6, 2024
4652101
Added CO2RR example
ssun30 Jun 7, 2024
b71fbce
Extra error logging in HBI thermo estimation.
rwest May 3, 2024
3d7cea1
Ignore PCET vdW families for surface coverage test
ssun30 Sep 25, 2024
f2f0cbd
Changed rate coefficient test to use rtol
ssun30 Sep 25, 2024
27449c4
update_charge skips cutting labels
ssun30 Nov 6, 2024
7ec54b2
Fixed Fragment test
ssun30 Nov 6, 2024
e304a89
Changed RMS branch to for_rmg
ssun30 Oct 25, 2024
3688144
Use the lithium_rebase branch of RMG-database for CI
ssun30 Nov 24, 2024
53059fe
fixup! enable use of non-surface charge transfer families
rwest Nov 24, 2024
aca0b34
Small efficiency gain checking for charged species.
rwest Nov 24, 2024
0e524a2
Switch back to using main branch of RMG-database
rwest Nov 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ jobs:
timeout-minutes: 120 # this usually takes 20-45 minutes (or hangs for 6+ hours).
run: |
python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()"
julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main")); using ReactionMechanismSimulator'
julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="for_rmg")); using ReactionMechanismSimulator'

- name: Install Q2DTor
run: echo "" | make q2dtor
Expand Down Expand Up @@ -296,7 +296,7 @@ jobs:
export FAILED=Yes
fi
echo "" # blank line so next block is interpreted as markdown
cat "$regr_test-core.log"
cat "$regr_test-core.log" || (echo "Dumping the whole log failed, please download it from GitHub actions. Here are the first 100 lines:" && head -n100 "$regr_test-core.log")
echo "</details>"
echo "<details>"
if python-jl scripts/checkModels.py \
Expand All @@ -313,7 +313,7 @@ jobs:
export FAILED=Yes
fi
echo "" # blank line so next block is interpreted as markdown
cat "$regr_test-edge.log"
cat "$regr_test-edge.log" || (echo "Dumping the whole log failed, please download it from GitHub actions. Here are the first 100 lines:" && head -n100 "$regr_test-core.log")
echo "</details>"

# Check for Regression between Reference and Dynamic (skip superminimal)
Expand Down Expand Up @@ -405,3 +405,5 @@ jobs:
with:
push: true
tags: reactionmechanismgenerator/rmg:latest
build-args: |
RMS_Branch=for_rmg
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
timeout-minutes: 120 # this usually takes 20-45 minutes (or hangs for 6+ hours).
run: |
python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()"
julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main")); using ReactionMechanismSimulator'
julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="for_rmg")); using ReactionMechanismSimulator'

- name: Checkout gh-pages Branch
uses: actions/checkout@v2
Expand Down
5 changes: 4 additions & 1 deletion arkane/encorr/ae.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@
'Methane',
'Methyl',
'Ammonia',
'Chloromethane'
'Chloromethane',
# Lithium species shall be uncommented after we reconcile the difference in AECs and BACs
# 'Lithium Hydride',
# 'Lithium Fluoride'
]


Expand Down
2 changes: 1 addition & 1 deletion arkane/encorr/bac.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class BAC:
ref_databases = {}
atom_spins = {
'H': 0.5, 'C': 1.0, 'N': 1.5, 'O': 1.0, 'F': 0.5,
'Si': 1.0, 'P': 1.5, 'S': 1.0, 'Cl': 0.5, 'Br': 0.5, 'I': 0.5
'Si': 1.0, 'P': 1.5, 'S': 1.0, 'Cl': 0.5, 'Br': 0.5, 'I': 0.5, 'Li': 0.5,
}
exp_coeff = 3.0 # Melius-type parameter (Angstrom^-1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Installation by Source Using Anaconda Environment for Unix-based Systems: Linux

#. Install and Link Julia dependencies: ::

julia -e 'using Pkg; Pkg.add("PyCall");Pkg.build("PyCall");Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main")); using ReactionMechanismSimulator;'
julia -e 'using Pkg; Pkg.add("PyCall");Pkg.build("PyCall");Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="for_rmg")); using ReactionMechanismSimulator;'

python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()"

Expand Down
317 changes: 317 additions & 0 deletions examples/rmg/CO2RR/input.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,317 @@
# Data sources
database(
thermoLibraries=['surfaceThermoPt111', 'primaryThermoLibrary', 'thermo_DFT_CCSDTF12_BAC','DFT_QCI_thermo', 'electrocatThermo',
# 'CO2RR_Adsorbates_Ag111'
],
reactionLibraries = [('Surface/CPOX_Pt/Deutschmann2006_adjusted', False)],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = ['electrochem',
# 'surface',
'Surface_Abstraction',
'Surface_Abstraction_vdW',
'Surface_Abstraction_Single_vdW',
'Surface_Abstraction_Beta_double_vdW',
'Surface_Adsorption_Dissociative',
'Surface_Adsorption_Dissociative_Double',
'Surface_Adsorption_vdW',
'Surface_Dissociation',
'Surface_Dissociation_Double_vdW',
'Surface_Dissociation_vdW',
'Surface_EleyRideal_Addition_Multiple_Bond',
'Surface_Migration',
],
kineticsEstimator = 'rate rules',

)

catalystProperties(
metal = 'Ag111'
)

# List of species
species(
label='CO2',
reactive=True,
structure=adjacencyList(
"""
1 O u0 p2 c0 {2,D}
2 C u0 p0 c0 {1,D} {3,D}
3 O u0 p2 c0 {2,D}
"""),
)


species(
label='proton',
reactive=True,
structure=adjacencyList(
"""
1 H u0 p0 c+1
"""),
)

species(
label='vacantX',
reactive=True,
structure=adjacencyList("1 X u0"),
)

species(
label='H',
reactive=True,
structure=adjacencyList(
"""
1 H u1 p0 c0
"""),
)

species(
label='CO2X',
reactive=True,
structure=adjacencyList("""
1 O u0 p2 c0 {3,D}
2 O u0 p2 c0 {3,D}
3 C u0 p0 c0 {1,D} {2,D}
4 X u0 p0 c0
"""),
)

species(
label='CHO2X',
reactive=True,
structure=adjacencyList("""
1 O u0 p2 c0 {3,S} {5,S}
2 O u0 p2 c0 {3,D}
3 C u0 p0 c0 {1,S} {2,D} {4,S}
4 H u0 p0 c0 {3,S}
5 X u0 p0 c0 {1,S}
"""),
)

species(
label='CO2HX',
reactive=True,
structure=adjacencyList("""
1 O u0 p2 c0 {2,S} {4,S}
2 C u0 p0 c0 {1,S} {3,D} {5,S}
3 O u0 p2 c0 {2,D}
4 H u0 p0 c0 {1,S}
5 X u0 p0 c0 {2,S}

"""),
)

species(
label='OCX',
reactive=True,
structure=adjacencyList("""
1 O u0 p2 c0 {2,D}
2 C u0 p0 c0 {1,D} {3,D}
3 X u0 p0 c0 {2,D}
"""),
)

species(
label='OX',
reactive=True,
structure=adjacencyList("""
1 O u0 p2 c0 {2,D}
2 X u0 p0 c0 {1,D}
"""),
)

species(
label='CH2O2X',
reactive=True,
structure=adjacencyList("""
1 O u0 p2 c0 {3,S} {5,S}
2 O u0 p2 c0 {3,D}
3 C u0 p0 c0 {1,S} {2,D} {4,S}
4 H u0 p0 c0 {3,S}
5 H u0 p0 c0 {1,S}
6 X u0 p0 c0
"""),
)

species(
label='CHOX',
reactive=True,
structure=adjacencyList("""
1 O u0 p2 c0 {2,D}
2 C u0 p0 c0 {1,D} {3,S} {4,S}
3 H u0 p0 c0 {2,S}
4 X u0 p0 c0 {2,S}
"""),
)

species(
label='CH2OX',
reactive=True,
structure=adjacencyList("""
1 O u0 p2 c0 {2,D}
2 C u0 p0 c0 {1,D} {3,S} {4,S}
3 H u0 p0 c0 {2,S}
4 H u0 p0 c0 {2,S}
5 X u0 p0 c0
"""),
)


forbidden(
label='CO2-bidentate',
structure=adjacencyList(
"""
1 O u0 p2 c0 {2,D}
2 C u0 p0 c0 {1,D} {3,S} {4,S}
3 X u0 p0 c0 {2,S}
4 O u0 p2 c0 {2,S} {5,S}
5 X u0 p0 c0 {4,S}
"""
)
)

liquidSurfaceReactor(
temperature=(300,'K'),
liqPotential=(0,'V'),
surfPotential=(-2.0,'V'),
initialConcentrations={
"CO2": (1e-3,'mol/cm^3'),
"proton": (1e-4,'mol/m^3'),
},
initialSurfaceCoverages={
# "HX": 0.5,
# # "CXO2": 0.0,
"CHO2X": 0.1,
"CO2HX": 0.1,
"vacantX": 0.1,
"CO2X": 0.4,
'OX': 0.1,
'OCX': 0.1,
'CH2O2X': 0.05,
'CHOX': 0.04,
'CH2OX': 0.01
},
surfaceVolumeRatio=(1.0e5, 'm^-1'),
terminationTime=(1.0e3,'sec'),
# terminationConversion={'CO2': 0.90},
# constantSpecies=["proton"],
)

liquidSurfaceReactor(
temperature=(300,'K'),
liqPotential=(0,'V'),
surfPotential=(-1.5,'V'),
initialConcentrations={
"CO2": (1e-3,'mol/cm^3'),
"proton": (1e-4,'mol/m^3'),
},
initialSurfaceCoverages={
# "HX": 0.5,
# # "CXO2": 0.0,
"CHO2X": 0.1,
"CO2HX": 0.1,
"vacantX": 0.1,
"CO2X": 0.4,
'OX': 0.1,
'OCX': 0.1,
'CH2O2X': 0.05,
'CHOX': 0.04,
'CH2OX': 0.01
},
surfaceVolumeRatio=(1.0e5, 'm^-1'),
terminationTime=(1.0e3,'sec'),
# terminationConversion={'CO2': 0.90},
# constantSpecies=["proton"],
)

liquidSurfaceReactor(
temperature=(300,'K'),
liqPotential=(0,'V'),
surfPotential=(-1.0,'V'),
initialConcentrations={
"CO2": (1e-3,'mol/cm^3'),
"proton": (1e-4,'mol/m^3'),
},
initialSurfaceCoverages={
# "HX": 0.5,
# # "CXO2": 0.0,
"CHO2X": 0.1,
"CO2HX": 0.1,
"vacantX": 0.1,
"CO2X": 0.4,
'OX': 0.1,
'OCX': 0.1,
'CH2O2X': 0.05,
'CHOX': 0.04,
'CH2OX': 0.01
},
surfaceVolumeRatio=(1.0e5, 'm^-1'),
terminationTime=(1.0e3,'sec'),
# terminationConversion={'CO2': 0.90},
# constantSpecies=["proton"],
)

# liquidSurfaceReactor(
# temperature=(300,'K'),
# liqPotential=(0,'V'),
# surfPotential=(-0.5,'V'),
# initialConcentrations={
# "CO2": (1e-3,'mol/cm^3'),
# "proton": (1e-4,'mol/m^3'),
# },
# initialSurfaceCoverages={
# # "HX": 0.5,
# # # "CXO2": 0.0,
# "CHO2X": 0.1,
# "CO2HX": 0.1,
# "vacantX": 0.1,
# "CO2X": 0.4,
# 'OX': 0.1,
# 'OCX': 0.1,
# 'CH2O2X': 0.05,
# 'CHOX': 0.04,
# 'CH2OX': 0.01
# },
# surfaceVolumeRatio=(1.0e5, 'm^-1'),
# terminationTime=(1.0e3,'sec'),
# # terminationConversion={'CO2': 0.90},
# # constantSpecies=["proton"],
# )

solvation(
solvent='water'
)

simulator(
atol=1e-16,
rtol=1e-8,
)

model(
toleranceKeepInEdge=1E-16,
toleranceMoveToCore=1E-3,
toleranceRadMoveToCore=1E-6,
toleranceInterruptSimulation=1E6,
filterReactions=False,
maximumEdgeSpecies=5000,
toleranceBranchReactionToCore=1E-6,
branchingIndex=0.5,
branchingRatioMax=1.0,
)

options(
units='si',
generateOutputHTML=True,
generatePlots=True,
saveEdgeSpecies=True,
saveSimulationProfiles=False,
)

generatedSpeciesConstraints(
allowed=['input species','reaction libraries'],
maximumSurfaceSites=2,
maximumCarbonAtoms=3,
maximumOxygenAtoms=2,
maximumRadicalElectrons=1,
)
Loading
Loading