From dfbca121dfce321c93d3ebb166ee91f33358ddb9 Mon Sep 17 00:00:00 2001 From: Eric Hartmann Date: Thu, 21 Mar 2024 18:12:23 +0100 Subject: [PATCH] feat: make arrhenius equation variables accessible --- src/homolysis/kimmdy-yaml-schema.json | 25 ++++++++++++++++++++++++- src/homolysis/reaction.py | 4 +++- tests/test_default_reactions.py | 12 ++++++------ 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/homolysis/kimmdy-yaml-schema.json b/src/homolysis/kimmdy-yaml-schema.json index e317996..9ee6230 100644 --- a/src/homolysis/kimmdy-yaml-schema.json +++ b/src/homolysis/kimmdy-yaml-schema.json @@ -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" ] } diff --git a/src/homolysis/reaction.py b/src/homolysis/reaction.py index 299f13c..9a3b2e7 100644 --- a/src/homolysis/reaction.py +++ b/src/homolysis/reaction.py @@ -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"]) @@ -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 diff --git a/tests/test_default_reactions.py b/tests/test_default_reactions.py index 775221d..bc5f4d1 100644 --- a/tests/test_default_reactions.py +++ b/tests/test_default_reactions.py @@ -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(