From ea13148633a6e6ce05dfcdbd1aabd693678b2be4 Mon Sep 17 00:00:00 2001 From: KEHANG Date: Fri, 10 Feb 2017 16:19:18 -0500 Subject: [PATCH] make atol and rtol modifiable for users --- pychemkin/chemkin.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pychemkin/chemkin.py b/pychemkin/chemkin.py index ddc26ba..9bd768b 100644 --- a/pychemkin/chemkin.py +++ b/pychemkin/chemkin.py @@ -321,7 +321,8 @@ def writeInputHomogeneousBatch(self,problemType, reactants, temperature, pressur def writeInputPlugFlow(self,problemType, reactants, startingAxialPosition, endingAxialPosition, diameter, momentum=True, massflowrate = None, sccmflowrate = None, temperature = None, pressure = None, - temperatureProfile = None, pressureProfile = None, sensitivity=[], rop=[]): + temperatureProfile = None, pressureProfile = None, sensitivity=[], rop=[], + atol=1e-9, rtol=1e-6): """ Write input file for typical plug flow @@ -427,14 +428,14 @@ def writeInputPlugFlow(self,problemType, reactants, ACHG 0.0 ! Maximum Absolute Change in Site Fractions ADAP ! Save Additional Adaptive Points ATLS 1.0E-6 ! Sensitivity Absolute Tolerance -ATOL 1.0E-9 ! Absolute Tolerance +ATOL {0} ! Absolute Tolerance MAXIT 4 ! Maximum Number of Iterations NNEG ! Force Non-negative Solution PSV 1.0E-8 ! Scaling Factor for Relaxing Surface Equations (cm/sec) RCHG 1.0E-6 ! Maximum Relative Change in Site Fractions RTLS 0.0001 ! Sensitivity Relative Tolerance -RTOL 1.0E-6 ! Relative Tolerance -TSTP 1.0 ! Initial Integration Step (cm""") +RTOL {1} ! Relative Tolerance +TSTP 1.0 ! Initial Integration Step (cm""".format(atol, rtol)) input_stream+=(""" !