diff --git a/ssc/cmod_battery.cpp b/ssc/cmod_battery.cpp index d2243f887..ca832beb8 100644 --- a/ssc/cmod_battery.cpp +++ b/ssc/cmod_battery.cpp @@ -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) { @@ -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); @@ -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); diff --git a/ssc/cmod_battery.h b/ssc/cmod_battery.h index 9419c1436..095bd6ac3 100644 --- a/ssc/cmod_battery.h +++ b/ssc/cmod_battery.h @@ -430,8 +430,8 @@ struct battstor * outBatteryConversionPowerLoss, * outBatterySystemLoss, * outBatteryToInverterDC, - * outInterconnectionLoss, - * outCritLoadUnmet, + * outInterconnectionLoss, + * outCritLoadUnmet, * outCritLoad, * outUnmetLosses, * outAnnualSystemChargeEnergy, @@ -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; diff --git a/ssc/common.cpp b/ssc/common.cpp index 89e95185b..908f0a032 100644 --- a/ssc/common.cpp +++ b/ssc/common.cpp @@ -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[] = {