Skip to content

Commit

Permalink
added initial reaction rates, need to verify
Browse files Browse the repository at this point in the history
  • Loading branch information
eadlg2 committed Mar 3, 2024
1 parent a9b0781 commit 3adbc51
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/box_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,16 @@ def readFromJson(self, path_to_json):

species_concentrations.append(SpeciesConcentration(species, concentration))

# TODO: Add reaction rates
# TODO: verify reaction rates
reaction_rates = []

for reaction in data['initial conditions']:
match = filter(lambda x: x.name == reaction.split('.')[1], reactions)
reaction = next(match, None)

rate = data['initial conditions'][reaction]

reaction_rates.append(ReactionRate(reaction, rate))

self.initial_conditions = Conditions(pressure, temperature, species_concentrations, reaction_rates)

Expand All @@ -405,9 +412,8 @@ def readFromJson(self, path_to_json):
if 'ENV.temperature.K' in headers:
temperature = float(evol_from_json[i][headers.index('ENV.temperature.K')])

# TODO: make sure species concentrations and reaction rates handle all cases
concentrations = []
concentration_headers = list(filter(lambda x: 'molm-3' in x, headers))
concentration_headers = list(filter(lambda x: 'CONC' in x, headers))
for j in range(len(concentration_headers)):
match = filter(lambda x: x.name == concentration_headers[j].split('.')[1], species_from_json)
species = next(match, None)
Expand Down

0 comments on commit 3adbc51

Please sign in to comment.