@@ -92,16 +92,15 @@ def test__vf_ground_sky_2d(test_system_fixed_tilt):
9292 assert np .isclose (vf , vfs_gnd_sky [0 ])
9393
9494
95- def test_vf_ground_sky_2d_integ (test_system_fixed_tilt ):
96- ts , pts , vfs_gnd_sky = test_system_fixed_tilt
97- # pass rotation here since max_rows=1 for the hand-solved case in
98- # the fixture test_system, which means the ground-to-sky view factor
99- # isn't summed over enough rows for symmetry to hold.
100- vf_integ = utils .vf_ground_sky_2d_integ (
101- ts ['rotation' ], ts ['gcr' ], ts ['height' ], ts ['pitch' ],
102- max_rows = 1 , npoints = 3 )
103- expected_vf_integ = trapezoid (vfs_gnd_sky , pts , axis = 0 )
104- assert np .isclose (vf_integ , expected_vf_integ , rtol = 0.1 )
95+ def test_vf_ground_sky_2d_integ ():
96+ # test against numerical integration with vf_ground_sky_2d
97+ x = np .linspace (0 , 1 , num = 1000 )
98+ kwargs = dict (gcr = 0.4 , pitch = 5.0 , height = 1.5 )
99+ vf_x = utils .vf_ground_sky_2d (rotation = - 60 , x = x , ** kwargs )
100+ vf_expected = trapezoid (vf_x , x , axis = 0 )
101+
102+ vf_actual = utils .vf_ground_sky_2d_integ (surface_tilt = 60 , ** kwargs )
103+ assert np .isclose (vf_expected , vf_actual )
105104
106105
107106def test_vf_ground_sky_2d_integ_deprecated ():
0 commit comments