Skip to content

Commit

Permalink
added reaction type prefixes in order_reaction_ratesz
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjamesgarza committed Apr 2, 2024
1 parent a858456 commit 3e59536
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/box_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,6 @@ def solve(self, path_to_output = None):

else:
next_conditions = None


#print(ordered_rate_constants)

#solves and updates concentration values in concentration array
musica.micm_solve(self.solver, self.box_model_options.chem_step_time, curr_conditions.temperature, curr_conditions.pressure, ordered_concentrations, ordered_rate_constants)
Expand Down Expand Up @@ -544,13 +541,19 @@ def userDefinedReactionRates(self):
def order_reaction_rates(self, curr_conditions, rate_constant_ordering):
rate_constants = {}
for rate in curr_conditions.reaction_rates:
rate_constants[rate.reaction.name] = rate.rate

if(rate.reaction.reaction_type == "PHOTOLYSIS"):
key = "PHOTO." + rate.reaction.name
elif(rate.reaction.reaction_type == "LOSS"):
key = "LOSS." + rate.reaction.name
elif (rate.reaction.reaction_type == "EMISSION"):
key = "EMIS." + rate.reaction.name
rate_constants[key] = rate.rate

ordered_rate_constants = len(rate_constants.keys()) * [0.0]
for key, value in rate_constants.items():

#TODO: Hardcoding photolysis prefix for now
ordered_rate_constants[rate_constant_ordering["PHOTO." + key]] = value
ordered_rate_constants[rate_constant_ordering[key]] = value
return ordered_rate_constants

@classmethod
Expand Down

0 comments on commit 3e59536

Please sign in to comment.