Skip to content

Commit

Permalink
feat: make arrhenius equation variables accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Hartmann committed Mar 21, 2024
1 parent 548adf8 commit dfbca12
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
25 changes: 24 additions & 1 deletion src/homolysis/kimmdy-yaml-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,36 @@
"enum": ["rfkmc", "frm", "extrande", "extrande_mod"],
"default": "rfkmc"
},

"check_bound": {
"type": "boolean",
"pytype": "bool",
"description": "Check the topology for bonds between plumed atom pairs",
"default": false
},
"arrhenius_equation": {
"title": "arrhenius_equation",
"type": "object",
"description": "For setting values in the arrhenius equation",
"properties": {
"frequency_factor": {
"type": "float",
"description": "Frequency factor",
"pytype": "float",
"minimum": 0,
"default": 0.288
},
"temperature": {
"type": "float",
"description": "Temperature",
"pytype": "float",
"minimum": 0,
"default": 300
}
},
"required": [ "frequency_factor", "temperature" ],
"additionalProperties": false
}

},
"required": [ "edis", "itp" ]
}
Expand Down
4 changes: 3 additions & 1 deletion src/homolysis/reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def get_recipe_collection(self, files: TaskFiles):
# Initialization of filepaths
files.input["itp"] = self.config.itp
files.input["edis"] = self.config.edis
frequency_factor = self.config.arrhenius_equation.frequency_factor
temperature = self.config.arrhenius_equation.temperature

# Initialization of objects from files
distances = read_distances_dat(files.input["plumed_out"])
Expand Down Expand Up @@ -78,7 +80,7 @@ def get_recipe_collection(self, files: TaskFiles):
# f"plumedid: {plumedid}, atomids: {atomnrs}, atomtypes: {atomtypes}, b0: {b0}, kb: {kb}, E_dis: {E_dis}"
# )

k_avg, _ = morse_transition_rate([sum(dists) / len(dists)], b0, E_dis, kb)
k_avg, _ = morse_transition_rate([sum(dists) / len(dists)], b0, E_dis, kb,frequency_factor,temperature)
# averaging distances works here because we typically have
# one conformational state per calculation

Expand Down
12 changes: 6 additions & 6 deletions tests/test_default_reactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ def test_morse_transition_rate(homolysis_files):
[
0.00000000e00,
0.00000000e00,
5.79066994e-41,
2.51010748e-11,
3.59809866e-03,
2.17080461e-01,
2.88000000e-01,
2.88000000e-01,
1.01587680e-40,
2.89436858e-11,
3.69638684e-03,
2.17458162e-01,
2.88000000e-01,
2.88000000e-01
]
)
fs_ref = np.asarray(
Expand Down

0 comments on commit dfbca12

Please sign in to comment.