Пример #1
0
 def test_m6permol2s(self):
     """
     Test the creation of a rate coefficient quantity with units of m^6/(mol^2*s).
     """
     q = quantity.RateCoefficient(1.0, "m^6/(mol^2*s)")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si, 1.0, delta=1e-6)
     self.assertEqual(q.units, "m^6/(mol^2*s)")
Пример #2
0
 def test_cm9permol3s(self):
     """
     Test the creation of a rate coefficient quantity with units of cm^9/(mol^3*s).
     """
     q = quantity.RateCoefficient(1.0, "cm^9/(mol^3*s)")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si * (1e6)**3, 1.0, delta=1e-6)
     self.assertEqual(q.units, "cm^9/(mol^3*s)")
Пример #3
0
 def test_cm6permolecule2s(self):
     """
     Test the creation of a rate coefficient quantity with units of cm^6/(molecule^2*s).
     """
     q = quantity.RateCoefficient(1.0,"cm^6/(molecule^2*s)")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si*(1e6/constants.Na)**2, 1.0, delta=1e-6)
     self.assertEqual(q.units, "cm^6/(molecule^2*s)")
Пример #4
0
 def test_s(self):
     """
     Test the creation of a rate coefficient quantity with units of s^-1.
     """
     q = quantity.RateCoefficient(1.0, "s^-1")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si, 1.0, delta=1e-6)
     self.assertEqual(q.units, "s^-1")
Пример #5
0
 def test_cm3permolecules(self):
     """
     Test the creation of a rate coefficient quantity with units of cm^3/(molecule*s).
     """
     q = quantity.RateCoefficient(1.0, "cm^3/(molecule*s)")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si * 1e6 / constants.Na, 1.0, delta=1e-6)
     self.assertEqual(q.units, "cm^3/(molecule*s)")
     self.assertAlmostEqual(q.get_conversion_factor_from_si_to_cm_mol_s(), 1e6, delta=1e0)  # 1 m3/mol/s  =  1e6 cm3/mol/s
Пример #6
0
 def test_m3permols(self):
     """
     Test the creation of a rate coefficient quantity with units of m^3/(mol*s).
     """
     q = quantity.RateCoefficient(1.0, "m^3/(mol*s)")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si, 1.0, delta=1e-6)
     self.assertEqual(q.units, "m^3/(mol*s)")
     self.assertAlmostEqual(q.get_conversion_factor_from_si_to_cm_mol_s(), 1e6, places=1)  # 1 m3/mol/s  =  1e6  cm3/mol/s
Пример #7
0
 def test_s(self):
     """
     Test the creation of a rate coefficient quantity with units of s^-1.
     """
     q = quantity.RateCoefficient(1.0, "s^-1")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si, 1.0, delta=1e-6)
     self.assertEqual(q.units, "s^-1")
     self.assertAlmostEqual(q.get_conversion_factor_from_si_to_cm_mol_s(), 1.0, places=1)  # 1 /s  =  1 /s
Пример #8
0
 def test_cm9permolecule3s(self):
     """
     Test the creation of a rate coefficient quantity with units of cm^9/(molecule^3*s).
     """
     q = quantity.RateCoefficient(1.0, "cm^9/(molecule^3*s)")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si * (1e6 / constants.Na) ** 3, 1.0, delta=1e-6)
     self.assertEqual(q.units, "cm^9/(molecule^3*s)")
     self.assertAlmostEqual(q.get_conversion_factor_from_si_to_cm_mol_s(), 1e18,
                            delta=1e3)  # 1 m9/mole3/s  =  1e18 cm9/mol3/s
Пример #9
0
 def test_cm6permolecule2s(self):
     """
     Test the creation of a rate coefficient quantity with units of cm^6/(molecule^2*s).
     """
     q = quantity.RateCoefficient(1.0, "cm^6/(molecule^2*s)")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si * (1e6 / constants.Na) ** 2, 1.0, delta=1e-6)
     self.assertEqual(q.units, "cm^6/(molecule^2*s)")
     self.assertAlmostEqual(q.get_conversion_factor_from_si_to_cm_mol_s(), 1e12,
                            delta=1e0)  # 1 m6/mol2/s  =  1e12 cm6/mol2/s
Пример #10
0
 def test_cm9permol3s(self):
     """
     Test the creation of a rate coefficient quantity with units of cm^9/(mol^3*s).
     """
     q = quantity.RateCoefficient(1.0, "cm^9/(mol^3*s)")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si * (1e6)**3, 1.0, delta=1e-6)
     self.assertEqual(q.units, "cm^9/(mol^3*s)")
     self.assertAlmostEqual(q.getConversionFactorFromSItoCmMolS(),
                            1e18,
                            delta=1e3)  # 1 m9/mol3/s  =  1e18  cm9/mol3/s
Пример #11
0
 def test_cm6permol2s(self):
     """
     Test the creation of a rate coefficient quantity with units of cm^6/(mol^2*s).
     """
     q = quantity.RateCoefficient(1.0, "cm^6/(mol^2*s)")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si * (1e6)**2, 1.0, delta=1e-6)
     self.assertEqual(q.units, "cm^6/(mol^2*s)")
     self.assertAlmostEqual(q.getConversionFactorFromSItoCmMolS(),
                            1e12,
                            places=1)  # 1 m6/mol2/s  =  1e12  cm6/mol2/s
Пример #12
0
 def test_cm3permols(self):
     """
     Test the creation of a rate coefficient quantity with units of cm^3/(mol*s).
     """
     q = quantity.RateCoefficient(1.0, "cm^3/(mol*s)")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si * 1e6, 1.0, delta=1e-6)
     self.assertEqual(q.units, "cm^3/(mol*s)")
     self.assertAlmostEqual(q.getConversionFactorFromSItoCmMolS(),
                            1e6,
                            places=1)  # 1 m3/mol/s  =  1 cm3/mol/s
Пример #13
0
 def test_s(self):
     """
     Test the creation of a rate coefficient quantity with units of s^-1.
     """
     q = quantity.RateCoefficient(1.0, "s^-1")
     self.assertAlmostEqual(q.value, 1.0, 6)
     self.assertAlmostEqual(q.value_si, 1.0, delta=1e-6)
     self.assertEqual(q.units, "s^-1")
     self.assertAlmostEqual(q.getConversionFactorFromSItoCmMolS(),
                            1.0,
                            places=1)  # 1 /s  =  1 /s