From db5d8526834ac6533884358a1267b33dc4f00072 Mon Sep 17 00:00:00 2001 From: sjanzou Date: Mon, 6 May 2024 04:20:13 -0600 Subject: [PATCH] Testing SOL-853 branch from Solesca --- test/input_json/solesca/sam_pv_test _out.json | 3 + test/input_json/solesca/sam_pv_test.json | 649 ++++++++++++++++++ test/main.cpp | 2 +- test/ssc_test/cmod_solesca_test .cpp | 222 ------ test/ssc_test/solesca_test.cpp | 51 ++ .../{cmod_solesca_test .h => solesca_test.h} | 6 +- 6 files changed, 707 insertions(+), 226 deletions(-) create mode 100644 test/input_json/solesca/sam_pv_test _out.json create mode 100644 test/input_json/solesca/sam_pv_test.json delete mode 100644 test/ssc_test/cmod_solesca_test .cpp create mode 100644 test/ssc_test/solesca_test.cpp rename test/ssc_test/{cmod_solesca_test .h => solesca_test.h} (90%) diff --git a/test/input_json/solesca/sam_pv_test _out.json b/test/input_json/solesca/sam_pv_test _out.json new file mode 100644 index 000000000..20eaf753d --- /dev/null +++ b/test/input_json/solesca/sam_pv_test _out.json @@ -0,0 +1,3 @@ +{ + "annual_energy" : 114692836 +} diff --git a/test/input_json/solesca/sam_pv_test.json b/test/input_json/solesca/sam_pv_test.json new file mode 100644 index 000000000..bede02a1d --- /dev/null +++ b/test/input_json/solesca/sam_pv_test.json @@ -0,0 +1,649 @@ +{ + "system_capacity": 58.0, + "inverter_count": 2.0, + "module_aspect_ratio": 2.0088183421516757, + "cec_area": 2.583252, + "cec_module_width": 1.134, + "cec_module_length": 2.278, + "cec_array_rows": 3625.0, + "cec_array_cols": 16.0, + "cec_a_ref": 1.8351479143789893, + "cec_adjust": -2.552155159450266, + "cec_alpha_sc": 0.006277499999999999, + "cec_beta_oc": -0.134925, + "cec_gamma_r": -0.295, + "cec_i_l_ref": 13.95988595931069, + "cec_i_mp_ref": 13.22, + "cec_i_o_ref": 5.1892594323295635e-12, + "cec_i_sc_ref": 13.95, + "cec_n_s": 72.0, + "cec_r_s": 0.2133628795699933, + "cec_r_sh_ref": 301.0746942030055, + "cec_t_noct": 45.0, + "cec_v_mp_ref": 43.88, + "cec_v_oc_ref": 52.5, + "cec_is_bifacial": 1.0, + "cec_temp_corr_mode": 0.0, + "cec_bifacial_transmission_factor": 0.013, + "cec_bifaciality": 0.75, + "cec_bifacial_ground_clearance_height": 2.0, + "cec_standoff": 6.0, + "cec_height": 0.0, + "cec_mounting_config": 0.0, + "cec_heat_transfer": 0.0, + "cec_mounting_orientation": 0.0, + "cec_gap_spacing": 0.05, + "cec_backside_temp": 20.0, + "cec_transient_thermal_model_unit_mass": 11.09, + "transformer_no_load_loss": 0.0, + "transformer_load_loss": 0.0, + "en_snow_model": 0.0, + "use_wf_albedo": 1.0, + "use_spatial_albedos": 0.0, + "albedo": [ + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2 + ], + "albedo_spatial": [ + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2, + 0.2 + ], + "irrad_mode": 0.0, + "sky_model": 2.0, + "enable_mismatch_vmax_calc": 1.0, + "calculate_rack_shading": 1.0, + "calculate_bifacial_electrical_mismatch": 0.0, + "subarray1_shading_diff": 0.0, + "subarray1_shading_mxh": [ + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ] + ], + "subarray1_nstrings": 7.0, + "subarray1_modules_per_string": 16.0, + "subarray1_mppt_input": 1.0, + "subarray1_tilt": 30.0, + "subarray1_tilt_eq_lat": 0.0, + "subarray1_azimuth": 180.0, + "subarray1_track_mode": 0.0, + "subarray1_rotlim": 45.0, + "subarray1_shade_mode": 1.0, + "subarray1_gcr": 0.5695, + "subarray1_slope_tilt": 0.0, + "subarray1_slope_azm": 0.0, + "subarray1_monthly_tilt": [ + 40.0, + 40.0, + 40.0, + 20.0, + 20.0, + 20.0, + 20.0, + 20.0, + 20.0, + 40.0, + 40.0, + 40.0 + ], + "subarray1_soiling": [ + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0 + ], + "subarray1_rear_soiling_loss": 0.0, + "subarray1_rack_shading": 0.0, + "subarray1_mismatch_loss": 2.0, + "subarray1_diodeconn_loss": 0.5, + "subarray1_dcwiring_loss": 2.0, + "subarray1_tracking_loss": 0.0, + "subarray1_nameplate_loss": 0.0, + "subarray1_electrical_mismatch": 0.0, + "subarray1_mod_orient": 0.0, + "subarray1_nmodx": 10.0, + "subarray1_nmody": 1.0, + "subarray1_backtrack": 0.0, + "subarray2_enable": 0.0, + "subarray2_nstrings": 7.0, + "subarray2_modules_per_string": 16.0, + "subarray2_mppt_input": 1.0, + "subarray2_tilt": 30.0, + "subarray2_tilt_eq_lat": 0.0, + "subarray2_azimuth": 180.0, + "subarray2_track_mode": 0.0, + "subarray2_rotlim": 45.0, + "subarray2_shade_mode": 1.0, + "subarray2_gcr": 0.5695, + "subarray2_slope_tilt": 0.0, + "subarray2_slope_azm": 0.0, + "subarray2_monthly_tilt": [ + 40.0, + 40.0, + 40.0, + 20.0, + 20.0, + 20.0, + 20.0, + 20.0, + 20.0, + 40.0, + 40.0, + 40.0 + ], + "subarray2_soiling": [ + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0, + 2.0 + ], + "subarray2_rear_soiling_loss": 0.0, + "subarray2_rack_shading": 0.0, + "subarray2_mismatch_loss": 2.0, + "subarray2_diodeconn_loss": 0.5, + "subarray2_dcwiring_loss": 2.0, + "subarray2_tracking_loss": 0.0, + "subarray2_nameplate_loss": 0.0, + "subarray2_electrical_mismatch": 0.0, + "subarray2_mod_orient": 0.0, + "subarray2_nmodx": 10.0, + "subarray2_nmody": 1.0, + "subarray2_backtrack": 0.0, + "subarray3_enable": 0.0, + "subarray4_enable": 0.0, + "dcoptimizer_loss": 0.0, + "acwiring_loss": 1.0, + "transmission_loss": 0.0, + "module_model": 1.0, + "inverter_model": 1.0, + "mppt_low_inverter": 450.0, + "mppt_hi_inverter": 800.0, + "inv_num_mppt": 1.0, + "inv_cec_cg_c0": 0.0, + "inv_cec_cg_c1": 0.0, + "inv_cec_cg_c2": 0.0, + "inv_cec_cg_c3": 0.0, + "inv_cec_cg_paco": 0.0, + "inv_cec_cg_pdco": 0.0, + "inv_cec_cg_pnt": 0.0, + "inv_cec_cg_psco": 0.0, + "inv_cec_cg_vdco": 0.0, + "inv_cec_cg_vdcmax": 0.0, + "inv_cec_cg_eff_cec": 0.0, + "inv_tdc_cec_cg": [ + 1300.0, + 50.0, + -0.02, + 53.0, + -0.47 + ], + "inv_ds_paco": 24000.0, + "inv_ds_eff": 98.0, + "inv_ds_pnt": 1.79, + "inv_ds_pso": 46.660604748907716, + "inv_ds_vdco": 712.0, + "inv_ds_vdcmax": 800.0, + "inv_tdc_ds": [ + 1300.0, + 50.0, + -0.02, + 53.0, + -0.47 + ], + "en_batt": 0.0, + "compute_module_name": "pvsamv1", + "adjust_constant": 0.0, + "dc_adjust_constant": 10.71428571428571 +} \ No newline at end of file diff --git a/test/main.cpp b/test/main.cpp index eafe1a724..dd9867e67 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -57,7 +57,7 @@ GTEST_API_ int main(int argc, char **argv) { //::testing::GTEST_FLAG(filter) = "CmodHybridTest*"; // ::testing::GTEST_FLAG(filter) = "CmodCashLoanTest*:CmodSingleOwnerTest*"; - //::testing::GTEST_FLAG(filter) = "CMGeothermal*:GeothermalPlantAnalyzer*"; + ::testing::GTEST_FLAG(filter) = "Solesca*"; // filter to exclude // ::testing::GTEST_FLAG(filter) = "-PVSmoothing_lib_battery_dispatch*"; diff --git a/test/ssc_test/cmod_solesca_test .cpp b/test/ssc_test/cmod_solesca_test .cpp deleted file mode 100644 index 6b549c9b2..000000000 --- a/test/ssc_test/cmod_solesca_test .cpp +++ /dev/null @@ -1,222 +0,0 @@ -/* -BSD 3-Clause License - -Copyright (c) Alliance for Sustainable Energy, LLC. See also https://github.com/NREL/ssc/blob/develop/LICENSE -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -#include "cmod_levpartflip_test.h" - -#include "gtest/gtest.h" - - -TEST_F(CmodLeveragedPartnershipFlipTest, Biopower) { - std::string file_inputs = SSCDIR; - file_inputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Biopower_Leveraged_Partnership_Flip_cmod_levpartflip.json"; - std::string file_outputs = SSCDIR; - file_outputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Biopower_Leveraged_Partnership_Flip_cmod_levpartflip_outputs.json"; - std::vector compare_number_variables = { "ppa", "tax_investor_aftertax_npv", "sponsor_aftertax_npv", "lcoe_real", "lppa_nom"}; - std::vector compare_array_variables = {"cf_tax_investor_aftertax", "cf_sponsor_aftertax", "cf_annual_costs"}; - - Test("levpartflip", file_inputs, file_outputs, compare_number_variables, compare_array_variables); -} - -TEST_F(CmodLeveragedPartnershipFlipTest, DSLF) { - std::string file_inputs = SSCDIR; - file_inputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_DSLF_Leveraged_Partnership_Flip_cmod_levpartflip.json"; - std::string file_outputs = SSCDIR; - file_outputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_DSLF_Leveraged_Partnership_Flip_cmod_levpartflip_outputs.json"; - std::vector compare_number_variables = { "ppa", "tax_investor_aftertax_npv", "sponsor_aftertax_npv", "lcoe_real", "lppa_nom"}; - std::vector compare_array_variables = {"cf_tax_investor_aftertax", "cf_sponsor_aftertax", "cf_annual_costs"}; - - Test("levpartflip", file_inputs, file_outputs, compare_number_variables, compare_array_variables); -} - -TEST_F(CmodLeveragedPartnershipFlipTest, EmpiricalTrough) { - std::string file_inputs = SSCDIR; - file_inputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Empirical_Trough_Leveraged_Partnership_Flip_cmod_levpartflip.json"; - std::string file_outputs = SSCDIR; - file_outputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Empirical_Trough_Leveraged_Partnership_Flip_cmod_levpartflip_outputs.json"; - std::vector compare_number_variables = { "ppa", "tax_investor_aftertax_npv", "sponsor_aftertax_npv", "lcoe_real", "lppa_nom"}; - std::vector compare_array_variables = {"cf_tax_investor_aftertax", "cf_sponsor_aftertax", "cf_annual_costs"}; - - Test("levpartflip", file_inputs, file_outputs, compare_number_variables, compare_array_variables); -} - - -TEST_F(CmodLeveragedPartnershipFlipTest, PV) { - std::string file_inputs = SSCDIR; - file_inputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Flat_Plate_PV_Leveraged_Partnership_Flip_cmod_levpartflip.json"; - std::string file_outputs = SSCDIR; - file_outputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Flat_Plate_PV_Leveraged_Partnership_Flip_cmod_levpartflip_outputs.json"; - std::vector compare_number_variables = { "ppa", "tax_investor_aftertax_npv", "sponsor_aftertax_npv", "lcoe_real", "lppa_nom"}; - std::vector compare_array_variables = {"cf_tax_investor_aftertax", "cf_sponsor_aftertax", "cf_annual_costs"}; - - Test("levpartflip", file_inputs, file_outputs, compare_number_variables, compare_array_variables); -} - - -TEST_F(CmodLeveragedPartnershipFlipTest, GenericBattery) { - std::string file_inputs = SSCDIR; - file_inputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Generic_Battery_Leveraged_Partnership_Flip_cmod_levpartflip.json"; - std::string file_outputs = SSCDIR; - file_outputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Generic_Battery_Leveraged_Partnership_Flip_cmod_levpartflip_outputs.json"; - std::vector compare_number_variables = { "ppa", "tax_investor_aftertax_npv", "sponsor_aftertax_npv", "lcoe_real", "lppa_nom"}; - std::vector compare_array_variables = {"cf_tax_investor_aftertax", "cf_sponsor_aftertax", "cf_annual_costs"}; - - Test("levpartflip", file_inputs, file_outputs, compare_number_variables, compare_array_variables); -} - -TEST_F(CmodLeveragedPartnershipFlipTest, GenericCSP) { - std::string file_inputs = SSCDIR; - file_inputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Generic_CSP_System_Leveraged_Partnership_Flip_cmod_levpartflip.json"; - std::string file_outputs = SSCDIR; - file_outputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Generic_CSP_System_Leveraged_Partnership_Flip_cmod_levpartflip_outputs.json"; - std::vector compare_number_variables = { "ppa", "tax_investor_aftertax_npv", "sponsor_aftertax_npv", "lcoe_real", "lppa_nom"}; - std::vector compare_array_variables = {"cf_tax_investor_aftertax", "cf_sponsor_aftertax", "cf_annual_costs"}; - - Test("levpartflip", file_inputs, file_outputs, compare_number_variables, compare_array_variables); -} - -TEST_F(CmodLeveragedPartnershipFlipTest, Generic) { - std::string file_inputs = SSCDIR; - file_inputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Generic_System_Leveraged_Partnership_Flip_cmod_levpartflip.json"; - std::string file_outputs = SSCDIR; - file_outputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Generic_System_Leveraged_Partnership_Flip_cmod_levpartflip_outputs.json"; - std::vector compare_number_variables = { "ppa", "tax_investor_aftertax_npv", "sponsor_aftertax_npv", "lcoe_real", "lppa_nom"}; - std::vector compare_array_variables = {"cf_tax_investor_aftertax", "cf_sponsor_aftertax", "cf_annual_costs"}; - - Test("levpartflip", file_inputs, file_outputs, compare_number_variables, compare_array_variables); -} - - -TEST_F(CmodLeveragedPartnershipFlipTest, Geotherrmal) { - std::string file_inputs = SSCDIR; - file_inputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Geothermal_Power_Leveraged_Partnership_Flip_cmod_levpartflip.json"; - std::string file_outputs = SSCDIR; - file_outputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Geothermal_Power_Leveraged_Partnership_Flip_cmod_levpartflip_outputs.json"; - std::vector compare_number_variables = { "ppa", "tax_investor_aftertax_npv", "sponsor_aftertax_npv", "lcoe_real", "lppa_nom"}; - std::vector compare_array_variables = {"cf_tax_investor_aftertax", "cf_sponsor_aftertax", "cf_annual_costs"}; - - Test("levpartflip", file_inputs, file_outputs, compare_number_variables, compare_array_variables); -} - -TEST_F(CmodLeveragedPartnershipFlipTest, CPV) { - std::string file_inputs = SSCDIR; - file_inputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_High-X_Concentrating_PV_Leveraged_Partnership_Flip_cmod_levpartflip.json"; - std::string file_outputs = SSCDIR; - file_outputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_High-X_Concentrating_PV_Leveraged_Partnership_Flip_cmod_levpartflip_outputs.json"; - std::vector compare_number_variables = { "ppa", "tax_investor_aftertax_npv", "sponsor_aftertax_npv", "lcoe_real", "lppa_nom"}; - std::vector compare_array_variables = {"cf_tax_investor_aftertax", "cf_sponsor_aftertax", "cf_annual_costs"}; - - Test("levpartflip", file_inputs, file_outputs, compare_number_variables, compare_array_variables); -} - - -TEST_F(CmodLeveragedPartnershipFlipTest, MSLF) { - std::string file_inputs = SSCDIR; - file_inputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_MSLF_Leveraged_Partnership_Flip_cmod_levpartflip.json"; - std::string file_outputs = SSCDIR; - file_outputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_MSLF_Leveraged_Partnership_Flip_cmod_levpartflip_outputs.json"; - std::vector compare_number_variables = { "ppa", "tax_investor_aftertax_npv", "sponsor_aftertax_npv", "lcoe_real", "lppa_nom"}; - std::vector compare_array_variables = {"cf_tax_investor_aftertax", "cf_sponsor_aftertax", "cf_annual_costs"}; - - Test("levpartflip", file_inputs, file_outputs, compare_number_variables, compare_array_variables); -} - -TEST_F(CmodLeveragedPartnershipFlipTest, MSPT) { - std::string file_inputs = SSCDIR; - file_inputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_MSPT_Leveraged_Partnership_Flip_cmod_levpartflip.json"; - std::string file_outputs = SSCDIR; - file_outputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_MSPT_Leveraged_Partnership_Flip_cmod_levpartflip_outputs.json"; - std::vector compare_number_variables = { "ppa", "tax_investor_aftertax_npv", "sponsor_aftertax_npv", "lcoe_real", "lppa_nom"}; - std::vector compare_array_variables = {"cf_tax_investor_aftertax", "cf_sponsor_aftertax", "cf_annual_costs"}; - - Test("levpartflip", file_inputs, file_outputs, compare_number_variables, compare_array_variables); -} - -TEST_F(CmodLeveragedPartnershipFlipTest, PhysicalTrough) { - std::string file_inputs = SSCDIR; - file_inputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Physical_Trough_Leveraged_Partnership_Flip_cmod_levpartflip.json"; - std::string file_outputs = SSCDIR; - file_outputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Physical_Trough_Leveraged_Partnership_Flip_cmod_levpartflip_outputs.json"; - std::vector compare_number_variables = { "ppa", "tax_investor_aftertax_npv", "sponsor_aftertax_npv", "lcoe_real", "lppa_nom"}; - std::vector compare_array_variables = {"cf_tax_investor_aftertax", "cf_sponsor_aftertax", "cf_annual_costs"}; - - Test("levpartflip", file_inputs, file_outputs, compare_number_variables, compare_array_variables); -} - - -TEST_F(CmodLeveragedPartnershipFlipTest, PVBattery) { - std::string file_inputs = SSCDIR; - file_inputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_PV_Battery_Leveraged_Partnership_Flip_cmod_levpartflip.json"; - std::string file_outputs = SSCDIR; - file_outputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_PV_Battery_Leveraged_Partnership_Flip_cmod_levpartflip_outputs.json"; - std::vector compare_number_variables = { "ppa", "tax_investor_aftertax_npv", "sponsor_aftertax_npv", "lcoe_real", "lppa_nom"}; - std::vector compare_array_variables = {"cf_tax_investor_aftertax", "cf_sponsor_aftertax", "cf_annual_costs"}; - - Test("levpartflip", file_inputs, file_outputs, compare_number_variables, compare_array_variables); -} - - -TEST_F(CmodLeveragedPartnershipFlipTest, PVWatts) { - std::string file_inputs = SSCDIR; - file_inputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_PVWatts_Leveraged_Partnership_Flip_cmod_levpartflip.json"; - std::string file_outputs = SSCDIR; - file_outputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_PVWatts_Leveraged_Partnership_Flip_cmod_levpartflip_outputs.json"; - std::vector compare_number_variables = { "ppa", "tax_investor_aftertax_npv", "sponsor_aftertax_npv", "lcoe_real", "lppa_nom"}; - std::vector compare_array_variables = {"cf_tax_investor_aftertax", "cf_sponsor_aftertax", "cf_annual_costs"}; - - Test("levpartflip", file_inputs, file_outputs, compare_number_variables, compare_array_variables); -} - -TEST_F(CmodLeveragedPartnershipFlipTest, StandaloneBattery) { - std::string file_inputs = SSCDIR; - file_inputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Standalone_Battery_Leveraged_Partnership_Flip_cmod_levpartflip.json"; - std::string file_outputs = SSCDIR; - file_outputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Standalone_Battery_Leveraged_Partnership_Flip_cmod_levpartflip_outputs.json"; - std::vector compare_number_variables = { "ppa", "tax_investor_aftertax_npv", "sponsor_aftertax_npv", "lcoe_real", "lppa_nom"}; - std::vector compare_array_variables = {"cf_tax_investor_aftertax", "cf_sponsor_aftertax", "cf_annual_costs"}; - - Test("levpartflip", file_inputs, file_outputs, compare_number_variables, compare_array_variables); -} - - -TEST_F(CmodLeveragedPartnershipFlipTest, Wind) { - std::string file_inputs = SSCDIR; - file_inputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Wind_Power_Leveraged_Partnership_Flip_cmod_levpartflip.json"; - std::string file_outputs = SSCDIR; - file_outputs += "/test/input_json/FinancialModels/levpartflip/2023.10.27_om-expense-cash-flow_Wind_Power_Leveraged_Partnership_Flip_cmod_levpartflip_outputs.json"; - std::vector compare_number_variables = { "ppa", "tax_investor_aftertax_npv", "sponsor_aftertax_npv", "lcoe_real", "lppa_nom"}; - std::vector compare_array_variables = {"cf_tax_investor_aftertax", "cf_sponsor_aftertax", "cf_annual_costs"}; - - Test("levpartflip", file_inputs, file_outputs, compare_number_variables, compare_array_variables); -} - - diff --git a/test/ssc_test/solesca_test.cpp b/test/ssc_test/solesca_test.cpp new file mode 100644 index 000000000..4d0134081 --- /dev/null +++ b/test/ssc_test/solesca_test.cpp @@ -0,0 +1,51 @@ +/* +BSD 3-Clause License + +Copyright (c) Alliance for Sustainable Energy, LLC. See also https://github.com/NREL/ssc/blob/develop/LICENSE +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +#include "solesca_test.h" + +#include "gtest/gtest.h" + +// from branch SOL-853 +TEST_F(SolescaTest, sam_pv_test) { + std::string file_inputs = SSCDIR; + file_inputs += "/test/input_json/solesca/sam_pv_test.json"; + std::string file_outputs = SSCDIR; + file_outputs += "/test/input_json/solesca/sam_pv_test_out.json"; + std::vector compare_number_variables = { "annual_energy"}; + std::vector compare_array_variables; + + Test("pvsamv1", file_inputs, file_outputs, compare_number_variables, compare_array_variables); +} + + + diff --git a/test/ssc_test/cmod_solesca_test .h b/test/ssc_test/solesca_test.h similarity index 90% rename from test/ssc_test/cmod_solesca_test .h rename to test/ssc_test/solesca_test.h index dce2506b3..6ad57a586 100644 --- a/test/ssc_test/cmod_solesca_test .h +++ b/test/ssc_test/solesca_test.h @@ -32,11 +32,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef SYSTEM_ADVISOR_MODEL_CMOD_LEVPARTFLIP_TEST_H -#define SYSTEM_ADVISOR_MODEL_CMOD_LEVPARTFLIP_TEST_H +#ifndef SOLESCA_TEST_H +#define SOLESCA_TEST_H #include "cmod_json_comparison_test.h" -class CmodLeveragedPartnershipFlipTest : public JSONComparisonTest {}; +class SolescaTest : public JSONComparisonTest {}; #endif //SYSTEM_ADVISOR_MODEL_CMOD_LEVPARTFLIP_TEST_H