Skip to content

Commit

Permalink
[UnitTests] Update/add tests related to electrochemistry
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl committed Mar 15, 2022
1 parent 874b85b commit 093af64
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion interfaces/cython/cantera/test/test_reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -1757,7 +1757,7 @@ def setUpClass(cls):
args = list(cls._rate.values())
cls._rate_obj = ct.Arrhenius(*args)
cls._cls = ct.InterfaceReaction
cls._rxn_type = "interface"
cls._rxn_type = "interface-legacy"
cls._rate_type = None
cls._rate_cls = None
cls._legacy_uses_rate = True
Expand Down Expand Up @@ -1816,6 +1816,16 @@ def test_rate(self):
pytest.skip("Legacy: interface rate does not include coverage terms")
super().test_rate()

def test_electrochemistry(self):
if self._legacy:
pytest.skip("Legacy: property uses_electrochemisty not implemented")
rxn = self.from_yaml()
sol2 = ct.Interface(thermo="Surface", kinetics="interface",
species=self.species, reactions=[rxn], adjacent=self.adj)
rate2 = sol2.reaction(0).rate
assert not rate2.uses_electrochemistry
assert np.isnan(rate2.beta)


class TestArrheniusInterfaceReaction(InterfaceReactionTests, utilities.CanteraTest):
# test interface reaction without coverages
Expand Down
2 changes: 1 addition & 1 deletion test/kinetics/kineticsFromYaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ TEST_F(ReactionToYaml, electrochemical)
oxide_surf->thermo()->setElectricPotential(-3.4);
ox_surf->setCoveragesByName("O''(ox):0.2, OH'(ox):0.3, H2O(ox):0.5");
duplicateReaction(0);
EXPECT_TRUE(std::dynamic_pointer_cast<ElectrochemicalReaction2>(duplicate));
EXPECT_TRUE(std::dynamic_pointer_cast<InterfaceArrheniusRate>(duplicate->rate()));
compareReactions();
compareReactions();
}
Expand Down

0 comments on commit 093af64

Please sign in to comment.