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

RMG running get "xxx conversion: nan" #1678

Closed
1 of 6 tasks
shenghuiqin opened this issue Aug 9, 2019 · 5 comments
Closed
1 of 6 tasks

RMG running get "xxx conversion: nan" #1678

shenghuiqin opened this issue Aug 9, 2019 · 5 comments

Comments

@shenghuiqin
Copy link

shenghuiqin commented Aug 9, 2019

Topic

General area which your question is related to.

  • Installation of RMG
  • Running an RMG job
  • Using RMG API
  • Arkane (formerly CanTherm)
  • Dependencies
  • An error message

input file

#Data sources
database(
    thermoLibraries =['BurkeH2O2','FFCM1(-)','thermo_DFT_CCSDTF12_BAC','CBS_QB3_1dHR','DFT_QCI_thermo','primaryThermoLibrary'], # 'FFCM1(-)','primaryThermoLibrary', 'BurkeH2O2','DFT_QCI_thermo','CBS_QB3_1dHR'
    reactionLibraries = [('2005_Senosiain_OH_C2H2',False),('Glarborg/C3', False)], # 
    seedMechanisms = ['BurkeH2O2inN2','FFCM1(-)',], #
    kineticsDepositories = ['training'], 
    kineticsFamilies = ['default'],
    kineticsEstimator = 'rate rules',
)

#Constraints on generated species
generatedSpeciesConstraints(
    maximumRadicalElectrons = 2,
    allowed=['input species','seed mechanisms','reaction libraries'],
    maximumCarbonAtoms=9,
    maximumOxygenAtoms=4,
)

#List of species
species(
    label='C7H16',
    reactive=True,
    structure=SMILES("CCCCCCC"),
)
species(
    label='O2',
    reactive=True,
        structure=adjacencyList(
        """
        1 O u1 p2 {2,S}
        2 O u1 p2 {1,S}
        """),
)
species(
    label='N2',
    reactive=False,
    structure=SMILES("N#N")
)





#Reaction systems
simpleReactor(
    temperature=[(600,'K'),(1500,'K')],
    pressure=[(10.0,'bar'),(40.0,'bar')],
    nSims=8,
    initialMoleFractions={
        #"C7H10": 1,
        "O2":   0.10885, # phi=1 means 9.5 O2 per C7H10
        "N2":   0.881684808, # 8.1 times as much N2 as O2
        "C7H16":0.00946, #  
           
    },
    terminationTime = (1.0, 's'),
    terminationRateRatio = 0.01,
    terminationConversion={
                'C7H16': 0.99,
        },
)

simulator(
    atol=1e-16,
    rtol=1e-8,
)


model(
    toleranceKeepInEdge=0, # No pruning to start
    toleranceMoveToCore=0.4,
    toleranceInterruptSimulation=1,
    maxNumObjsPerIter=3, 
    terminateAtMaxObjects=True,
    maxNumSpecies=200, # first stage is until core reaches 100 species
    filterReactions=True, # should speed up model generation
)

model(
    toleranceMoveToCore=0.25,
    toleranceInterruptSimulation=1e8,
    toleranceKeepInEdge=0.01, # Pruning enabled for stage 2
    maximumEdgeSpecies=200000,
    minCoreSizeForPrune=100,
    minSpeciesExistIterationsForPrune=2,
    filterReactions=True,
    )

options(
    units='si',
    # saveRestartPeriod=(1,'hour'),
    generateOutputHTML=False,
    generatePlots=True,
    saveSimulationProfiles=True,
    saveEdgeSpecies=False,
)

Question

what happened, I get so many nan?
Usually, I won't get any nan with the similar input file, I want to know is this an error? something wrong with my input? or it's normal and I can ignore it,
image
image

Installation Information

Describe your installation method and system information if applicable.

  • OS (include version if known): ubuntu
  • Installation method: source install using conda env
  • RMG version information:
    • RMG-Py: july 31
    • RMG-database: july 26
@mjohnson541
Copy link
Contributor

So the nans appear in the first time step for the cases in this job that give conversion: nan, but in other cases the simulations run fine. I believe this is a result of a reaction with a bad rate and/or bad thermo that when added to the model under certain conditions breaks the solver residual calculation.

I've made a PR that diagnoses nan presence as a DASxError, which allows RMG to handle this more properly, but the fundamental issue is the reaction/species that's causing this. It will at least have entered before you start seeing the nans, but may have entered a few iterations earlier since the nan production seems to be dependent on the temperature and pressure.

@shenghuiqin
Copy link
Author

on another input file of heptane
I

  • changed
    terminationRateRatio = 0.01, terminationConversion={ 'C7H16': 0.99, },
    to
    terminationRateRatio = 0.01,
    terminationConversion={ 'O2': 0.5, },
  • added pressure dependence,

and i got almost all (210/212) conversion: nun
image

input.py

database(thermoLibraries =['BurkeH2O2','FFCM1(-)','thermo_DFT_CCSDTF12_BAC','CBS_QB3_1dHR','DFT_QCI_thermo','primaryThermoLibrary'], # 'FFCM1(-)','primaryThermoLibrary', 'BurkeH2O2','DFT_QCI_thermo','CBS_QB3_1dHR'
reactionLibraries = [('2005_Senosiain_OH_C2H2',False),('Glarborg/C3', False)], #
seedMechanisms = ['BurkeH2O2inN2','FFCM1(-)',], #
kineticsDepositories = ['training'],
kineticsFamilies = ['default'],
kineticsEstimator = 'rate rules',
)

#Constraints on generated species
generatedSpeciesConstraints(
maximumRadicalElectrons = 2,
allowed=['input species','seed mechanisms','reaction libraries'],
maximumCarbonAtoms=9,
maximumOxygenAtoms=4,
#allowSingletO2 = True,
)

#List of species
species(
label='C7H16',
reactive=True,
structure=SMILES("CCCCCCC"),
)
species(
label='O2',
reactive=True,
structure=adjacencyList(
"""
1 O u1 p2 {2,S}
2 O u1 p2 {1,S}
"""),
)
species(
label='N2',
reactive=False,
structure=SMILES("N#N")
)

#Reaction systems
simpleReactor(
temperature=[(600,'K'),(1500,'K')],
pressure=[(10.0,'bar'),(40.0,'bar')],
nSims=8,
initialMoleFractions={
#"C7H10": 1,
"O2": 0.10885, # phi=1 means 9.5 O2 per C7H10
"N2": 0.881684808, # 8.1 times as much N2 as O2
"C7H16":0.00946, #

},
terminationTime = (10.0, 's'),
terminationRateRatio = 0.001,
terminationConversion={
            'O2': 0.5,
    },

)

simulator(
atol=1e-16,
rtol=1e-8,
)

model(
toleranceKeepInEdge=0,
toleranceMoveToCore=0.4,
toleranceInterruptSimulation=1,
maxNumObjsPerIter=3,
terminateAtMaxObjects=True,
maxNumSpecies=200,
filterReactions=True,
)

model(
toleranceMoveToCore=0.3,
toleranceInterruptSimulation=1e8,
toleranceKeepInEdge=0.01,
maximumEdgeSpecies=100000,
minCoreSizeForPrune=100,
minSpeciesExistIterationsForPrune=2,
filterReactions=True,
)

options(
units='si',
# saveRestartPeriod=(1,'hour'),
generateOutputHTML=False,
generatePlots=True,
saveSimulationProfiles=True,
saveEdgeSpecies=False,
)
pressureDependence(
method='modified strong collision',
maximumGrainSize=(0.5,'kcal/mol'),
minimumNumberOfGrains=250,
temperatures=(300,2000,'K',8),
pressures=(0.01,100,'bar',5),
interpolation=('Chebyshev', 6, 4),

)

@shenghuiqin
Copy link
Author

I substitute 'FFCM1(-)' with 'Klippenstein_Glarborg2016' on my input file, and no "conversion: nan" shows

@mjohnson541
Copy link
Contributor

In that case it may be that the FFCM1(-) thermochemistry isn't compatible with the reaction libraries you're using.

@shenghuiqin
Copy link
Author

yeah, I need to be more careful when selecting those libraries.
thank you for your help.
should I close this issue?

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

2 participants