Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created a new reactor type MBSampledReactor for modeling laser lab Mass-Spec experiments #1669

Merged
merged 3 commits into from
Aug 5, 2019

Conversation

jimchu10
Copy link

Motivation or Problem

To model the sampling delay in mass-spec of Green group laser apparatus, it is important to generate a new reactor type.

Description of Changes

New reactor type added, and can be used in simulate.py

Testing

The MBSampledReactor added works same as what it was before rebase on master. Same time-dependent concentration for species by giving same input files

Reviewer Tips

@jimchu10 jimchu10 requested a review from mliu49 July 24, 2019 22:17
@codecov
Copy link

codecov bot commented Jul 25, 2019

Codecov Report

Merging #1669 into master will increase coverage by 0.11%.
The diff coverage is 77.94%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1669      +/-   ##
==========================================
+ Coverage   41.75%   41.87%   +0.11%     
==========================================
  Files         176      177       +1     
  Lines       29423    29490      +67     
  Branches     6075     6097      +22     
==========================================
+ Hits        12286    12349      +63     
- Misses      16261    16262       +1     
- Partials      876      879       +3
Impacted Files Coverage Δ
rmgpy/tools/data/sim/mbSampled/input.py 100% <100%> (ø)
rmgpy/rmg/input.py 37.94% <69.76%> (+2.55%) ⬆️
rmgpy/tools/loader.py 43.75% <87.5%> (+6.25%) ⬆️
rmgpy/data/kinetics/family.py 52.9% <0%> (+0.23%) ⬆️
rmgpy/tools/plot.py 46.51% <0%> (+0.58%) ⬆️
rmgpy/tools/simulate.py 77.35% <0%> (+5.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d66fbfe...206f149. Read the comment docs.

@mliu49
Copy link
Contributor

mliu49 commented Jul 26, 2019

I think it would make sense for MBSampledReactor to be a subclass of SimpleReactor. I compared the two, and it seemed like only the residual method was changed. Doing it this way would make it much easier to maintain.

I added a commit making this change, but have not tested it yet beyond checking that it compiled correctly. Could you run a simulation to see if this works and gives the same result as before?

@mliu49
Copy link
Contributor

mliu49 commented Aug 2, 2019

Update regarding my previous commit. Turns out that it won't work because SimpleReactor defines a jacobian method which necessarily cannot be included for MBSampledReactor.

@mliu49 mliu49 force-pushed the simulate_MB_sampled_reactor branch from 40ff482 to 0bccf72 Compare August 2, 2019 19:57
For modeling molecular beam sampling of species from an isothermal,
isobaric, homogenous batch reactor.

The sampling process is modeled as two first-order unimolecular
reactions, following the approach developed by Baeza-Romero et al., in
their 2011 IJCK paper. Currently, the new reactor is only intended for
use with the simulate.py script, after a conventional RMG mechanism has
already been made.
@mliu49 mliu49 force-pushed the simulate_MB_sampled_reactor branch from 0bccf72 to 42dae5e Compare August 4, 2019 14:36
Copy link
Member

@amarkpayne amarkpayne left a comment

Choose a reason for hiding this comment

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

I have looked over the unit test portions as requested. There is just one quick fix, but otherwise this looks good. I am about to test that the tests run properly by running locally, but go ahead and rebase with the fix squashed.

rmgpy/tools/simulateTest.py Outdated Show resolved Hide resolved
@amarkpayne
Copy link
Member

When I run the test locally, this is the plot that I get. Is this what the simulation is supposed to do?

simulation_1_30

@mliu49 mliu49 force-pushed the simulate_MB_sampled_reactor branch from 2b2fe62 to 206f149 Compare August 5, 2019 15:50
@mliu49
Copy link
Contributor

mliu49 commented Aug 5, 2019

Yeah, the concentrations are all extremely low, so they don't show up on the plot.

Copy link
Member

@amarkpayne amarkpayne left a comment

Choose a reason for hiding this comment

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

The unit test commits are approved as far as I am concerned. If the reactor commit is fine with you then this PR can be merged

Copy link
Contributor

@mliu49 mliu49 left a comment

Choose a reason for hiding this comment

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

To document offline discussion, we decided that even though the MBSampledReactor is not up to date with all of the changes to SimpleReactor, it's ok because it does not need to be used in RMG jobs. The workflow currently used is to generate an RMG model using SimpleReactor and then use MBSampledReactor to simulate and compare to the experiments.

@mliu49 mliu49 merged commit f0131fe into master Aug 5, 2019
@mliu49 mliu49 deleted the simulate_MB_sampled_reactor branch August 5, 2019 18:43
@mliu49 mliu49 mentioned this pull request Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants