Skip to content

Commit

Permalink
Merge branch 'develop' into sam-1876-monthly-annual-energy-labels
Browse files Browse the repository at this point in the history
  • Loading branch information
cpaulgilman committed Nov 6, 2024
2 parents f030f56 + 8b263f5 commit 882dac4
Show file tree
Hide file tree
Showing 54 changed files with 473 additions and 105,363 deletions.
5 changes: 2 additions & 3 deletions shared/lib_cec6par.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,10 @@ bool noct_celltemp_t::operator() ( pvinput_t &input, pvmodule_t &module, double
tau_al = std::abs(TauAlpha); // Sev: What's the point of recalculating this??

W_spd = input.Wspd * ffv_wind; //added 1/11/12 to account for FFV_wind correction factor internally
if (W_spd < 0.001) W_spd = 0.001;
if (G_total > 0) tau_al *= Geff_total/G_total;
if (W_spd < 0.001) W_spd = 0.001;

double Tnoct_adj = Tnoct + standoff_tnoct_adj; // added 1/11/12 for adjustment to NOCT as in the CECPV calculator based on standoff height, used in eqn below.
Tcell = (input.Tdry+273.15) + (G_total/I_noct * (Tnoct_adj - Tamb_noct) * (1.0-eff_ref/tau_al))*9.5/(5.7 + 3.8*W_spd);
Tcell = (input.Tdry+273.15) + (Geff_total/I_noct * (Tnoct_adj - Tamb_noct) * (1.0-eff_ref/tau_al))*9.5/(5.7 + 3.8*W_spd);
Tcell = Tcell-273.15;
}

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_biomass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ class cm_biomass : public compute_module
rated_eff += press_adj;


adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup())
throw exec_error("biopower", "failed to setup adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_custom_generation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class cm_custom_generation : public compute_module
sys_degradation.reserve(nyears);
double derate = (1 - (double)as_number("derate") / 100);

adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup(nrec_load, nyears))
throw exec_error("custom_generation", "failed to setup adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_etes_electric_resistance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ class cm_etes_electric_resistance : public compute_module
ssc_number_t* p_time_final_hr = as_array("time_hr", &count);

// 'adjustment_factors' class stores factors in hourly array, so need to index as such
adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup(n_steps_fixed))
throw exec_error("etes_electric_resistance", "failed to setup adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_etes_ptes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ class cm_etes_ptes : public compute_module
ssc_number_t* p_time_final_hr = as_array("time_hr", &count);

// 'adjustment_factors' class stores factors in hourly array, so need to index as such
adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup(count))
throw exec_error("etes_electric_resistance", "failed to setup adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_fresnel_physical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1785,7 +1785,7 @@ class cm_fresnel_physical : public compute_module
throw exec_error("fresnel_physical", "The number of fixed steps does not match the length of output data arrays");

// 'adjustment_factors' class stores factors in hourly array, so need to index as such
adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup(n_steps_fixed))
throw exec_error("fresnel_physical", "failed to setup adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_fresnel_physical_iph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ class cm_fresnel_physical_iph : public compute_module
throw exec_error("fresnel_physical", "The number of fixed steps does not match the length of output data arrays");

// 'adjustment_factors' class stores factors in hourly array, so need to index as such
adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup(n_steps_fixed))
throw exec_error("fresnel_physical", "failed to setup adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_generic_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class cm_generic_system : public compute_module
sys_degradation.reserve(nyears);
double derate = (1 - (double)as_number("derate") / 100);

adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup(nrec_load, nyears))
throw exec_error("generic system", "failed to setup adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_geothermal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ class cm_geothermal : public compute_module
ssc_number_t * p_gen = allocate("gen", n_rec);

// TODO - implement performance factors
adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup(8760, geo_inputs.mi_ProjectLifeYears))
throw exec_error("geothermal", "failed to setup adjustment factors: " + haf.error());
std::vector<double> haf_input;
Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_hcpv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ class cm_hcpv : public compute_module
double ac_loss_tracker = 0;


adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup())
throw exec_error("hcpv", "failed to setup adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_linear_fresnel_dsg_iph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ class cm_linear_fresnel_dsg_iph : public compute_module
throw exec_error("linear_fresnel_dsg_iph", "The number of fixed steps does not match the length of output data arrays");

// 'adjustment_factors' class stores factors in hourly array, so need to index as such
adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if( !haf.setup(n_steps_fixed) )
throw exec_error("linear_fresnel_dsg_iph", "failed to setup adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_mhk_tidal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class cm_mhk_tidal : public compute_module
ssc_number_t* p_gen = allocate("gen", number_records);
int power_bin = 0;

adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup(number_records, 1))
throw exec_error("mhk_tidal", "Failed to set up adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_mhk_wave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ class cm_mhk_wave : public compute_module
sys_degradation.push_back(1); // single year mode - degradation handled in financial models.
}

adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup(number_records, nyears))
throw exec_error("mhk_wave", "Failed to set up adjustment factors: " + haf.error());

Expand Down
4 changes: 2 additions & 2 deletions ssc/cmod_mspt_iph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,7 @@ class cm_mspt_iph : public compute_module
heliostatfield.ms_params.mv_clearsky_data = clearsky_data;

//Load the solar field adjustment factors
adjustment_factors sf_haf(this, "sf_adjust");
adjustment_factors sf_haf(this->get_var_table(), "sf_adjust");
if (!sf_haf.setup((int)n_steps_full))
throw exec_error("mspt_iph", "failed to setup sf adjustment factors: " + sf_haf.error());
//allocate array to pass to tcs
Expand Down Expand Up @@ -2290,7 +2290,7 @@ class cm_mspt_iph : public compute_module
ssc_number_t* p_q_dot_heat_sink = as_array("q_dot_to_heat_sink", &count);

// 'adjustment_factors' class stores factors in hourly array, so need to index as such
adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup(count))
throw exec_error("mspt_iph", "failed to setup adjustment factors: " + haf.error());

Expand Down
1 change: 0 additions & 1 deletion ssc/cmod_pv6parmod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ static var_info _cm_vtab_pv6parmod[] = {
{ SSC_INPUT, SSC_NUMBER, "Isc", "Short circuit current", "A", "", "CEC 6 Parameter PV Module Model", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "alpha_isc", "Temp coeff of current at SC", "A/'C", "", "CEC 6 Parameter PV Module Model", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "beta_voc", "Temp coeff of voltage at OC", "V/'C", "", "CEC 6 Parameter PV Module Model", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "gamma_pmp", "Temp coeff of power at MP", "%/'C", "", "CEC 6 Parameter PV Module Model", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "tnoct", "NOCT cell temperature", "'C", "", "CEC 6 Parameter PV Module Model", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "a", "Modified nonideality factor", "1/V", "", "CEC 6 Parameter PV Module Model", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "Il", "Light current", "A", "", "CEC 6 Parameter PV Module Model", "*", "", "" },
Expand Down
5 changes: 2 additions & 3 deletions ssc/cmod_pvsamv1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ static var_info _cm_vtab_pvsamv1[] = {
{ SSC_INPUT, SSC_NUMBER, "cec_adjust", "Temperature coefficient adjustment", "%", "", "CEC Performance Model with Module Database", "module_model=1", "", "" },
{ SSC_INPUT, SSC_NUMBER, "cec_alpha_sc", "Short circuit current temperature coefficient", "A/C", "", "CEC Performance Model with Module Database", "module_model=1", "", "" },
{ SSC_INPUT, SSC_NUMBER, "cec_beta_oc", "Open circuit voltage temperature coefficient", "V/C", "", "CEC Performance Model with Module Database", "module_model=1", "", "" },
{ SSC_INPUT, SSC_NUMBER, "cec_gamma_r", "Maximum power point temperature coefficient", "%/C", "", "CEC Performance Model with Module Database", "module_model=1", "", "" },
{ SSC_INPUT, SSC_NUMBER, "cec_i_l_ref", "Light current", "A", "", "CEC Performance Model with Module Database", "module_model=1", "", "" },
{ SSC_INPUT, SSC_NUMBER, "cec_i_mp_ref", "Maximum power point current", "A", "", "CEC Performance Model with Module Database", "module_model=1", "", "" },
{ SSC_INPUT, SSC_NUMBER, "cec_i_o_ref", "Saturation current", "A", "", "CEC Performance Model with Module Database", "module_model=1", "", "" },
Expand Down Expand Up @@ -1225,12 +1224,12 @@ void cm_pvsamv1::exec()
//dc hourly adjustment factors
int nyears_haf = nyears;
if (!system_use_lifetime_output) nyears_haf = 1;
adjustment_factors dc_haf(this, "dc_adjust");
adjustment_factors dc_haf(this->get_var_table(), "dc_adjust");
if (!dc_haf.setup((int)nrec, nyears_haf))
throw exec_error("pvsamv1", "failed to setup DC adjustment factors: " + dc_haf.error());

// hourly adjustment factors
adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup((int)nrec, nyears_haf))
throw exec_error("pvsamv1", "failed to setup AC adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_pvwattsv5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ class cm_pvwattsv5 : public cm_pvwattsv5_base
size_t nrec = wdprov->nrecords();
size_t nlifetime = nrec * nyears;

adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup(nrec, nyears))
throw exec_error("pvwattsv5", "failed to setup adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_pvwattsv7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ class cm_pvwattsv7 : public compute_module
size_t nrec = wdprov->nrecords();
size_t nlifetime = nrec * nyears;

adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup(nrec, nyears))
throw exec_error("pvwattsv7", "Failed to set up adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_pvwattsv8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ class cm_pvwattsv8 : public compute_module
size_t nrec = wdprov->nrecords();
size_t nlifetime = nrec * nyears;

adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup(nrec, nyears))
throw exec_error("pvwattsv8", "Failed to set up adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_swh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ class cm_swh : public compute_module
double ts_hour = 1.0/step_per_hour;
double ts_sec = 3600.0/step_per_hour;

adjustment_factors haf( this, "adjust" );
adjustment_factors haf( this->get_var_table(), "adjust" );
if ( !haf.setup(nrec) )
throw exec_error("swh", "failed to setup adjustment factors: " + haf.error() );

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_tcsdish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ class cm_tcsdish : public tcKernel
ssc_number_t *po8 = allocate("hourly_Q_rec_losses", count);


adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup(count))
throw exec_error("dish", "failed to setup adjustment factors: " + haf.error());

Expand Down
4 changes: 2 additions & 2 deletions ssc/cmod_tcsgeneric_solar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ class cm_tcsgeneric_solar : public tcKernel
size_t hours = 8760;

//Load the solar field adjustment factors
adjustment_factors sf_haf(this, "sf_adjust");
adjustment_factors sf_haf(this->get_var_table(), "sf_adjust");
if (!sf_haf.setup(hours))
throw exec_error("tcsgeneric_solar", "failed to setup sf adjustment factors: " + sf_haf.error());
//allocate array to pass to tcs
Expand All @@ -400,7 +400,7 @@ class cm_tcsgeneric_solar : public tcKernel
if (!enet || count != 8760)
throw exec_error("tcsgeneric_solar", "Failed to retrieve hourly net energy");

adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup(count))
throw exec_error("tcsgeneric_solar", "failed to setup adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_tcslinear_fresnel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ class cm_tcslinear_fresnel : public tcKernel
throw exec_error( "tcslinear_fresnel", util::format("there was a problem returning the results from the simulation.") );

// performance adjustement factors
adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup())
throw exec_error("tcstrough_physical", "failed to setup adjustment factors: " + haf.error());

Expand Down
4 changes: 2 additions & 2 deletions ssc/cmod_tcsmolten_salt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1884,7 +1884,7 @@ class cm_tcsmolten_salt : public compute_module
heliostatfield.ms_params.mv_clearsky_data = clearsky_data;

//Load the solar field adjustment factors
adjustment_factors sf_haf(this, "sf_adjust");
adjustment_factors sf_haf(this->get_var_table(), "sf_adjust");
if (!sf_haf.setup((int)n_steps_full))
throw exec_error("tcsmolten_salt", "failed to setup sf adjustment factors: " + sf_haf.error());
//allocate array to pass to tcs
Expand Down Expand Up @@ -2979,7 +2979,7 @@ class cm_tcsmolten_salt : public compute_module
ssc_number_t *p_time_final_hr = as_array("time_hr", &count);

// 'adjustment_factors' class stores factors in hourly array, so need to index as such
adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if( !haf.setup(n_steps_full) )
throw exec_error("tcsmolten_salt", "failed to setup adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_tcsmslf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ class cm_tcsmslf : public tcKernel
std::copy(sgs_P_dsn, sgs_P_dsn + nv, sgs_P_dsn_cm);

// performance adjustement factors
adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup())
throw exec_error("tcsmslf", "failed to setup adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_tcstrough_empirical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ class cm_tcstrough_empirical : public tcKernel
assign("conversion_factor", convfactor);

// performance adjustement factors
adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup())
throw exec_error("tcstrough_empirical", "failed to setup adjustment factors: " + haf.error());
// hourly_energy output
Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_tcstrough_physical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ class cm_tcstrough_physical : public tcKernel
std::copy(sgs_P_dsn, sgs_P_dsn + nv, sgs_P_dsn_cm);

// performance adjustment factors
adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup(nrec))
throw exec_error("tcstrough_physical", "failed to setup adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_trough_physical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2138,7 +2138,7 @@ class cm_trough_physical : public compute_module
throw exec_error("trough_physical", "The number of fixed steps does not match the length of output data arrays");

// 'adjustment_factors' class stores factors in hourly array, so need to index as such
adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if( !haf.setup(n_steps_full) )
throw exec_error("trough_physical", "failed to setup adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_trough_physical_iph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,7 @@ class cm_trough_physical_iph : public compute_module
throw exec_error("trough_physical", "The number of fixed steps does not match the length of output data arrays");

// 'adjustment_factors' class stores factors in hourly array, so need to index as such
adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if( !haf.setup(n_steps_fixed) )
throw exec_error("trough_physical", "failed to setup adjustment factors: " + haf.error());

Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_windpower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ void cm_windpower::exec()
throw exec_error("windpower", util::format("the wind model is only configured to handle up to %d turbines.", wpc.GetMaxTurbines()));

// create adjustment factors and losses - set them up initially here for the Weibull distribution method, rewrite them later with nrec for the time series method
adjustment_factors haf(this, "adjust");
adjustment_factors haf(this->get_var_table(), "adjust");
if (!haf.setup())
throw exec_error("windpower", "failed to setup adjustment factors: " + haf.error());

Expand Down
Loading

0 comments on commit 882dac4

Please sign in to comment.