Skip to content

Commit

Permalink
Merge branch 'hybrids' of https://github.com/nrel/sam into hybrids
Browse files Browse the repository at this point in the history
  • Loading branch information
janinefreeman committed Aug 25, 2023
2 parents 8ba6b05 + 0f8abb3 commit 3aadb2e
Show file tree
Hide file tree
Showing 37 changed files with 93,024 additions and 50,082 deletions.
2 changes: 2 additions & 0 deletions api/include/SAM_Battery.h
Original file line number Diff line number Diff line change
Expand Up @@ -2325,6 +2325,8 @@ extern "C"

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_fuelcell_replacement_cost_schedule_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);
Expand Down
14 changes: 14 additions & 0 deletions api/include/SAM_Fuelcell.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,20 @@ extern "C"

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

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

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

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

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

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

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

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

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

SAM_EXPORT double* SAM_Fuelcell_Outputs_fuelcell_electrical_efficiency_aget(SAM_table ptr, int* length, SAM_error *err);
Expand Down
2 changes: 2 additions & 0 deletions api/include/SAM_Pvwattsv8.h
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,8 @@ extern "C"

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_fuelcell_replacement_cost_schedule_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);
Expand Down
2 changes: 2 additions & 0 deletions api/include/SAM_Windpower.h
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,8 @@ extern "C"

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_fuelcell_replacement_cost_schedule_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);
Expand Down
12 changes: 12 additions & 0 deletions api/modules/SAM_Battery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4288,6 +4288,18 @@ SAM_EXPORT double* SAM_Battery_Outputs_cf_energy_net_aget(SAM_table ptr, int* le



SAM_EXPORT double* SAM_Battery_Outputs_cf_fuelcell_replacement_cost_schedule_aget(SAM_table ptr, int* length, SAM_error *err){
double* result = nullptr;
translateExceptions(err, [&]{
result = ssc_data_get_array(ptr, "cf_fuelcell_replacement_cost_schedule", length);
if (!result)
make_access_error("SAM_Battery", "cf_fuelcell_replacement_cost_schedule");
});
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, [&]{
Expand Down
84 changes: 84 additions & 0 deletions api/modules/SAM_Fuelcell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,90 @@ SAM_EXPORT double* SAM_Fuelcell_Outputs_annual_fuel_usage_lifetime_aget(SAM_tabl



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



SAM_EXPORT double* SAM_Fuelcell_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_Fuelcell", "cf_energy_net");
});
return result;
}



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



SAM_EXPORT double* SAM_Fuelcell_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_Fuelcell", "cf_om_capacity");
});
return result;
}



SAM_EXPORT double* SAM_Fuelcell_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_Fuelcell", "cf_om_fixed");
});
return result;
}



SAM_EXPORT double* SAM_Fuelcell_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_Fuelcell", "cf_om_land_lease");
});
return result;
}



SAM_EXPORT double* SAM_Fuelcell_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_Fuelcell", "cf_om_production");
});
return result;
}



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



SAM_EXPORT double* SAM_Pvwattsv8_Outputs_cf_fuelcell_replacement_cost_schedule_aget(SAM_table ptr, int* length, SAM_error *err){
double* result = nullptr;
translateExceptions(err, [&]{
result = ssc_data_get_array(ptr, "cf_fuelcell_replacement_cost_schedule", length);
if (!result)
make_access_error("SAM_Pvwattsv8", "cf_fuelcell_replacement_cost_schedule");
});
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, [&]{
Expand Down
12 changes: 12 additions & 0 deletions api/modules/SAM_Windpower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,18 @@ SAM_EXPORT double* SAM_Windpower_Outputs_cf_energy_net_aget(SAM_table ptr, int*



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



SAM_EXPORT double* SAM_Windpower_Outputs_cf_om_capacity_aget(SAM_table ptr, int* length, SAM_error *err){
double* result = nullptr;
translateExceptions(err, [&]{
Expand Down
17 changes: 17 additions & 0 deletions deploy/runtime/autographs.lk
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,23 @@ autographs { 'PVWatts Wind FuelCell Battery Hybrid|Single Owner' } = define () {


autographs { 'PVWatts Wind Battery Hybrid|Host Developer' } = define () {
// monthly energy
agraph( 'pvwatts_monthly_energy,wind_monthly_energy', 'Monthly AC Energy in Year 1', '', 'kWh' , -1, true, true, 'bottom', 1 );
agraph( 'monthly_energy,year1_monthly_load', 'Monthly AC Energy and Load in Year 1', '', 'kWh', -1, true, true, 'bottom' );

// heatmaps
agraph( 'pvwatts_annual_energy_distribution_time', 'PV annual AC energy in Year 1 (kW)', 'Day', 'Hour', -1, true, false, 'bottom', 4);
agraph( 'wind_annual_energy_distribution_time', 'Wind annual AC energy in Year 1 (kW)', 'Day', 'Hour', -1, true, false, 'bottom', 4);
// losses
if (varinfo('wind_total_uncert')){
columns = 'wind_avail_losses,wind_elec_losses,wind_env_losses,ops_losses,wind_turb_losses,wind_wake_losses';
agraph(columns, 'Wind energy Loss', '', '%', -1, false, true, 'right');
}
// host developer
host_developer_graphs();
};

autographs { 'PVWatts Wind FuelCell Battery Hybrid|Host Developer' } = define () {
// monthly energy
//agraph( 'monthly_energy,year1_monthly_load', 'Monthly AC Energy and Load in Year 1', '', 'kWh', -1, true, true, 'bottom' );
agraph( 'pvwatts_monthly_energy,wind_monthly_energy,monthly_energy', 'Monthly AC Energy in Year 1', '', 'kWh' , -1, true, true, 'bottom' );
Expand Down
10 changes: 8 additions & 2 deletions deploy/runtime/cashflow.lk
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,19 @@ function cf_om_expenses()
}
if ( technology() == 'PVWatts Wind Battery Hybrid')
{
cfline( 'pvwatts_cf_om_fixed,pvwatts_cf_om_production,pvwatts_cf_om_capacity,pvwatts_cf_om_land_lease',0);
if (fin == 'Single Owner')
cfline( 'pvwatts_cf_om_fixed,pvwatts_cf_om_production,pvwatts_cf_om_capacity,pvwatts_cf_om_land_lease',0);
else
cfline( 'pvwatts_cf_om_fixed,pvwatts_cf_om_production,pvwatts_cf_om_capacity',0);
cfline( 'wind_cf_om_fixed,wind_cf_om_production,wind_cf_om_capacity',0);
cfline( 'battery_cf_om_fixed,battery_cf_om_production,battery_cf_om_capacity,battery_cf_battery_replacement_cost_schedule',0);
}
if ( technology() == 'PVWatts Wind FuelCell Battery Hybrid')
{
cfline( 'pvwatts_cf_om_fixed,pvwatts_cf_om_production,pvwatts_cf_om_capacity,pvwatts_cf_om_land_lease',0);
if (fin == 'Single Owner')
cfline( 'pvwatts_cf_om_fixed,pvwatts_cf_om_production,pvwatts_cf_om_capacity,pvwatts_cf_om_land_lease',0);
else
cfline( 'pvwatts_cf_om_fixed,pvwatts_cf_om_production,pvwatts_cf_om_capacity',0);
cfline( 'wind_cf_om_fixed,wind_cf_om_production,wind_cf_om_capacity',0);
cfline( 'fuelcell_cf_om_fixed,fuelcell_cf_om_production,fuelcell_cf_om_capacity,fuelcell_cf_fuelcell_replacement_cost_schedule',0);
cfline( 'battery_cf_om_fixed,battery_cf_om_production,battery_cf_om_capacity,battery_cf_battery_replacement_cost_schedule',0);
Expand Down
8 changes: 4 additions & 4 deletions deploy/runtime/defaults/Fuel Cell_Single Owner.json
Original file line number Diff line number Diff line change
Expand Up @@ -29439,10 +29439,10 @@
0.0
]
],
"show_CapitalCostSO": 0.0,
"show_DebtConstDSCR": 0.0,
"show_ReserveAccounts": 0.0,
"show_construction_period": 0.0,
"show_CapitalCostSO": 1.0,
"show_DebtConstDSCR": 1.0,
"show_ReserveAccounts": 1.0,
"show_construction_period": 1.0,
"soiling": [
0.0,
0.0,
Expand Down
Loading

0 comments on commit 3aadb2e

Please sign in to comment.