Skip to content

Commit

Permalink
[Test/Equil] Update tests to sometimes use VCS 'estimate_equil' option
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed Apr 15, 2016
1 parent ef441e4 commit 7082455
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 79 deletions.
7 changes: 5 additions & 2 deletions interfaces/cython/cantera/test/test_equilibrium.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def setUpClass(cls):
0.25*cls.gas.n_atoms(cls.fuel,'H'))
cls.n_species = cls.gas.n_species + cls.carbon.n_species

def solve(self, solver):
def solve(self, solver, **kwargs):
n_points = 12
T = 300
P = 101325
Expand All @@ -184,7 +184,7 @@ def solve(self, solver):
mix.P = P

# equilibrate the mixture adiabatically at constant P
mix.equilibrate('HP', solver=solver, max_steps=1000)
mix.equilibrate('HP', solver=solver, max_steps=1000, **kwargs)
data[i,:2] = (phi[i], mix.T)
data[i,2:] = mix.species_moles

Expand All @@ -195,3 +195,6 @@ def test_gibbs(self):

def test_vcs(self):
self.solve('vcs')

def test_vcs_est(self):
self.solve('vcs', estimate_equil=-1)
2 changes: 1 addition & 1 deletion interfaces/cython/cantera/test/test_mixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def test_equilibrate1(self):
self.mix.P = 2 * ct.one_atm

E1 = [self.mix.element_moles(m) for m in range(self.mix.n_elements)]
self.mix.equilibrate('TP')
self.mix.equilibrate('TP', solver='vcs', estimate_equil=-1)

E2 = [self.mix.element_moles(m) for m in range(self.mix.n_elements)]
self.assertArrayNear(E1, E2)
Expand Down
Loading

0 comments on commit 7082455

Please sign in to comment.