Closed ysadat7 closed 1 year ago
See the documentation here: http://reactionmechanismgenerator.github.io/RMG-Py/users/rmg/input.html#advanced-setting-range-based-reactors.
In general ranged reactors are very robust if you're varying 2 or less dimensions (temperature, pressure, initial conditions...) and especially robust for small temperature ranges like that.
Thanks Matt, I should have mentioned that my model occurs at the liquid reactor, is that still the case? I have been trying to run the model and it keeps failing, please kindly have a look at my input file:
database( thermoLibraries = ['primaryThermoLibrary'], reactionLibraries = [], seedMechanisms = [], kineticsDepositories = ['training'], kineticsFamilies = 'default', kineticsEstimator = 'rate rules', )
species( label='decane', reactive=True, structure=SMILES("CCCCCCCCCC"), ) species( label='oxygen', reactive=True, structure=SMILES("[O][O]"), ) species( label='ROOH', reactive=True, structure=SMILES("CCCCCCCCCCOO"), ) species( label='RO', reactive=True, structure=SMILES("CCCCCCCCCC[O]"), ) species( label='OH', reactive=True, structure=SMILES("[OH]"), ) species( label='ROH', reactive=True, structure=SMILES("CCCCCCCCCCO"), ) species( label='R(=O)R', reactive=True, structure=SMILES("CCCCCCCC(=O)CC"), ) species( label='R=O', reactive=True, structure=SMILES("CCCCCCCCCC=O"), )
liquidReactor( temperature=[(413,'K'),(453,'K')] #Temperature initialConcentrations={ "decane": (4.70000000E-03,'mol/cm^3'), #fuel conc "oxygen": (2.00000000E-06,'mol/cm^3') #O2 conc }, terminationTime=(1200,'s'), #time )
solvation( solvent='decane' #solvent )
simulator( atol=1e-16, rtol=1e-8, )
model( toleranceMoveToCore=0.001, toleranceInterruptSimulation=0.1, filterReactions=True, )
options( units='si', saveRestartPeriod=False, generateOutputHTML=True, generatePlots=True, saveSimulationProfiles=True, )
What error message are you getting?
This is what I'm getting:
Loading thermodynamics library from primaryThermoLibrary.py in /home/fcq17ss/RMG-database/input/thermo/libraries...
Loading thermodynamics group database from /home/fcq17ss/RMG-database/input/thermo/groups...
Loading transport library from GRI-Mech.py in /home/fcq17ss/RMG-database/input/transport/libraries...
Loading transport library from NOx2018.py in /home/fcq17ss/RMG-database/input/transport/libraries...
Loading transport library from OneDMinN2.py in /home/fcq17ss/RMG-database/input/transport/libraries...
Loading transport library from PrimaryTransportLibrary.py in /home/fcq17ss/RMG-database/input/transport/libraries...
Loading transport group database from /home/fcq17ss/RMG-database/input/transport/groups...
Loading frequencies group database from /home/fcq17ss/RMG-database/input/statmech/groups...
Loading Platts additivity group database from /home/fcq17ss/RMG-database/input/solvation/groups...
Adding rate rules from training set in kinetics families...
Warning: Cphigh is above the theoretical CpInf value for ThermoData object
ThermoData(Tdata=([300,400,500,600,800,1000,1500],'K'), Cpdata=([36.6869,38.2195,39.253,40.4473,45.0357,50.6323,54.2027],'J/(molK)'), H298=(310.047,'kJ/mol'), S298=(162.808,'J/(molK)'), Cp0=(29.1007,'J/(molK)'), CpInf=(37.4151,'J/(molK)'), comment="""Thermo group additivity estimation: group(O2s-CsCs) + group(CsJ2_singlet-CsH)""").
The thermo for this species is probably wrong! Setting CpInf = Cphigh for Entropy calculationat T = 2000.0 K...
Warning: Cphigh is above the theoretical CpInf value for ThermoData object
ThermoData(Tdata=([300,400,500,600,800,1000,1500],'K'), Cpdata=([36.6869,38.2195,39.253,40.4473,45.0357,50.6323,54.2027],'J/(molK)'), H298=(310.047,'kJ/mol'), S298=(162.808,'J/(molK)'), Cp0=(29.1007,'J/(molK)'), CpInf=(37.4151,'J/(molK)'), comment="""Thermo group additivity estimation: group(O2s-CsCs) + group(CsJ2_singlet-CsH)""").
The thermo for this species is probably wrong! Setting CpInf = Cphigh for Entropy calculationat T = 1666.6666666666665 K...
Warning: Cphigh is above the theoretical CpInf value for ThermoData object
ThermoData(Tdata=([300,400,500,600,800,1000,1500],'K'), Cpdata=([36.6869,38.2195,39.253,40.4473,45.0357,50.6323,54.2027],'J/(molK)'), H298=(310.047,'kJ/mol'), S298=(162.808,'J/(molK)'), Cp0=(29.1007,'J/(molK)'), CpInf=(37.4151,'J/(molK)'), comment="""Thermo group additivity estimation: group(O2s-CsCs) + group(CsJ2_singlet-CsH)""").
The thermo for this species is probably wrong! Setting CpInf = Cphigh for Entropy calculationat T = 2000.0 K...
Warning: Cphigh is above the theoretical CpInf value for ThermoData object
ThermoData(Tdata=([300,400,500,600,800,1000,1500],'K'), Cpdata=([36.6869,38.2195,39.253,40.4473,45.0357,50.6323,54.2027],'J/(molK)'), H298=(310.047,'kJ/mol'), S298=(162.808,'J/(molK)'), Cp0=(29.1007,'J/(molK)'), CpInf=(37.4151,'J/(molK)'), comment="""Thermo group additivity estimation: group(O2s-CsCs) + group(CsJ2_singlet-CsH)""").
The thermo for this species is probably wrong! Setting CpInf = Cphigh for Entropy calculationat T = 1666.6666666666665 K...
Filling in rate rules in kinetics families by averaging...
Enabling diffusion-limited kinetics...
Setting solvent data for decane
Traceback (most recent call last):
File "/home/fcq17ss/RMG-Py/rmg.py", line 111, in
This looks like a bug using ranged reactors for liquid simulations. In your case with that short of a temperature range I think you're almost certainly fine using two reactors one at each end of your temperature range (you can put one in the middle too if you want to be extra safe) for now. I would actually be a bit surprised if you got a significantly different mechanism just using one reactor at any temperature in that range.
Ranged reactors was more built for large ranges where the chemistry can change a lot ex: 500-1600 K. Although it wouldn't hurt.
Thanks Matt, I think the problem was using [ ] somehow, and the entry in the input file wasn't recognised as such: [(413,'K'),(453,'K')], I had just followed the same footsteps of simplereactors, but apparently that wouldn't work for liquidphase. I used the following instead which worked luckily. About the temperature range, in fact there is a lot of difference in Oxygen consumption when running individual runs from 140-180, in fact there is no initiation in 140, whereas in the 180 runs the oxygen is consumed instantly, hence I wanted to include the range to make sure we get the most accurate detailed mechanism prior to the reduction.
liquidReactor( temperature=(413,'K'), #Temperature initialConcentrations={ "decane": (4.70000000E-03,'mol/cm^3'), #fuel conc "oxygen": (2.00000000E-06,'mol/cm^3') #O2 conc }, terminationTime=(1200,'s'), #time )
liquidReactor( temperature=(433,'K'), #Temperature initialConcentrations={ "decane": (4.70000000E-03,'mol/cm^3'), #fuel conc "oxygen": (2.00000000E-06,'mol/cm^3') #O2 conc }, terminationTime=(1200,'s'), #time )
liquidReactor( temperature=(453,'K'), #Temperature initialConcentrations={ "decane": (4.70000000E-03,'mol/cm^3'), #fuel conc "oxygen": (2.00000000E-06,'mol/cm^3') #O2 conc }, terminationTime=(1200,'s'), #time )
I thought I have fixed this bug in #1918 but I guess this bug is still there. I will take a look at this.
@ysadat7 Hello! I was able to run your script with the temperature range on the current master without encountering any errors. Are you running on the newest commit on the master branch?
Hello, yes I was able to run my session with no problem with the second script I put here, it was a matter of having separate liquid reactors instead of just one... Thanks for your help
This issue is being automatically marked as stale because it has not received any interaction in the last 90 days. Please leave a comment if this is still a relevant issue, otherwise it will automatically be closed in 30 days.
Hello I was reading the paper recently published on RMG 3.0 and I noticed the model can be run for a temperature range instead of a single temperature. To give you a bit of context, I'm modelling n-Decane autoxidation for temperatures between 140-180 and I have been running single jobs for the intermediate temperatures to see how the model behaves. Would you please explain how the temperature range could be written in the input file and whether it would be an accurate representation of the model. Many thanks