Skip to content

Commit

Permalink
Fix failing SAM_api project and update cashflow for hybrid single owner
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanzou committed Jul 17, 2023
1 parent 25c346e commit 69fa40d
Show file tree
Hide file tree
Showing 27 changed files with 373 additions and 0 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
[0.000000]
],
"adjust_timeindex": [0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000]
},
"HybridTech": {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
[0.000000]
],
"adjust_timeindex": [0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000]
},
"HybridTech": {
}
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions api/api_autogen/library/defaults/Pvwattsv8_PVWattsNone.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions api/api_autogen/library/defaults/Windpower_WindPowerNone.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
},
"Uncertainty": {
"total_uncert": 12.085
},
"HybridTech": {
}
}
}
30 changes: 30 additions & 0 deletions api/include/SAM_Battery.h
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,19 @@ extern "C"
SAM_EXPORT void SAM_Battery_GridLimits_grid_interconnection_limit_kwac_nset(SAM_table ptr, double number, SAM_error *err);


//
// HybridTech parameters
//

/**
* Set is_hybrid: hybrid configuration [0/1]
* options: 0=singletech,1=hybrid
* constraints: None
* required if: ?=0
*/
SAM_EXPORT void SAM_Battery_HybridTech_is_hybrid_nset(SAM_table ptr, double number, SAM_error *err);


/**
* Simulation Getters
*/
Expand Down Expand Up @@ -2187,6 +2200,13 @@ extern "C"
SAM_EXPORT double SAM_Battery_GridLimits_grid_interconnection_limit_kwac_nget(SAM_table ptr, SAM_error *err);


/**
* HybridTech Getters
*/

SAM_EXPORT double SAM_Battery_HybridTech_is_hybrid_nget(SAM_table ptr, SAM_error *err);


/**
* Outputs Getters
*/
Expand Down Expand Up @@ -2321,6 +2341,16 @@ extern "C"

SAM_EXPORT double* SAM_Battery_Outputs_cdf_of_surviving_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Battery_Outputs_cf_energy_net_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Battery_Outputs_cf_om_capacity_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Battery_Outputs_cf_om_fixed_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Battery_Outputs_cf_om_land_lease_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Battery_Outputs_cf_om_production_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Battery_Outputs_crit_load_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Battery_Outputs_crit_load_unmet_aget(SAM_table ptr, int* length, SAM_error *err);
Expand Down
30 changes: 30 additions & 0 deletions api/include/SAM_Pvwattsv8.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,19 @@ extern "C"
SAM_EXPORT void SAM_Pvwattsv8_AdjustmentFactors_adjust_timeindex_aset(SAM_table ptr, double* arr, int length, SAM_error *err);


//
// HybridTech parameters
//

/**
* Set is_hybrid: hybrid configuration [0/1]
* options: 0=singletech,1=hybrid
* constraints: None
* required if: ?=0
*/
SAM_EXPORT void SAM_Pvwattsv8_HybridTech_is_hybrid_nset(SAM_table ptr, double number, SAM_error *err);


/**
* SolarResource Getters
*/
Expand Down Expand Up @@ -517,6 +530,13 @@ extern "C"
SAM_EXPORT double* SAM_Pvwattsv8_AdjustmentFactors_adjust_timeindex_aget(SAM_table ptr, int* length, SAM_error *err);


/**
* HybridTech Getters
*/

SAM_EXPORT double SAM_Pvwattsv8_HybridTech_is_hybrid_nget(SAM_table ptr, SAM_error *err);


/**
* Outputs Getters
*/
Expand All @@ -543,6 +563,16 @@ extern "C"

SAM_EXPORT double SAM_Pvwattsv8_Outputs_capacity_factor_ac_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double* SAM_Pvwattsv8_Outputs_cf_energy_net_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Pvwattsv8_Outputs_cf_om_capacity_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Pvwattsv8_Outputs_cf_om_fixed_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Pvwattsv8_Outputs_cf_om_land_lease_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Pvwattsv8_Outputs_cf_om_production_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT const char* SAM_Pvwattsv8_Outputs_city_sget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double* SAM_Pvwattsv8_Outputs_dc_aget(SAM_table ptr, int* length, SAM_error *err);
Expand Down
30 changes: 30 additions & 0 deletions api/include/SAM_Windpower.h
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,19 @@ extern "C"
SAM_EXPORT void SAM_Windpower_Uncertainty_total_uncert_nset(SAM_table ptr, double number, SAM_error *err);


//
// HybridTech parameters
//

/**
* Set is_hybrid: hybrid configuration [0/1]
* options: 0=singletech,1=hybrid
* constraints: None
* required if: ?=0
*/
SAM_EXPORT void SAM_Windpower_HybridTech_is_hybrid_nset(SAM_table ptr, double number, SAM_error *err);


/**
* Resource Getters
*/
Expand Down Expand Up @@ -587,6 +600,13 @@ extern "C"
SAM_EXPORT double SAM_Windpower_Uncertainty_total_uncert_nget(SAM_table ptr, SAM_error *err);


/**
* HybridTech Getters
*/

SAM_EXPORT double SAM_Windpower_HybridTech_is_hybrid_nget(SAM_table ptr, SAM_error *err);


/**
* Outputs Getters
*/
Expand All @@ -607,6 +627,16 @@ extern "C"

SAM_EXPORT double SAM_Windpower_Outputs_capacity_factor_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double* SAM_Windpower_Outputs_cf_energy_net_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Windpower_Outputs_cf_om_capacity_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Windpower_Outputs_cf_om_fixed_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Windpower_Outputs_cf_om_land_lease_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Windpower_Outputs_cf_om_production_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double SAM_Windpower_Outputs_cutoff_losses_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_Windpower_Outputs_elec_losses_nget(SAM_table ptr, SAM_error *err);
Expand Down
77 changes: 77 additions & 0 deletions api/modules/SAM_Battery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,12 @@ SAM_EXPORT void SAM_Battery_GridLimits_grid_interconnection_limit_kwac_nset(SAM_
});
}

SAM_EXPORT void SAM_Battery_HybridTech_is_hybrid_nset(SAM_table ptr, double number, SAM_error *err){
translateExceptions(err, [&]{
ssc_data_set_number(ptr, "is_hybrid", number);
});
}

SAM_EXPORT double SAM_Battery_Simulation_percent_complete_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
Expand Down Expand Up @@ -3498,6 +3504,17 @@ SAM_EXPORT double SAM_Battery_GridLimits_grid_interconnection_limit_kwac_nget(SA



SAM_EXPORT double SAM_Battery_HybridTech_is_hybrid_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
if (!ssc_data_get_number(ptr, "is_hybrid", &result))
make_access_error("SAM_Battery", "is_hybrid");
});
return result;
}



SAM_EXPORT double SAM_Battery_Outputs_annual_crit_load_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
Expand Down Expand Up @@ -4264,6 +4281,66 @@ SAM_EXPORT double* SAM_Battery_Outputs_cdf_of_surviving_aget(SAM_table ptr, int*



SAM_EXPORT double* SAM_Battery_Outputs_cf_energy_net_aget(SAM_table ptr, int* length, SAM_error *err){
double* result = nullptr;
translateExceptions(err, [&]{
result = ssc_data_get_array(ptr, "cf_energy_net", length);
if (!result)
make_access_error("SAM_Battery", "cf_energy_net");
});
return result;
}



SAM_EXPORT double* SAM_Battery_Outputs_cf_om_capacity_aget(SAM_table ptr, int* length, SAM_error *err){
double* result = nullptr;
translateExceptions(err, [&]{
result = ssc_data_get_array(ptr, "cf_om_capacity", length);
if (!result)
make_access_error("SAM_Battery", "cf_om_capacity");
});
return result;
}



SAM_EXPORT double* SAM_Battery_Outputs_cf_om_fixed_aget(SAM_table ptr, int* length, SAM_error *err){
double* result = nullptr;
translateExceptions(err, [&]{
result = ssc_data_get_array(ptr, "cf_om_fixed", length);
if (!result)
make_access_error("SAM_Battery", "cf_om_fixed");
});
return result;
}



SAM_EXPORT double* SAM_Battery_Outputs_cf_om_land_lease_aget(SAM_table ptr, int* length, SAM_error *err){
double* result = nullptr;
translateExceptions(err, [&]{
result = ssc_data_get_array(ptr, "cf_om_land_lease", length);
if (!result)
make_access_error("SAM_Battery", "cf_om_land_lease");
});
return result;
}



SAM_EXPORT double* SAM_Battery_Outputs_cf_om_production_aget(SAM_table ptr, int* length, SAM_error *err){
double* result = nullptr;
translateExceptions(err, [&]{
result = ssc_data_get_array(ptr, "cf_om_production", length);
if (!result)
make_access_error("SAM_Battery", "cf_om_production");
});
return result;
}



SAM_EXPORT double* SAM_Battery_Outputs_crit_load_aget(SAM_table ptr, int* length, SAM_error *err){
double* result = nullptr;
translateExceptions(err, [&]{
Expand Down
77 changes: 77 additions & 0 deletions api/modules/SAM_Pvwattsv8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,12 @@ SAM_EXPORT void SAM_Pvwattsv8_AdjustmentFactors_adjust_timeindex_aset(SAM_table
});
}

SAM_EXPORT void SAM_Pvwattsv8_HybridTech_is_hybrid_nset(SAM_table ptr, double number, SAM_error *err){
translateExceptions(err, [&]{
ssc_data_set_number(ptr, "is_hybrid", number);
});
}

SAM_EXPORT double* SAM_Pvwattsv8_SolarResource_albedo_aget(SAM_table ptr, int* length, SAM_error *err){
double* result = nullptr;
translateExceptions(err, [&]{
Expand Down Expand Up @@ -772,6 +778,17 @@ SAM_EXPORT double* SAM_Pvwattsv8_AdjustmentFactors_adjust_timeindex_aget(SAM_tab



SAM_EXPORT double SAM_Pvwattsv8_HybridTech_is_hybrid_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
if (!ssc_data_get_number(ptr, "is_hybrid", &result))
make_access_error("SAM_Pvwattsv8", "is_hybrid");
});
return result;
}



SAM_EXPORT double* SAM_Pvwattsv8_Outputs_ac_aget(SAM_table ptr, int* length, SAM_error *err){
double* result = nullptr;
translateExceptions(err, [&]{
Expand Down Expand Up @@ -899,6 +916,66 @@ SAM_EXPORT double SAM_Pvwattsv8_Outputs_capacity_factor_ac_nget(SAM_table ptr, S



SAM_EXPORT double* SAM_Pvwattsv8_Outputs_cf_energy_net_aget(SAM_table ptr, int* length, SAM_error *err){
double* result = nullptr;
translateExceptions(err, [&]{
result = ssc_data_get_array(ptr, "cf_energy_net", length);
if (!result)
make_access_error("SAM_Pvwattsv8", "cf_energy_net");
});
return result;
}



SAM_EXPORT double* SAM_Pvwattsv8_Outputs_cf_om_capacity_aget(SAM_table ptr, int* length, SAM_error *err){
double* result = nullptr;
translateExceptions(err, [&]{
result = ssc_data_get_array(ptr, "cf_om_capacity", length);
if (!result)
make_access_error("SAM_Pvwattsv8", "cf_om_capacity");
});
return result;
}



SAM_EXPORT double* SAM_Pvwattsv8_Outputs_cf_om_fixed_aget(SAM_table ptr, int* length, SAM_error *err){
double* result = nullptr;
translateExceptions(err, [&]{
result = ssc_data_get_array(ptr, "cf_om_fixed", length);
if (!result)
make_access_error("SAM_Pvwattsv8", "cf_om_fixed");
});
return result;
}



SAM_EXPORT double* SAM_Pvwattsv8_Outputs_cf_om_land_lease_aget(SAM_table ptr, int* length, SAM_error *err){
double* result = nullptr;
translateExceptions(err, [&]{
result = ssc_data_get_array(ptr, "cf_om_land_lease", length);
if (!result)
make_access_error("SAM_Pvwattsv8", "cf_om_land_lease");
});
return result;
}



SAM_EXPORT double* SAM_Pvwattsv8_Outputs_cf_om_production_aget(SAM_table ptr, int* length, SAM_error *err){
double* result = nullptr;
translateExceptions(err, [&]{
result = ssc_data_get_array(ptr, "cf_om_production", length);
if (!result)
make_access_error("SAM_Pvwattsv8", "cf_om_production");
});
return result;
}



SAM_EXPORT const char* SAM_Pvwattsv8_Outputs_city_sget(SAM_table ptr, SAM_error *err){
const char* result = nullptr;
translateExceptions(err, [&]{
Expand Down
Loading

0 comments on commit 69fa40d

Please sign in to comment.