Skip to content

Commit

Permalink
Add output for total performance adjustment loss at a given timestep
Browse files Browse the repository at this point in the history
  • Loading branch information
brtietz committed Nov 13, 2024
1 parent e06f183 commit 2bb5351
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions ssc/cmod_battery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,7 @@ battstor::battstor(var_table& vt, bool setup_model, size_t nrec, double dt_hr, c
outBatteryToSystemLoad = vt.allocate("batt_to_system_load", nrec * nyears);
outBatteryToGrid = vt.allocate("batt_to_grid", nrec * nyears);
outBatteryToInverterDC = vt.allocate("batt_to_inverter_dc", nrec * nyears);
outAdjustLosses = vt.allocate("batt_perf_adj_loss", nrec * nyears);

if (batt_vars->batt_meter_position == dispatch_t::BEHIND)
{
Expand Down Expand Up @@ -1758,6 +1759,8 @@ battstor::battstor(const battstor& orig) {
outSystemChargePercent = orig.outSystemChargePercent;
outGridChargePercent = orig.outGridChargePercent;

outAdjustLosses = orig.outAdjustLosses;

// copy models
if (orig.batt_vars) batt_vars = orig.batt_vars;
battery_metrics = new battery_metrics_t(orig._dt_hour);
Expand Down Expand Up @@ -1902,6 +1905,7 @@ void battstor::outputs_fixed()
outDOD[index] = (ssc_number_t)(state.lifetime->cycle_range);
outDODCycleAverage[index] = (ssc_number_t)(state.lifetime->average_range);
outCapacityPercent[index] = (ssc_number_t)(state.lifetime->q_relative);
outAdjustLosses[index] = (ssc_number_t)(state.losses->adjust_loss_percent * 100.0);
if (batt_vars->batt_life_model == lifetime_params::CALCYC) {
outCapacityPercentCycle[index] = (ssc_number_t)(state.lifetime->cycle->q_relative_cycle);
outCapacityPercentCalendar[index] = (ssc_number_t)(state.lifetime->calendar->q_relative_calendar);
Expand Down
8 changes: 4 additions & 4 deletions ssc/cmod_battery.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,8 @@ struct battstor
* outBatteryConversionPowerLoss,
* outBatterySystemLoss,
* outBatteryToInverterDC,
* outInterconnectionLoss,
* outCritLoadUnmet,
* outInterconnectionLoss,
* outCritLoadUnmet,
* outCritLoad,
* outUnmetLosses,
* outAnnualSystemChargeEnergy,
Expand All @@ -455,8 +455,8 @@ struct battstor
* outPVS_violation_list,
* outPVS_P_pv_ac, // testing with input pv output
* outPVS_PV_ramp_interval, // testing with sampled input pv output
* outPVS_forecast_pv_energy; // testing with forecast based on input pv output

* outPVS_forecast_pv_energy, // testing with forecast based on input pv output
* outAdjustLosses;

double outAverageCycleEfficiency;
double outAverageRoundtripEfficiency;
Expand Down
2 changes: 2 additions & 0 deletions ssc/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,8 @@ var_info vtab_batt_adjustment_factors[] = {
{ SSC_INPUT, SSC_NUMBER, "batt_adjust_en_periods" , "Enable battery period-based adjustment factors", "0/1", "", "Adjustment Factors", "?=0", "BOOLEAN", "" },
{ SSC_INPUT,SSC_ARRAY , "batt_adjust_timeindex" , "Battery Lifetime Adjustment Factors" , "%" , "" , "Adjustment Factors" , "batt_adjust_en_timeindex=1" , "" , ""},
{ SSC_INPUT,SSC_MATRIX , "batt_adjust_periods" , "Battery Period-based Adjustment Factors" , "%" , "n x 3 matrix [ start, end, loss ]" , "Adjustment Factors" , "batt_adjust_en_periods=1" , "COLS=3" , ""},
{ SSC_OUTPUT, SSC_ARRAY, "batt_perf_adj_loss", "Battery performance adjustment loss", "%", "", "Time Series", "", "", "" },

var_info_invalid };

var_info vtab_financial_capacity_payments[] = {
Expand Down

0 comments on commit 2bb5351

Please sign in to comment.