@@ -20,6 +20,11 @@ def get_battery(model, name)
2020 end
2121 end
2222
23+ def calc_nom_capacity ( battery )
24+ return ( battery . numberofCellsinSeries * battery . numberofStringsinParallel *
25+ battery . cellVoltageatEndofNominalZone * battery . fullyChargedCellCapacity )
26+ end
27+
2328 def test_battery_default
2429 args_hash = { }
2530 args_hash [ 'hpxml_path' ] = File . absolute_path ( File . join ( sample_files_dir , 'base-misc-defaults.xml' ) )
@@ -32,11 +37,12 @@ def test_battery_default
3237 assert ( !battery . thermalZone . is_initialized )
3338 assert_equal ( 0 , battery . radiativeFraction )
3439 assert_equal ( HPXML ::BatteryLifetimeModelNone , battery . lifetimeModel )
35- assert_in_epsilon ( 14 , battery . numberofCellsinSeries , 0.01 )
36- assert_in_epsilon ( 63 , battery . numberofStringsinParallel , 0.01 )
40+ assert_in_epsilon ( 15 , battery . numberofCellsinSeries , 0.01 )
41+ assert_in_epsilon ( 62 , battery . numberofStringsinParallel , 0.01 )
3742 assert_in_epsilon ( 0.5 , battery . initialFractionalStateofCharge , 0.01 )
3843 assert_in_epsilon ( 99.0 , battery . batteryMass , 0.01 )
3944 assert_in_epsilon ( 1.42 , battery . batterySurfaceArea , 0.01 )
45+ assert_in_epsilon ( 10000 , calc_nom_capacity ( battery ) , 0.01 )
4046
4147 elcds = model . getElectricLoadCenterDistributions
4248 assert_equal ( 1 , elcds . size )
@@ -78,11 +84,12 @@ def test_pv_battery_outside
7884 assert ( !battery . thermalZone . is_initialized )
7985 assert_equal ( 0 , battery . radiativeFraction )
8086 assert_equal ( HPXML ::BatteryLifetimeModelNone , battery . lifetimeModel )
81- assert_in_epsilon ( 14 , battery . numberofCellsinSeries , 0.01 )
87+ assert_in_epsilon ( 15 , battery . numberofCellsinSeries , 0.01 )
8288 assert_in_epsilon ( 125 , battery . numberofStringsinParallel , 0.01 )
8389 assert_in_epsilon ( 0.5 , battery . initialFractionalStateofCharge , 0.01 )
8490 assert_in_epsilon ( 198.0 , battery . batteryMass , 0.01 )
8591 assert_in_epsilon ( 2.25 , battery . batterySurfaceArea , 0.01 )
92+ assert_in_epsilon ( 20000 , calc_nom_capacity ( battery ) , 0.01 )
8693
8794 elcds = model . getElectricLoadCenterDistributions
8895 assert_equal ( 1 , elcds . size )
@@ -109,11 +116,12 @@ def test_pv_battery_outside_degrades
109116 assert ( !battery . thermalZone . is_initialized )
110117 assert_equal ( 0 , battery . radiativeFraction )
111118 assert_equal ( HPXML ::BatteryLifetimeModelKandlerSmith , battery . lifetimeModel )
112- assert_in_epsilon ( 14 , battery . numberofCellsinSeries , 0.01 )
119+ assert_in_epsilon ( 15 , battery . numberofCellsinSeries , 0.01 )
113120 assert_in_epsilon ( 125 , battery . numberofStringsinParallel , 0.01 )
114121 assert_in_epsilon ( 0.5 , battery . initialFractionalStateofCharge , 0.01 )
115122 assert_in_epsilon ( 198.0 , battery . batteryMass , 0.01 )
116123 assert_in_epsilon ( 2.25 , battery . batterySurfaceArea , 0.01 )
124+ assert_in_epsilon ( 20000 , calc_nom_capacity ( battery ) , 0.01 )
117125
118126 elcds = model . getElectricLoadCenterDistributions
119127 assert_equal ( 1 , elcds . size )
@@ -141,11 +149,12 @@ def test_pv_battery_garage
141149 assert_equal ( HPXML ::LocationGarage , battery . thermalZone . get . name . to_s )
142150 assert_equal ( 0.9 , battery . radiativeFraction )
143151 assert_equal ( HPXML ::BatteryLifetimeModelNone , battery . lifetimeModel )
144- assert_in_epsilon ( 14 , battery . numberofCellsinSeries , 0.01 )
152+ assert_in_epsilon ( 15 , battery . numberofCellsinSeries , 0.01 )
145153 assert_in_epsilon ( 125 , battery . numberofStringsinParallel , 0.01 )
146154 assert_in_epsilon ( 0.5 , battery . initialFractionalStateofCharge , 0.01 )
147155 assert_in_epsilon ( 198.0 , battery . batteryMass , 0.01 )
148156 assert_in_epsilon ( 2.25 , battery . batterySurfaceArea , 0.01 )
157+ assert_in_epsilon ( 20000 , calc_nom_capacity ( battery ) , 0.01 )
149158
150159 elcds = model . getElectricLoadCenterDistributions
151160 assert_equal ( 1 , elcds . size )
@@ -172,11 +181,12 @@ def test_pv_battery_ah
172181 assert ( !battery . thermalZone . is_initialized )
173182 assert_equal ( 0 , battery . radiativeFraction )
174183 assert_equal ( HPXML ::BatteryLifetimeModelNone , battery . lifetimeModel )
175- assert_in_epsilon ( 14 , battery . numberofCellsinSeries , 0.01 )
184+ assert_in_epsilon ( 15 , battery . numberofCellsinSeries , 0.01 )
176185 assert_in_epsilon ( 125 , battery . numberofStringsinParallel , 0.01 )
177186 assert_in_epsilon ( 0.5 , battery . initialFractionalStateofCharge , 0.01 )
178187 assert_in_epsilon ( 198.0 , battery . batteryMass , 0.01 )
179188 assert_in_epsilon ( 2.25 , battery . batterySurfaceArea , 0.01 )
189+ assert_in_epsilon ( 20000 , calc_nom_capacity ( battery ) , 0.01 )
180190
181191 elcds = model . getElectricLoadCenterDistributions
182192 assert_equal ( 1 , elcds . size )
0 commit comments