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

"Simple Reactor" is not isobaric - neglects dV/dt ? #110

Closed
rwest opened this issue Mar 18, 2013 · 7 comments
Closed

"Simple Reactor" is not isobaric - neglects dV/dt ? #110

rwest opened this issue Mar 18, 2013 · 7 comments

Comments

@rwest
Copy link
Member

rwest commented Mar 18, 2013

As part of our solvation corrections project, @bslakman and I were trying to figure out how to change the reactor simulations to work for liquid phase (incompressible) equation of state instead of ideal gas, but it looks like SimpleReactor has been neglecting the volume change (due to stoichiometry differences of reactions) anyway. Did we overlook something, or is this currently missing?

Example: if A <=> 2B then at a conversion of 0.5 (NA/NA0 = 0.5) for isothermal isobaric gas phase reactor, CA/CA0 = 0.5/1.5=0.333. (rxn_rate = d(VC)/dt != (dC/dt)/V)

@connie
Copy link
Member

connie commented Mar 18, 2013

If this is really the case this may solve our problem that the
concentration traces were not matching up with chemkin's solver.

@rwest
Copy link
Member Author

rwest commented Mar 22, 2013

I heard a rumour that you might want to look at this, @connie, as you have recently implemented analytical Jacobians here?...

@rwest
Copy link
Member Author

rwest commented Mar 26, 2013

I think how we resolve this may impact other parts of the code that we were beginning to look at - for example the calculation of conversion (for termination criteria and reporting) currently renormalizes by ideal gas law.
I guess my question is, should the ode solver track N concentrations (in which case we need to add the dilution term to each residual) or should it track N mole numbers and an N+1th scalar representing volume (in which case we need to calculate concentrations from mole number every time we want a rate) ?

@rwest
Copy link
Member Author

rwest commented Mar 26, 2013

Ah, I see @jwallen has just implemented something on his fork in 2224dff.
I should have looked at that first. Does this change @connie's Jacobians at all? (where are these anyway?)

@jwallen
Copy link
Contributor

jwallen commented Mar 26, 2013

Yes, I haven't pushed to official yet because we wanted to compare the new implementation against Chemkin first. I think it shouldn't be too hard to swap in the incompressible liquid equation of state for the ideal gas law when the time comes.

@connie's jacobian implementation is in the SimpleReactor.jacobian() method, which currently occupies the majority of rmgpy/solver/simple.pyx.

@rwest
Copy link
Member Author

rwest commented Mar 26, 2013

The proposal is that the ode solver vector y now represents number of moles?
Normalized so that we start with one mole total?
This may make a difference in terms of absolute precision of ode solver? I guess it's not a bad way to normalize - at least its not too hard to explain what ATOL is this way.

@rwest
Copy link
Member Author

rwest commented Mar 26, 2013

I think this is closed by:

(assuming the Jacobians are correct)
Should we add documentation somewhere to describe what y and y0 represent?

@rwest rwest closed this as completed Mar 26, 2013
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

No branches or pull requests

3 participants