Skip to content

Commit

Permalink
Advance simulation faster (check validity less often).
Browse files Browse the repository at this point in the history
Also tweaked the input files
  • Loading branch information
rwest committed Oct 28, 2009
1 parent 8069120 commit d7418f1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions examples/1,3-hexadiene/input.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
<!-- Dynamic simulator -->
<simulator atol="1e-16" rtol="1e-8" />
<fluxTolerance>
<keepInEdge>1e-4</keepInEdge>
<moveToCore>0.1</moveToCore>
<interruptSimulation>1.0</interruptSimulation>
<keepInEdge>1e-5</keepInEdge>
<moveToCore>0.01</moveToCore>
<interruptSimulation>0.5</interruptSimulation>
</fluxTolerance>
<!-- Options -->
<drawMolecules>off</drawMolecules>
Expand Down
2 changes: 1 addition & 1 deletion examples/diesel/input.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<temperature units="K">500.0</temperature>
</temperatureModel>
<pressureModel type="isobaric">
<pressure units="bar">1.0</pressure>
<pressure units="bar">201.0</pressure>
</pressureModel>
<physicalPropertyModel type="incompressibleLiquid" >
<molarVolume units="cm^3/mol">162.0</molarVolume>
Expand Down
4 changes: 3 additions & 1 deletion source/rmg/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit d7418f1

Please sign in to comment.