Skip to content

Commit

Permalink
Correct PV scaling units for hybrid O&M
Browse files Browse the repository at this point in the history
  • Loading branch information
brtietz committed Dec 6, 2024
1 parent 55dd37c commit bb3200e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ssc/cmod_hybrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,6 @@ class cm_hybrid : public compute_module

ssc_module_exec_with_error(module, input, compute_module);

ssc_number_t system_capacity = compute_module_inputs->table.lookup("system_capacity")->num;
hybridSystemCapacity += system_capacity;
hybridTotalInstalledCost += compute_module_inputs->table.lookup("total_installed_cost")->num;

ssc_data_t compute_module_outputs = ssc_data_create();

int pidx = 0;
Expand All @@ -174,6 +170,13 @@ class cm_hybrid : public compute_module
if (compute_module_inputs->table.lookup("system_use_lifetime_output"))
system_use_lifetime_output = compute_module_inputs->table.lookup("system_use_lifetime_output")->num;

ssc_number_t system_capacity = compute_module_inputs->table.lookup("system_capacity")->num;
if ((compute_module == "pvsamv1") || (compute_module == "pvwattsv8")) {
ssc_data_get_number(compute_module_outputs, "system_capacity_ac", &system_capacity);
}
hybridSystemCapacity += system_capacity;
hybridTotalInstalledCost += compute_module_inputs->table.lookup("total_installed_cost")->num;

// get minimum timestep from gen vector
ssc_number_t* curGen = ssc_data_get_array(compute_module_outputs, "gen", &len);
currentTimeStepsPerHour = len / 8760;
Expand Down
3 changes: 3 additions & 0 deletions ssc/cmod_pvsamv1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,8 @@ static var_info _cm_vtab_pvsamv1[] = {
//miscellaneous outputs
{ SSC_OUTPUT, SSC_NUMBER, "ts_shift_hours", "Sun position time offset", "hours", "", "Miscellaneous", "", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "nameplate_dc_rating", "System nameplate DC rating", "kW", "", "Miscellaneous", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "system_capacity_ac", "System nameplate AC rating", "kWac", "", "Miscellaneous", "", "", "" },



// test outputs
Expand Down Expand Up @@ -3594,6 +3596,7 @@ void cm_pvsamv1::exec()
kWhACperkWAC = annual_energy / nameplate_ac_kW;
}
assign("capacity_factor_ac", var_data((ssc_number_t)(kWhACperkWAC / 87.6)));
assign("system_capacity_ac", var_data((ssc_number_t)nameplate_ac_kW));

if (is_assigned("load"))
{
Expand Down
2 changes: 2 additions & 0 deletions ssc/cmod_pvwattsv8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ static var_info _cm_vtab_pvwattsv8[] = {

{ SSC_OUTPUT, SSC_NUMBER, "ts_shift_hours", "Time offset for interpreting time series outputs", "hours","", "Miscellaneous", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "percent_complete", "Estimated percent of total completed simulation", "%", "", "Miscellaneous", "", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "system_capacity_ac", "System nameplate AC rating", "kWac", "", "Miscellaneous", "", "", "" },

var_info_invalid };

Expand Down Expand Up @@ -1442,6 +1443,7 @@ class cm_pvwattsv8 : public compute_module

// for battery model, specify a number of inverters
assign("inverter_efficiency", var_data((ssc_number_t)(as_double("inv_eff"))));
assign("system_capacity_ac", var_data((ssc_number_t)pv.ac_nameplate / 1000.0));

if (en_snowloss && snowmodel.badValues > 0)
log(util::format("The snow model has detected %d bad snow depth values (less than 0 or greater than 610 cm). These values have been set to zero.", snowmodel.badValues), SSC_WARNING);
Expand Down

0 comments on commit bb3200e

Please sign in to comment.