Skip to content

Commit

Permalink
make atol and rtol modifiable for users
Browse files Browse the repository at this point in the history
  • Loading branch information
KEHANG committed Feb 10, 2017
1 parent cea23a6 commit ea13148
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pychemkin/chemkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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+=("""
!
Expand Down

0 comments on commit ea13148

Please sign in to comment.