[Transport/Test] Add tests for IonTransport properties
This commit is contained in:
parent
1245a694e5
commit
5c783c708f
3 changed files with 54 additions and 9 deletions
|
|
@ -951,4 +951,4 @@ class TestIonFlame(utilities.CanteraTest):
|
|||
self.sim.solve(loglevel=0, stage=2, enable_energy=True)
|
||||
|
||||
# Regression test
|
||||
self.assertNear(max(self.sim.E), 133.4795, 1e-3)
|
||||
self.assertNear(max(self.sim.E), 131.9956, 1e-3)
|
||||
|
|
|
|||
|
|
@ -130,6 +130,29 @@ class TestTransport(utilities.CanteraTest):
|
|||
visc)
|
||||
|
||||
|
||||
class TestIonTransport(utilities.CanteraTest):
|
||||
def setUp(self):
|
||||
p = ct.one_atm
|
||||
T = 2237
|
||||
self.gas = ct.Solution('ch4_ion.cti')
|
||||
self.gas.X = 'O2:0.7010, H2O:0.1885, CO2:9.558e-2'
|
||||
self.gas.TP = T, p
|
||||
|
||||
def test_binary_diffusion(self):
|
||||
ld = self.gas.n_species
|
||||
i = self.gas.species_index("N2")
|
||||
j = self.gas.species_index("H3O+")
|
||||
bdiff = self.gas.binary_diff_coeffs[i][j]
|
||||
# Regression test
|
||||
self.assertNear(bdiff, 4.258e-4, 1e-4)
|
||||
|
||||
def test_mixture_diffusion(self):
|
||||
j = self.gas.species_index("H3O+")
|
||||
mdiff = self.gas.mix_diff_coeffs[j]
|
||||
# Regression test
|
||||
self.assertNear(mdiff, 5.057e-4, 1e-4)
|
||||
|
||||
|
||||
class TestTransportGeometryFlags(utilities.CanteraTest):
|
||||
phase_data = """
|
||||
units(length="cm", time="s", quantity="mol", act_energy="cal/mol")
|
||||
|
|
@ -261,3 +284,22 @@ class TestTransportData(utilities.CanteraTest):
|
|||
self.assertNear(tr1.dipole, tr2.dipole)
|
||||
self.assertNear(tr1.polarizability, tr2.polarizability)
|
||||
self.assertNear(tr1.rotational_relaxation, tr2.rotational_relaxation)
|
||||
|
||||
|
||||
class TestIonGasTransportData(utilities.CanteraTest):
|
||||
def setUp(self):
|
||||
self.gas = ct.Solution('ch4_ion.cti')
|
||||
|
||||
def test_read_ion(self):
|
||||
tr = self.gas.species('N2').transport
|
||||
self.assertNear(tr.dispersion_coefficient, 2.995e-50)
|
||||
self.assertNear(tr.quadrupole_polarizability, 3.602e-50)
|
||||
|
||||
def test_set_customary_units(self):
|
||||
tr1 = ct.GasTransportData()
|
||||
tr1.set_customary_units('linear', 3.62, 97.53, 1.76,
|
||||
dispersion_coefficient = 2.995,
|
||||
quadrupole_polarizability = 3.602)
|
||||
tr2 = self.gas.species('N2').transport
|
||||
self.assertNear(tr1.dispersion_coefficient, tr2.dispersion_coefficient)
|
||||
self.assertNear(tr1.quadrupole_polarizability, tr2.quadrupole_polarizability)
|
||||
|
|
|
|||
|
|
@ -144,7 +144,9 @@ species(name = "N2",
|
|||
diam = 3.62,
|
||||
well_depth = 97.53,
|
||||
polar = 1.76,
|
||||
rot_relax = 4.00),
|
||||
rot_relax = 4.00,
|
||||
disp_coeff = 2.995,
|
||||
quad_polar = 3.602),
|
||||
note = "121286"
|
||||
)
|
||||
|
||||
|
|
@ -161,8 +163,9 @@ species(name = 'HCO+',
|
|||
transport=gas_transport(geom='linear',
|
||||
diam=3.59,
|
||||
well_depth=498.0,
|
||||
polar=2.5,
|
||||
rot_relax=0.0),
|
||||
polar=1.356,
|
||||
rot_relax=0.0,
|
||||
disp_coeff = 0.416),
|
||||
note = 'J12/70')
|
||||
|
||||
species(name = 'H3O+',
|
||||
|
|
@ -176,11 +179,11 @@ species(name = 'H3O+',
|
|||
7.097291130E+04, 7.458507790E+00] )
|
||||
),
|
||||
transport=gas_transport(geom='nonlinear',
|
||||
diam=2.605,
|
||||
well_depth=572.4,
|
||||
dipole=1.844,
|
||||
polar=1.5,
|
||||
rot_relax=2.1),
|
||||
diam=3.15,
|
||||
well_depth=106.2,
|
||||
dipole=1.417,
|
||||
polar=0.897,
|
||||
rot_relax=0.0),
|
||||
note = 'TPIS89')
|
||||
|
||||
species(name = 'E',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue