From d27b9ef9b1957deb0265db5a7ab827ba26ef2854 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Sat, 18 Apr 2015 14:05:31 -0400 Subject: [PATCH] [Thermo] Species size defaults to 1.0 This mostly affects surface phases, where a species size of 0 causes several problems. --- include/cantera/thermo/Species.h | 2 +- interfaces/cython/cantera/test/test_thermo.py | 2 +- src/thermo/Species.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/cantera/thermo/Species.h b/include/cantera/thermo/Species.h index 1f79cc9bb..7664acd40 100644 --- a/include/cantera/thermo/Species.h +++ b/include/cantera/thermo/Species.h @@ -24,7 +24,7 @@ public: //! Constructor Species(const std::string& name, const compositionMap& comp, - double charge=0.0, double size=0.0); + double charge=0.0, double size=1.0); Species(const Species& other); Species& operator=(const Species& other); diff --git a/interfaces/cython/cantera/test/test_thermo.py b/interfaces/cython/cantera/test/test_thermo.py index bab21d297..095b37f0e 100644 --- a/interfaces/cython/cantera/test/test_thermo.py +++ b/interfaces/cython/cantera/test/test_thermo.py @@ -638,7 +638,7 @@ class TestSpecies(utilities.CanteraTest): def test_defaults(self): s = ct.Species('H2') - self.assertEqual(s.size, 0.0) + self.assertEqual(s.size, 1.0) self.assertEqual(s.charge, 0.0) def test_index_accessor(self): diff --git a/src/thermo/Species.cpp b/src/thermo/Species.cpp index d9fe715dc..f69e9c124 100644 --- a/src/thermo/Species.cpp +++ b/src/thermo/Species.cpp @@ -10,7 +10,7 @@ namespace Cantera { Species::Species() : charge(0.0) - , size(0.0) + , size(1.0) { }