Skip to content

Commit

Permalink
Merge pull request #1260 from NREL/ssc_1259_scale_w_pv_ac
Browse files Browse the repository at this point in the history
Ssc 1259 scale w pv ac
  • Loading branch information
brtietz authored Dec 9, 2024
2 parents 55dd37c + 3bdb967 commit eab94c4
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 17 deletions.
5 changes: 2 additions & 3 deletions ssc/cmod_fresnel_physical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ static var_info _cm_vtab_fresnel_physical[] = {
{ SSC_INPUT, SSC_NUMBER, "SCA_drives_elec", "Tracking power in Watts per SCA drive", "W/module", "", "Solar_Field", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "land_mult", "Non-solar field land area multiplier", "-", "", "Solar_Field", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "T_startup", "Power block startup temperature", "C", "", "Solar_Field", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "rec_su_delay", "Fixed startup delay time for the receiver", "hr", "", "Solar_Field", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "rec_qf_delay", "Energy-based receiver startup delay (fraction of rated thermal power)", "-", "", "Solar_Field", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "p_start", "Collector startup energy, per SCA", "kWhe", "", "Solar_Field", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "L_rnr_pb", "Length of runner pipe in power block", "m", "", "Solar_Field", "*", "", "" },

Expand Down Expand Up @@ -234,7 +232,8 @@ static var_info _cm_vtab_fresnel_physical[] = {
{ SSC_INPUT, SSC_NUMBER, "q_rec_standby", "Receiver standby energy consumption", "kWt", "", "tou", "?=9e99", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "q_rec_heattrace", "Receiver heat trace energy consumption during startup", "kWhe", "", "tou", "?=0.0", "", "SIMULATION_PARAMETER" },


{ SSC_INPUT, SSC_NUMBER, "rec_su_delay", "Fixed startup delay time for the receiver", "hr", "", "Sys_Control", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "rec_qf_delay", "Energy-based receiver startup delay (fraction of rated thermal power)", "-", "", "Sys_Control", "*", "", "" },

// Financials
{SSC_INPUT, SSC_NUMBER, "csp_financial_model", "", "1-8", "", "Financial Model", "?=1", "INTEGER,MIN=0", ""},
Expand Down
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
6 changes: 4 additions & 2 deletions ssc/cmod_trough_physical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ static var_info _cm_vtab_trough_physical[] = {
{ SSC_INPUT, SSC_MATRIX, "Shadowing", "Receiver bellows shadowing loss factor", "none", "", "solar_field", "*", "", "" },
{ SSC_INPUT, SSC_MATRIX, "Dirt_HCE", "Loss due to dirt on the receiver envelope", "none", "", "solar_field", "*", "", "" },
{ SSC_INPUT, SSC_MATRIX, "Design_loss", "Receiver heat loss at design", "W/m", "", "solar_field", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "rec_su_delay", "Fixed startup delay time for the receiver", "hr", "", "solar_field", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "rec_qf_delay", "Energy-based receiver startup delay (fraction of rated thermal power)", "-", "", "solar_field", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "p_start", "Collector startup energy, per SCA", "kWhe", "", "solar_field", "*", "", "" },

// Power Cycle
Expand Down Expand Up @@ -298,6 +296,10 @@ static var_info _cm_vtab_trough_physical[] = {
{ SSC_INPUT, SSC_NUMBER, "q_rec_heattrace", "Receiver heat trace energy consumption during startup", "kWhe", "", "tou", "?=0.0", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_ARRAY, "f_turb_tou_periods", "Dispatch logic for turbine load fraction", "-", "", "tou", "*", "", "" },

{ SSC_INPUT, SSC_NUMBER, "rec_su_delay", "Fixed startup delay time for the receiver", "hr", "", "System Control", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "rec_qf_delay", "Energy-based receiver startup delay (fraction of rated thermal power)", "-", "", "System Control", "*", "", "" },


{ SSC_INPUT, SSC_NUMBER, "csp_financial_model", "", "1-8", "", "Financial Model", "?=1", "INTEGER,MIN=0", "" },
{ SSC_INPUT, SSC_NUMBER, "ppa_multiplier_model", "PPA multiplier model 0: dispatch factors dispatch_factorX, 1: hourly multipliers dispatch_factors_ts", "0/1", "0=diurnal,1=timestep", "tou", "?=0", /*need a default so this var works in required_if*/ "INTEGER,MIN=0", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_ARRAY, "dispatch_factors_ts", "Dispatch payment factor array", "", "", "tou", "sim_type=1&ppa_multiplier_model=1&csp_financial_model<5&is_dispatch=1","", "SIMULATION_PARAMETER" },
Expand Down
2 changes: 1 addition & 1 deletion ssc/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,7 @@ var_info vtab_hybrid_fin_om[] = {
/* VARTYPE DATATYPE NAME LABEL UNITS META GROUP REQUIRED_IF CONSTRAINTS UI_HINTS*/
{ SSC_INPUT, SSC_NUMBER, "is_hybrid", "hybrid configuration", "0/1", "0=singletech,1=hybrid", "HybridFin", "?=0", "", "" },
{ SSC_INPUT, SSC_ARRAY, "cf_hybrid_om_sum", "Hybrid O&M costs", "$", "", "HybridFin", "", "", "" },
{ SSC_INOUT, SSC_ARRAY, "monthly_energy", "Monthly AC energy in Year 1", "kWh", "", "Monthly", "", "LENGTH = 12", "" },
{ SSC_INPUT, SSC_ARRAY, "monthly_energy", "Monthly AC energy in Year 1", "kWh", "", "Monthly", "", "LENGTH = 12", "" },

var_info_invalid };

Expand Down
14 changes: 7 additions & 7 deletions test/ssc_test/cmod_hybrid_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ TEST_F(CmodHybridTest, PVWattsv8WindBatterySingleOwner) {
auto om_expenses = ssc_data_get_array(hybrid_outputs, "cf_operating_expenses", &len);
ssc_data_get_number(hybrid_outputs, "project_return_aftertax_npv", &npv);

EXPECT_NEAR(om_expenses[1], 10772001, 1);
EXPECT_NEAR(om_expenses[1], 10425847, 1);
EXPECT_NEAR(revenue[1], 33062516, 1);
EXPECT_NEAR(ebitda[1], 22290515, 1);
EXPECT_NEAR(npv, -233836157, 246312045 * 0.001);
EXPECT_NEAR(ebitda[1], 22636669, 1);
EXPECT_NEAR(npv, -227222606, 227222606 * 0.001);

EXPECT_NEAR(total_energy, battannualenergy, total_energy * 0.001);
EXPECT_NEAR(total_energy, pvannualenergy + windannualenergy - battchargeenergy[1] + battdischargeenergy[1], total_energy * 0.001);
Expand Down Expand Up @@ -167,7 +167,7 @@ TEST_F(CmodHybridTest, PVWattsv8WindBatteryHostDeveloper) {

auto hybrid_outputs = ssc_data_get_table(outputs, "Hybrid");
ssc_data_get_number(hybrid_outputs, "project_return_aftertax_npv", &npv);
EXPECT_NEAR(npv, -191914, 191914 * 0.001);
EXPECT_NEAR(npv, -168769, 168769 * 0.001);

ssc_data_get_number(hybrid_outputs, "annual_energy", &total_energy);

Expand Down Expand Up @@ -251,10 +251,10 @@ TEST_F(CmodHybridTest, CustomGenerationPVWattsWindFuelCellBatteryHybrid_SingleOw
EXPECT_NEAR(total_energy, battannualenergy, total_energy * 0.001);
EXPECT_NEAR(total_energy, pvannualenergy + windannualenergy + genericannualenergy + fuelcellannualenergy - battchargeenergy[1] + battdischargeenergy[1], total_energy * 0.001);

EXPECT_NEAR(om_expenses[1], 90570832., 1e5);
EXPECT_NEAR(om_expenses[1], 90224679., 1e5);
EXPECT_NEAR(revenue[1], 66590988., 1e5);
EXPECT_NEAR(ebitda[1], -23979844., 1e5);
EXPECT_NEAR(npv, -1756154696., 1e6);
EXPECT_NEAR(ebitda[1], -23633690., 1e5);
EXPECT_NEAR(npv, -1750593259., 1e6);
}
ssc_data_free(dat);
dat = nullptr;
Expand Down

0 comments on commit eab94c4

Please sign in to comment.