This repository has been archived by the owner on Jun 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Seed Mechanisms revisited #153
Open
rwest
wants to merge
68
commits into
master
Choose a base branch
from
seedmech
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Previously the restart mechanism would be appended to the seed mechanisms. By keeping it separate, we can do different things with the restart mechanism and the real seed mechanisms.
We will not be generating cross-reactions from seed mechanisms, so this will be redundant. Should also update the input-file reading etc.
We just calculated these so that we could print them out. Now we re-use that list instead of calculating them again.
Updated: * SeedMechanism class (removed the generateReactions attribute) * Method calls (removed the p_generateReactions parameter). * Input parsing (including warnings for old input files). * Documentation. * Examples. Not updated: * GUI
We'd updated some console output yesterday in the wrong place, because it was duplicated. Now we use the same method twice.
It's the CoreEdgeReactionModel that does things like writing chemkin files, so we will need access to the seed mechanism from that context.
The CoreEdgeReactionModel has new methods to getCoreAndSeedSpecies(), which can be used in place of getSpecies() for things like the chemkin thermo data, chemkin species list, and chemkin transport data.
Chemkin file will include: * Seed mechanism reactions * PDep from reaction libraries (Troe etc.) UNLESS duplicates a seed rxn. * PDep from FAME (UNLESS it duplicates a seed or pdep-from-reaction-library) * NonPdep from RMG (UNLESS it duplicates a seed reaction)
…t file" Because the seed mechanism is dealt with differently now, this fix needs to be done differently. First I'm reverting the fix, then I'll re-fix it. This reverts commit 62d1a55 and commit 99cda1c Conflicts (because of other changes since the fix was introduced): source/RMG/jing/rxnSys/Chemkin.java source/RMG/jing/rxnSys/ReactionModelGenerator.java source/RMG/jing/rxnSys/ReactionSystem.java
…ODE solve. If a reaction is in a seed mechanism, be it with pressure dependence or otherwise, then it is removed from any PDep networks before they are sent to the ODE solver. Similar filtering is in place for printing CHEMKIN files. This sort of re-implements 62d1a55.
This doesn't appear to be used.
In getCoreAndSeedSpeciesSet(), instead of making a new LinkedHashSet contaiting both the Core and the Seed species, I was modifying the Core set (adding the Seed species to it) and returning that. Oops!
This helped us figure out when PDep reactions are or are not excluded from the ODE solver because they duplicate existing reactions.
More detail is stored in the log file (Logger.debug) than the console (Logger.info) regarding where each of the species and reactions came from.
Now written only once per iteration, instead of once for each reaction system. To preserve the previous behaviour (the over-writing meant only the last reaction system was saved) it now saves only the last reaction system. I have also moved where this happens, to be just after the printModelSize() call, because writing the chemkin files now has the side-effect of reporting their size, and it looks nicer in the log file if this occurs straight after printModelSize().
Previously, they were all placed on the edge. This was a problem when a reaction should have been in the core (based on all reagents being in the core in the condition file). Such reactions are now placed in the core. Also, we now add both forward and reverse directions, if reverse directions exist. The addReactionSet(LinkedHashSet) method did almost exactly what I needed, but it would discard reactions that had a reactant not in the core (you couldn't have something entirely in the edge). Rather than change the behaviour of that method (which is used elsewhere) I made a new method: addReactionSetFromSeed
This commit adds if statements to three classes, checking whether a Seed Mechanism exists before attempting to grab the species (reactions) stored in the Seed. Otherwise, NPE occurs when running RMG with no Seed Mechanisms.
This commit switches the general order of adding reactions to the ODE input file and CHEMKIN chem.inp file from: * Seed * Reaction Library pdepreactions * RMG (fame) pdepreactions * RMG nonpdep reactions to: * Seed * Reaction Library pdepreactions * RMG nonpdep reactions # RMG (fame) pdepreactions Example: Suppose user started with H and O2 in the input file, and Glarborg/C3 reaction library. RMG would find H+O2=O+OH in Glarborg/C3 library and would make HO2 (H+O2) included, thereby finding the O+OH well, making H+O2(+m)=O+OH(+m). In the previous order, RMG would add the RMG pdepreactions reaction to the list, and then add the Glarborg/C3 reaction to the list: this would be an incorrect duplicate. With the new order, RMG adds the Glarborg/C3 reaction, and then recognizes the RMG (fame) pdepreaction to be a duplicate and will not add it to the ODE or CHEMKIN list.
All references to the now-obsolete GenerateReactions field have been removed.
The line with the reaction on has to have the high-P limit in. I used the highest available P.
(This fix has been done in other files on other branches)
This one was tricky, because the original published mechanism does not label some of the rates, and I had to guess what they were from what the numbers were similar to and what order they were in. This is the relevant section of the original file from doi:10.1016/j.proci.2008.06.188 !C2H4+OH=CH2CH2OH 6.0E37 -8.140 8043 ! JIM/GLA08 SEN/MIL06 1 atm ! DUPLICATE ! !C2H4+OH=CH2CH2OH 7.3E23 -6.910 2855 ! ! DUPLICATE ! !C2H4+OH=CH2CH2OH 6.0E37 -7.770 10736 ! JIM/GLA08 SEN/MIL06 10 atm ! DUPLICATE ! !C2H4+OH=CH2CH2OH 3.0E26 -4.870 2297 ! JIM/GLA08 SEN/MIL06 10 atm ! DUPLICATE ! !C2H4+OH=CH2CH2OH 6.0E37 -7.440 14269 ! ! DUPLICATE ! C2H4+OH=CH2CH2OH 2.4E20 -2.399 3294 ! JIM/GLA08 fit to SEN/MIL06 60 atm,600-900K !C2H4+OH=CH2CH2OH 2.8E19 -2.410 1011 ! JIM/GLA08 SEN/MIL06 100 atm ! DUPLICATE !
I'm not sure we can actually handle comments in the positions I've put them but it's useful to record somewhere that the high P limit is in fact the 100 atm estimate.
These were CO + OH = CO2 + H CO + OH = HOCO HOCO = CO2 + H The PLOG rates came from C3/reactions.full
…ile. C2H5O species renamed to CH3CH2O in C1 library to match naming system in C2 and C3 libraries.
The Jasper et al. kinetics for the CH3 + HO2 = CH3O + OH reaction were incorrect for four of the Glarborg reaction libraries. The kinetics were reported as such (doi: 10.1016/j.proci.2008.05.036): k1a = 7.679 x 10^-12 (T/298K)^0.2688 exp(346.0 K /T) cm3 molecule-1 s-1 The current A value in all four libraries is the per-molecule A multiplied by Avogadro's number; however, one also needs to divide by 298^0.2688 as RMG's reference temperature for the T^n term is 1 K. Furthermore, three of the libraries have the incorrect sign for the activation energy; the Ea should be negative. This commit resolves the issue. Thanks to Yushi Suzuki for pointing out the error! When applying this patch to the glarborgplog branch, I updated all instances of these rates (including the temporary files) Signed-off-by: Richard West <[email protected]>
These have been moved (still commented) to the pdepreactions.txt files.
Not sure how RMG (or chemkin) cope with comments on these lines, so moving them to be safe.
These were only commented because they had been as part of Glarborg's original method of doing PDep. They should not have been excluded.
The original explanation for these is given in commit 4eb2769 as: The light folders have some chemistry removed. For C1_light, CH2(S), CH, and C are turned off. For C2_light and C3_light, any species R-C*-OOH has been replaced with R-C=O + OH. Since then, they have not always been updated when the non-light versions have been, and so have a variety of bugs etc in. I am removing them so that they are not used by mistake. If somebody wants them back, I suggest they use the above description to re-generate them from the latest non-light versions.
This brings in all master branch updates up to the present time. Conflicts: databases/RMG_database/kinetics_libraries/Glarborg/C2/reactions.txt databases/RMG_database/kinetics_libraries/Glarborg/C2_light/reactions.txt databases/RMG_database/kinetics_libraries/Glarborg/C3/reactions.txt databases/RMG_database/kinetics_libraries/Glarborg/C3_light/reactions.txt source/RMG/jing/rxnSys/ReactionModelGenerator.java source/RMG/jing/rxnSys/SeedMechanism.java all resolved.
I'm not sure this is going to work... |
Conflicts: source/RMG/jing/rxn/ReactionLibrary.java source/RMG/jing/rxnSys/SeedMechanism.java
When constructing a PDepRateConstant with some PLOG kinetics, the mode is now set to Mode.PDEPARRHENIUS for that rate constant.
…ion. For FAME-generated PLOG reactions, there are probably the same number as there are FAME pressures. However, if PLOG rates are read in from a reaction library or seed mechanism, they will have a different number of PLOG rates. I am about to remove the static nature of PDepArrheniusKinetics.getNumPressures() so the current code will have to break, for restart jobs where FAME-made pdep rates are expressed in PLOG form. Hopefully this commit will help make it relatively easier to fix...?
…inetics Instead of being a static list of Pressures (and static int numPressures) these are not static, i.e. they are stored on each instance of PDepArrheniusKinetics. This allows each PDepArrheniusKinetics object to have a different list of pressures. This is important for rates that are read in from reaction libraries or seed mechanisms.
… readPdepReactions. Now that (as of d137bf2 ) we are always marking reactions read in via the SeedMechanism.read as being FromPrimaryKineticLibrary, we no longer need to pass the 'pkl' attribute which is always true.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This used to be issue #147. It is now a 'pull request' - but I'm not actually requesting you pull it in to the master branch just yet.. wait until it's finished :-) See http://help.github.com/pull-requests/ for details about pull requests.
There is a new 'seedmech' branch for us to implement the changes to seed mechanism behaviour that we discussed in the meeting a couple of weeks ago. You can follow its progress here in this "pull request".
For the record, this is what we're aiming at, based on the meeting we had:
So far:
Still to do:
Please feel free to contribute :-)