|
7 | 7 | import linerate
|
8 | 8 |
|
9 | 9 |
|
10 |
| -@pytest.fixture |
11 |
| -def drake_conductor_a(): |
12 |
| - return linerate.Conductor( |
13 |
| - core_diameter=10.4e-3, |
14 |
| - conductor_diameter=28.1e-3, |
15 |
| - outer_layer_strand_diameter=4.4e-3, |
16 |
| - emissivity=0.8, |
17 |
| - solar_absorptivity=0.8, |
18 |
| - temperature1=25, |
19 |
| - temperature2=75, |
20 |
| - resistance_at_temperature2=8.688e-5, |
21 |
| - resistance_at_temperature1=7.283e-5, |
22 |
| - aluminium_cross_section_area=float("nan"), |
23 |
| - constant_magnetic_effect=1, |
24 |
| - current_density_proportional_magnetic_effect=0, |
25 |
| - max_magnetic_core_relative_resistance_increase=1, |
26 |
| - ) |
27 |
| - |
28 |
| - |
29 |
| -@pytest.fixture |
30 |
| -def example_weather_a(): |
31 |
| - return linerate.Weather( |
32 |
| - air_temperature=40, |
33 |
| - wind_direction=np.radians(30), # Conductor azimuth is 90, so 90 - 30 is 30 |
34 |
| - wind_speed=0.61, |
35 |
| - clearness_ratio=1, |
36 |
| - ) |
37 |
| - |
38 |
| - |
39 |
| -@pytest.fixture |
40 |
| -def example_span_a(drake_conductor_a): |
41 |
| - start_tower = linerate.Tower(latitude=30, longitude=0.0001, altitude=0) |
42 |
| - end_tower = linerate.Tower(latitude=30, longitude=-0.0001, altitude=0) |
43 |
| - return linerate.Span( |
44 |
| - conductor=drake_conductor_a, |
45 |
| - start_tower=start_tower, |
46 |
| - end_tower=end_tower, |
47 |
| - ground_albedo=0.1, |
48 |
| - num_conductors=1, |
49 |
| - ) |
50 |
| - |
51 |
| - |
52 |
| -@pytest.fixture |
53 |
| -def example_model_a(example_span_a, example_weather_a): |
54 |
| - return linerate.Cigre601(example_span_a, example_weather_a, np.datetime64("2016-06-10 11:00")) |
55 |
| - |
| 10 | +def test_example_a_convective_cooling(example_model_1_conductors): |
| 11 | + assert example_model_1_conductors.compute_convective_cooling(100, None) == approx(77.6, abs=0.5) |
56 | 12 |
|
57 |
| -def test_example_a_convective_cooling(example_model_a): |
58 |
| - assert example_model_a.compute_convective_cooling(100, None) == approx(77.6, abs=0.5) |
59 | 13 |
|
| 14 | +def test_example_a_radiative_cooling(example_model_1_conductors): |
| 15 | + assert example_model_1_conductors.compute_radiative_cooling(100, None) == approx(39.1, abs=0.5) |
60 | 16 |
|
61 |
| -def test_example_a_radiative_cooling(example_model_a): |
62 |
| - assert example_model_a.compute_radiative_cooling(100, None) == approx(39.1, abs=0.5) |
63 | 17 |
|
| 18 | +def test_example_a_solar_heating(example_model_1_conductors): |
| 19 | + assert example_model_1_conductors.compute_solar_heating(100, None) == approx(27.2, abs=0.5) |
64 | 20 |
|
65 |
| -def test_example_a_solar_heating(example_model_a): |
66 |
| - assert example_model_a.compute_solar_heating(100, None) == approx(27.2, abs=0.5) |
67 | 21 |
|
68 |
| - |
69 |
| -def test_example_a_resistance(example_model_a): |
70 |
| - assert example_model_a.compute_resistance(100, None) == approx(9.3905e-5, abs=0.0001e-5) |
| 22 | +def test_example_a_resistance(example_model_1_conductors): |
| 23 | + assert example_model_1_conductors.compute_resistance(100, None) == approx( |
| 24 | + 9.3905e-5, abs=0.0001e-5 |
| 25 | + ) |
71 | 26 |
|
72 | 27 |
|
73 |
| -def test_example_a_ampacity(example_model_a): |
| 28 | +def test_example_a_ampacity(example_model_1_conductors): |
74 | 29 | # There are noticable roundoff errors in the report
|
75 |
| - assert example_model_a.compute_steady_state_ampacity(100, tolerance=1e-8) == approx( |
| 30 | + assert example_model_1_conductors.compute_steady_state_ampacity(100, tolerance=1e-8) == approx( |
76 | 31 | 976, abs=1.5
|
77 | 32 | )
|
78 | 33 |
|
|
0 commit comments