Skip to content

Commit 3df7491

Browse files
committed
get rid of numerical issue
1 parent 29c6775 commit 3df7491

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

particula/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# u is the unit registry name.
2121
u = UnitRegistry(force_ndarray=True)
2222

23-
__version__ = "0.0.18"
23+
__version__ = "0.0.20"
2424

2525
# setup the logger
2626
logger = setup()

particula/next/dynamics/coagulation/tests/kernel_test.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
# Define constants for common test data
77

8-
DIFFUSIVE_KNUDSEN = np.array([0.1, 0.5, 1.0, 5.0, 10.0])
9-
COULOMB_POTENTIAL_RATIO_ARRAY = np.array([0.0, 0.7, 0.9, 1.0, 1.1])
8+
DIFFUSIVE_KNUDSEN = np.array([0.5, 1.0, 5.0, 10.0])
9+
COULOMB_POTENTIAL_RATIO_ARRAY = np.array([0.7, 0.9, 1.0, 1.1])
1010

1111

1212
def test_kernel_call():
@@ -41,7 +41,7 @@ def test_hard_sphere():
4141
dimensionless_result = kernel_concrete.dimensionless(
4242
DIFFUSIVE_KNUDSEN, COULOMB_POTENTIAL_RATIO_ARRAY)
4343
expected_result = np.array(
44-
[0.1096043, 1.65971644, 4.12694075, 24.16690909, 49.22484307])
44+
[1.65971644, 4.12694075, 24.16690909, 49.22484307])
4545
np.testing.assert_almost_equal(
4646
dimensionless_result, expected_result, decimal=4)
4747

@@ -56,7 +56,7 @@ def test_coulomb_dyachkov2007():
5656
dimensionless_result = kernel_concrete.dimensionless(
5757
DIFFUSIVE_KNUDSEN, COULOMB_POTENTIAL_RATIO_ARRAY)
5858
expected_result = np.array(
59-
[0.10047769, 1.73703563, 4.60921277, 26.22159795, 51.92102133])
59+
[1.73703563, 4.60921277, 26.22159795, 51.92102133])
6060
np.testing.assert_almost_equal(
6161
dimensionless_result, expected_result, decimal=4)
6262

@@ -71,7 +71,7 @@ def test_coulomb_gatti2008():
7171
dimensionless_result = kernel_concrete.dimensionless(
7272
DIFFUSIVE_KNUDSEN, COULOMB_POTENTIAL_RATIO_ARRAY)
7373
expected_result = np.array(
74-
[0.50132565, 2.00132915, 5.10865767, 26.42422258, 52.43789491])
74+
[2.00132915, 5.10865767, 26.42422258, 52.43789491])
7575
np.testing.assert_almost_equal(
7676
dimensionless_result, expected_result, decimal=4)
7777

@@ -86,7 +86,7 @@ def test_coulomb_gopalakrishnan2012():
8686
dimensionless_result = kernel_concrete.dimensionless(
8787
DIFFUSIVE_KNUDSEN, COULOMB_POTENTIAL_RATIO_ARRAY)
8888
expected_result = np.array(
89-
[0.1096043, 1.83746548, 4.83694019, 24.16690909, 49.22484307])
89+
[1.83746548, 4.83694019, 24.16690909, 49.22484307])
9090
np.testing.assert_almost_equal(
9191
dimensionless_result, expected_result, decimal=4)
9292

@@ -101,6 +101,6 @@ def test_coulomb_chahl2019():
101101
dimensionless_result = kernel_concrete.dimensionless(
102102
DIFFUSIVE_KNUDSEN, COULOMB_POTENTIAL_RATIO_ARRAY)
103103
expected_result = np.array(
104-
[0.10960427, 1.65863442, 4.37444613, 28.05501739, 59.74082667])
104+
[1.65863442, 4.37444613, 28.05501739, 59.74082667])
105105
np.testing.assert_almost_equal(
106106
dimensionless_result, expected_result, decimal=4)

particula/next/dynamics/coagulation/tests/transition_regime_test.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
COULOMB_POTENTIAL_RATIO_SINGLE = 0.5
1010

1111
# test array
12-
DIFFUSIVE_KNUDSEN_ARRAY = np.array([0.1, 0.5, 1.0, 5.0, 10.0])
13-
COULOMB_POTENTIAL_RATIO_ARRAY = np.array([0.0, 0.7, 0.9, 1.0, 1.1])
12+
DIFFUSIVE_KNUDSEN_ARRAY = np.array([0.5, 1.0, 5.0, 10.0])
13+
COULOMB_POTENTIAL_RATIO_ARRAY = np.array([0.7, 0.9, 1.0, 1.1])
1414

1515

1616
def test_hard_sphere():
@@ -24,7 +24,7 @@ def test_hard_sphere():
2424
np.testing.assert_almost_equal(result_single, expected_single, decimal=4)
2525
# array
2626
expected = np.array(
27-
[0.1096043, 1.65971644, 4.12694075, 24.16690909, 49.22484307])
27+
[1.65971644, 4.12694075, 24.16690909, 49.22484307])
2828
result = transition_regime.hard_sphere(DIFFUSIVE_KNUDSEN_ARRAY)
2929
np.testing.assert_almost_equal(result, expected, decimal=4)
3030

@@ -41,7 +41,7 @@ def test_coulomb_dyachkov2007():
4141
np.testing.assert_almost_equal(result_single, expected_single, decimal=4)
4242
# array
4343
expected = np.array(
44-
[0.10047769, 1.73703563, 4.60921277, 26.22159795, 51.92102133])
44+
[1.73703563, 4.60921277, 26.22159795, 51.92102133])
4545
result = transition_regime.coulomb_dyachkov2007(
4646
DIFFUSIVE_KNUDSEN_ARRAY, COULOMB_POTENTIAL_RATIO_ARRAY)
4747
np.testing.assert_almost_equal(result, expected, decimal=4)
@@ -59,7 +59,7 @@ def test_coulomb_gatti2008():
5959
np.testing.assert_almost_equal(result_single, expected_single, decimal=4)
6060
# array
6161
expected = np.array(
62-
[0.50132565, 2.00132915, 5.10865767, 26.42422258, 52.43789491])
62+
[2.00132915, 5.10865767, 26.42422258, 52.43789491])
6363
result = transition_regime.coulomb_gatti2008(
6464
DIFFUSIVE_KNUDSEN_ARRAY, COULOMB_POTENTIAL_RATIO_ARRAY)
6565
np.testing.assert_almost_equal(result, expected, decimal=4)
@@ -77,7 +77,7 @@ def test_coulomb_gopalakrishnan2012():
7777
np.testing.assert_almost_equal(result_single, expected_single, decimal=4)
7878
# array
7979
expected = np.array(
80-
[0.1096043, 1.83746548, 4.83694019, 24.16690909, 49.22484307])
80+
[1.83746548, 4.83694019, 24.16690909, 49.22484307])
8181
result = transition_regime.coulomb_gopalakrishnan2012(
8282
DIFFUSIVE_KNUDSEN_ARRAY, COULOMB_POTENTIAL_RATIO_ARRAY)
8383
np.testing.assert_almost_equal(result, expected, decimal=4)
@@ -95,7 +95,7 @@ def test_coulomb_chahl2019():
9595
np.testing.assert_almost_equal(result_single, expected_single, decimal=4)
9696
# array
9797
expected = np.array(
98-
[0.10960427, 1.65863442, 4.37444613, 28.05501739, 59.74082667])
98+
[1.65863442, 4.37444613, 28.05501739, 59.74082667])
9999
result = transition_regime.coulomb_chahl2019(
100100
DIFFUSIVE_KNUDSEN_ARRAY, COULOMB_POTENTIAL_RATIO_ARRAY)
101101
np.testing.assert_almost_equal(result, expected, decimal=4)

0 commit comments

Comments
 (0)