Skip to content

VULCAN online chemical kinetics calculations#596

Open
ipanagiotou02 wants to merge 10 commits intomainfrom
ip_vulcan
Open

VULCAN online chemical kinetics calculations#596
ipanagiotou02 wants to merge 10 commits intomainfrom
ip_vulcan

Conversation

@ipanagiotou02
Copy link
Contributor

Description

(This is a draft PR; copied comment from Issue #6)
In the branch ip_vulcan, the online calculation has been implemented such that it calls VULCAN at every loop (as of now). It creates a vulcan.csv file at every snapshot corresponding to the .nc file of the same time. For example, if the file 66097_atm.nc is created in the data directory, vulcan_66097.csv is created in the offchem directory. This is still a post-processing approach, but it occurs at every snapshot instead of just at the end.

From my project, I knew that a simulation with orbit.semimajoraxis = 0.0316 and outgas.fO2_shift_IW = -4.0 converges relatively quickly (required 29 minutes), so I used it as an initial test. The results are shown below:

fc_vs_vulcan_vmr_fo2-4_1000inst

A few issues/remarks to make are the following:

  • Time: VULCAN's runtime can range from 10 minutes to more than 1 hour, depending on the number of steps it needs to converge. In most cases, convergence is difficult to achieve, and it takes all 30,000 steps to run. This adds a lot of time for a simulation run (the above case went from 29 minutes to 5.29 hours).

  • Memory: due to the above, VULCAN greatly increases the size of the proteus_00.log file (from 650 KB to 22 MB). Additionally, each additional .csv file adds 650 KB, and each additional .pkl file adds 5 MB. The example simulation produced 29 of these files times 2 for each, increasing the total simulation memory by 160 MB. For the all_options case, a run with 6 GB allowed the simulation to run for 63 loops and produce 57 vulcan.csv files/snapshots, but without converging. Here is the result up to the point it ran:

fc_vs_vulcan_vmr_all_options

Any feedback that you have is appreciated!

Checklist

  • I have followed the contributing guidelines
  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • My changes generate no new warnings or errors
  • I have checked that the tests still pass on my computer
  • I have updated the docs, as appropriate
  • I have added tests for these changes, as appropriate
  • I have checked that all dependencies have been updated, as required

Relevant people

@timlichtenberg @nichollsh @shami-EEG

@ipanagiotou02 ipanagiotou02 requested a review from a team as a code owner January 26, 2026 17:27
Copy link
Member

@nichollsh nichollsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests are failing because the run_chemistry function is returning None rather than the Pandas DataFrame of mixing ratios. See comment below about avoiding test regression for offline chemistry, and adding new test for online chemistry.

Also the code style check is failing, just because of some whitespace discrepancies. Also should be easy to fix.

Are the offline/online/manual chemistry 'modes' described in the documentation anywhere? The docs should also briefly explain these differences and their reasons for other users.

In principle these changes look good. Should be easy to fix, and would then be ready to be merged into main :)

run_vulcan_online(dirs, config, hf_row)
return None

return read_result(dirs["output"], module)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is currently expected to return the output dataframe from the final VULCAN iteration. The tests are failing because nothing is returned from this function.

I would suggest making changes to this code which retain the existing offline chemistry functionality. Then, add an additional test which runs the online chemistry routine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Online chemical kinetics calculations

2 participants