Skip to content

Commit

Permalink
[1D/Examples] Use new default values for Jacobian and time stepping s…
Browse files Browse the repository at this point in the history
…ettings

These values were selected for optimal performance across a large set of flames
in each configuration and using mechanisms of various sizes to give good average
performance. It should not generally be necessary for users to change these
values.
  • Loading branch information
speth committed Mar 27, 2016
1 parent 6c466f6 commit 059e657
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 12 deletions.
2 changes: 0 additions & 2 deletions interfaces/cython/cantera/examples/onedim/adiabatic_flame.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
# Solve with the energy equation disabled
f.energy_enabled = False
f.transport_model = 'Mix'
f.set_max_jac_age(10, 10)
f.set_time_step(1e-5, [2, 5, 10, 20])
f.solve(loglevel=loglevel, refine_grid=False)
f.save('h2_adiabatic.xml', 'no_energy',
'solution with the energy equation disabled')
Expand Down
1 change: 0 additions & 1 deletion interfaces/cython/cantera/examples/onedim/burner_flame.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

f.energy_enabled = False
f.transport_model = 'Mix'
f.set_max_jac_age(10, 10)
f.solve(loglevel, refine_grid=False)
f.save('h2_burner_flame.xml', 'no_energy',
'solution with the energy equation disabled')
Expand Down
2 changes: 0 additions & 2 deletions interfaces/cython/cantera/examples/onedim/flame_fixed_T.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@
# first solve the flame with mixture-averaged transport properties
f.transport_model = 'Mix'
f.set_refine_criteria(ratio=3.0, slope=0.3, curve=1)
f.set_max_jac_age(50, 50)
f.set_time_step(1.0e-5, [1, 2, 5, 10, 20])

f.solve(loglevel, refine_grid)
f.save('ch4_flame_fixed_T.xml','mixav',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@

# Solve with the energy equation disabled
f.energy_enabled = False
f.set_max_jac_age(10, 10)
f.set_time_step(1e-5, [2, 5, 10, 20])
f.solve(loglevel=1, refine_grid=False)

# Solve with the energy equation enabled
Expand Down
2 changes: 0 additions & 2 deletions interfaces/cython/cantera/test/test_onedim.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ def create_sim(self, p, Tin, reactants, mech='h2o2.xml'):
def solve_fixed_T(self):
# Solve with the energy equation disabled
self.sim.energy_enabled = False
self.sim.set_max_jac_age(50, 50)
self.sim.set_time_step(1e-5, [2, 5, 10, 20])
self.sim.solve(loglevel=0, refine_grid=False)

self.assertFalse(self.sim.energy_enabled)
Expand Down
4 changes: 2 additions & 2 deletions src/oneD/OneDim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ OneDim::OneDim()
m_rdt(0.0), m_jac_ok(false),
m_bw(0), m_size(0),
m_init(false), m_pts(0), m_solve_time(0.0),
m_ss_jac_age(10), m_ts_jac_age(20),
m_ss_jac_age(20), m_ts_jac_age(20),
m_interrupt(0), m_nevals(0), m_evaltime(0.0), m_nsteps(0),
m_nsteps_max(500)
{
Expand All @@ -29,7 +29,7 @@ OneDim::OneDim(vector<Domain1D*> domains) :
m_rdt(0.0), m_jac_ok(false),
m_bw(0), m_size(0),
m_init(false), m_solve_time(0.0),
m_ss_jac_age(10), m_ts_jac_age(20),
m_ss_jac_age(20), m_ts_jac_age(20),
m_interrupt(0), m_nevals(0), m_evaltime(0.0), m_nsteps(0),
m_nsteps_max(500)
{
Expand Down
2 changes: 1 addition & 1 deletion src/oneD/Sim1D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Sim1D::Sim1D(vector<Domain1D*>& domains) :

// set some defaults
m_tstep = 1.0e-5;
m_steps = { 1, 2, 5, 10 };
m_steps = { 10 };
}

void Sim1D::setInitialGuess(const std::string& component, vector_fp& locs, vector_fp& vals)
Expand Down

0 comments on commit 059e657

Please sign in to comment.