Skip to content

Commit

Permalink
Model running through with changed results, need to validate, add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mjprilliman committed Aug 14, 2023
1 parent ffe3266 commit 894fde2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions shared/lib_pv_io_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,12 @@ void PVSystem_IO::AllocateOutputs(compute_module* cm)
p_derateSelfShadingDiffuse.push_back(cm->allocate(prefix + "ss_diffuse_derate", numberOfWeatherFileRecords));
p_derateSelfShadingReflected.push_back(cm->allocate(prefix + "ss_reflected_derate", numberOfWeatherFileRecords));

p_poaBeamFrontCS.push_back(cm->allocate(prefix + "poa_beam_front_cs", numberOfWeatherFileRecords));
p_poaDiffuseFrontCS.push_back(cm->allocate(prefix + "poa_diffuse_front_cs", numberOfWeatherFileRecords));
p_poaGroundFrontCS.push_back(cm->allocate(prefix + "poa_ground_front_cs", numberOfWeatherFileRecords));
p_DNIIndex.push_back(cm->allocate(prefix + "dni_index", numberOfWeatherFileRecords));
p_ClippingPotential.push_back(cm->allocate(prefix + "clipping_potential", numberOfWeatherFileRecords));

if (enableSnowModel) {
p_snowLoss.push_back(cm->allocate(prefix + "snow_loss", numberOfWeatherFileRecords));
p_snowCoverage.push_back(cm->allocate(prefix + "snow_coverage", numberOfWeatherFileRecords));
Expand Down Expand Up @@ -929,6 +935,8 @@ void PVSystem_IO::AllocateOutputs(compute_module* cm)
p_systemDCPower = cm->allocate("dc_net", numberOfLifetimeRecords);
p_systemACPower = cm->allocate("gen", numberOfLifetimeRecords);

p_systemDCPowerCS = cm->allocate("dc_net_clearsky", numberOfLifetimeRecords);

if (Simulation->useLifetimeOutput)
{
p_dcDegradationFactor = cm->allocate("dc_degrade_factor", numberOfYears);
Expand Down
8 changes: 4 additions & 4 deletions ssc/cmod_pvsamv1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,8 @@ static var_info _cm_vtab_pvsamv1[] = {
// NOTE: other battery storage model inputs and outputs are defined in batt_common.h/batt_common.cpp

// PV subhourly clipping inputs
{ SSC_INPUT, SSC_NUMBER, "en_subhourly_clipping", "Enable subhourly clipping", "0/1", "", "PV Losses", "?=0", "INTEGER,MIN=0,MAX=1", "" },
{ SSC_INPUT, SSC_MATRIX, "subhourly_clipping_matrix", "PV Subhourly clipping correction matrix", "", "", "PV Losses", "en_subhourly_clipping=1", "", "" },
{ SSC_INPUT, SSC_NUMBER, "enable_subhourly_clipping", "Enable subhourly clipping", "0/1", "", "PV Losses", "?=0", "INTEGER,MIN=0,MAX=1", "" },
{ SSC_INPUT, SSC_MATRIX, "subhourly_clipping_matrix", "PV Subhourly clipping correction matrix", "", "", "PV Losses", "enable_subhourly_clipping=1", "", "" },


// outputs
Expand Down Expand Up @@ -2626,7 +2626,7 @@ void cm_pvsamv1::exec()
acpwr_gross = sharedInverter->powerAC_kW;
}

if (as_boolean("en_subhourly_clipping")) {
if (as_boolean("enable_subhourly_clipping")) {
//Calculate DNI clearness index (time step basis)
double dni_clearness_index = PVSystem->p_DNIIndex[0][idx];
//Calculate Clipping Potential ((P_dc,dryclean - P_ac,0) / P_ac,0) (time step basis)
Expand Down Expand Up @@ -2660,7 +2660,7 @@ void cm_pvsamv1::exec()
}
}

acpwr_gross *= sub_clipping_matrix.at(dni_row, clip_pot_col);
acpwr_gross *= (1 - sub_clipping_matrix.at(dni_row, clip_pot_col));
}


Expand Down

0 comments on commit 894fde2

Please sign in to comment.