From d7418f10baa801a3fbfe3adc97bf9dc53a6d67ad Mon Sep 17 00:00:00 2001 From: Richard West Date: Wed, 28 Oct 2009 09:13:01 -0400 Subject: [PATCH] Advance simulation faster (check validity less often). Also tweaked the input files --- examples/1,3-hexadiene/input.xml | 6 +++--- examples/diesel/input.xml | 2 +- source/rmg/model.py | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/1,3-hexadiene/input.xml b/examples/1,3-hexadiene/input.xml index 9e0f67f1ea..baaccda57b 100755 --- a/examples/1,3-hexadiene/input.xml +++ b/examples/1,3-hexadiene/input.xml @@ -61,9 +61,9 @@ - 1e-4 - 0.1 - 1.0 + 1e-5 + 0.01 + 0.5 off diff --git a/examples/diesel/input.xml b/examples/diesel/input.xml index 7501ef800a..6c5596d964 100755 --- a/examples/diesel/input.xml +++ b/examples/diesel/input.xml @@ -48,7 +48,7 @@ 500.0 - 1.0 + 201.0 162.0 diff --git a/source/rmg/model.py b/source/rmg/model.py index 7c3907ef9d..b90afaa151 100755 --- a/source/rmg/model.py +++ b/source/rmg/model.py @@ -936,8 +936,10 @@ def simulate(self, model): first_step = False # don't integrate on first time through, just do the validity checking and result reporting else: # advance cantera one step, or two if the first didn't get there + nexttime = time*1.2589254117941673 if sim.step(endtime) < endtime: - sim.step(endtime) + if sim.step(endtime) < nexttime: + sim.advance(nexttime) time = sim.time() P = gas.pressure()