Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f605b60
add grid outage variables to the powerflow calcs
brtietz Jul 1, 2021
3617f2a
Merge branch 'develop' of https://github.com/NREL/ssc into grid_outag…
brtietz Jul 6, 2021
e0e3f9e
Merge branch 'develop' of https://github.com/NREL/ssc into grid_outag…
brtietz Jul 7, 2021
76649c5
new test for dc outage with excess PV. Fails as expected because we n…
brtietz Jul 12, 2021
ad9c316
Add (monthly) to the monthly powerflow labels such that we can access…
brtietz Jul 12, 2021
29fed02
Merge branch 'fix_battery_monthly_labels' into grid_outage_powerflow
brtietz Jul 12, 2021
14f5ec1
Revert "Add (monthly) to the monthly powerflow labels such that we ca…
brtietz Jul 12, 2021
1baaff0
pull grid interconnection limit and curtailment variables into the po…
brtietz Jul 15, 2021
6fcc870
first dc outage test passes
brtietz Jul 15, 2021
7012ba7
feature complete DC outage code, next steps: AC outage and interconne…
brtietz Jul 15, 2021
511d805
add code and tests for AC outages
brtietz Jul 15, 2021
9e25000
update grid accounting for DC connected batteries. Takes from PV firs…
brtietz Jul 16, 2021
a7546ed
ac power flow calcs for curtailment
brtietz Jul 16, 2021
ff8a06f
pull loss and crit load variables up to the cmod_battery level
brtietz Jul 16, 2021
9b9bae9
ensure interconnection and curtailment variables are properly provide…
brtietz Jul 19, 2021
e7e1d23
update additional grid vars and loss calculation at end of pvsamv1
brtietz Jul 19, 2021
09e41d8
change default for curtialment vars from array of zeroes to empty array
brtietz Jul 19, 2021
131173f
merge develop, including pv smoothing, into grid outage powerflow
brtietz Jul 28, 2021
acdb6a2
add new arguments from this branch to pv smoothing constructor
brtietz Jul 28, 2021
7fb8032
Merge branch 'develop' into grid_outage_powerflow
brtietz Aug 2, 2021
4a4deac
updates to the update_grid_power equation to handle more cases. The v…
brtietz Aug 2, 2021
8f24826
clean up comments and variable names based on pull request feedback
brtietz Aug 2, 2021
b43fccb
add two new timestep variables ac_perf_adj_loss and ac_lifetime_loss …
brtietz Aug 4, 2021
01d24e6
Merge branch 'develop' of https://github.com/NREL/ssc into grid_outag…
brtietz Aug 5, 2021
0b4dabe
Merge branch 'develop' of https://github.com/NREL/ssc into grid_outag…
brtietz Aug 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions shared/lib_battery_dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Dispatch base class
*/
dispatch_t::dispatch_t(battery_t* Battery, double dt_hour, double SOC_min, double SOC_max, int current_choice, double Ic_max, double Id_max,
double Pc_max_kwdc, double Pd_max_kwdc, double Pc_max_kwac, double Pd_max_kwac,
double t_min, int mode, int battMeterPosition)
double t_min, int mode, int battMeterPosition, double interconnection_limit)
{
// initialize battery power flow
std::unique_ptr<BatteryPowerFlow> tmp(new BatteryPowerFlow(dt_hour));
Expand All @@ -48,6 +48,7 @@ dispatch_t::dispatch_t(battery_t* Battery, double dt_hour, double SOC_min, doubl
m_batteryPower->powerBatteryChargeMaxAC = Pc_max_kwac;
m_batteryPower->powerBatteryDischargeMaxAC = Pd_max_kwac;
m_batteryPower->meterPosition = battMeterPosition;
m_batteryPower->powerInterconnectionLimit = interconnection_limit;

// initalize Battery and a copy of the Battery for iteration
_Battery = Battery;
Expand Down Expand Up @@ -446,6 +447,8 @@ double dispatch_t::power_battery_to_grid() { return m_batteryPower->powerBattery
double dispatch_t::power_fuelcell_to_grid() { return m_batteryPower->powerFuelCellToGrid; }
double dispatch_t::power_conversion_loss() { return m_batteryPower->powerConversionLoss; }
double dispatch_t::power_system_loss() { return m_batteryPower->powerSystemLoss; }
double dispatch_t::power_interconnection_loss() { return m_batteryPower->powerInterconnectionLoss; }
double dispatch_t::power_crit_load_unmet() { return m_batteryPower->powerCritLoadUnmet; }
double dispatch_t::battery_power_to_fill() { return _Battery->power_to_fill(m_batteryPower->stateOfChargeMax); }
double dispatch_t::battery_soc() { return _Battery->SOC(); }
BatteryPowerFlow * dispatch_t::getBatteryPowerFlow() { return m_batteryPowerFlow.get(); }
Expand Down Expand Up @@ -475,10 +478,11 @@ dispatch_automatic_t::dispatch_automatic_t(
bool can_fuelcell_charge,
std::vector<double> battReplacementCostPerkWh,
int battCycleCostChoice,
std::vector<double> battCycleCost
std::vector<double> battCycleCost,
double interconnection_limit
) : dispatch_t(Battery, dt_hour, SOC_min, SOC_max, current_choice, Ic_max, Id_max, Pc_max_kwdc, Pd_max_kwdc, Pc_max_kwac, Pd_max_kwac,

t_min, dispatch_mode, pv_dispatch)
t_min, dispatch_mode, pv_dispatch, interconnection_limit)
{

_dt_hour = dt_hour;
Expand Down
8 changes: 6 additions & 2 deletions shared/lib_battery_dispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ class dispatch_t
double Pd_max_kwac,
double t_min,
int dispatch_mode,
int meter_position);
int meter_position,
double interconnection_limit);

// deep copy constructor (new memory), from dispatch to this
dispatch_t(const dispatch_t& dispatch);
Expand Down Expand Up @@ -106,6 +107,8 @@ class dispatch_t
double power_fuelcell_to_grid();
double power_conversion_loss();
double power_system_loss();
double power_interconnection_loss();
double power_crit_load_unmet();

virtual double power_grid_target(){ return 0;}
virtual double power_batt_target(){ return 0.;}
Expand Down Expand Up @@ -250,7 +253,8 @@ class dispatch_automatic_t : public dispatch_t
bool can_fuelcell_charge,
std::vector<double> battReplacementCostPerkWh,
int battCycleCostChoice,
std::vector<double> battCycleCost
std::vector<double> battCycleCost,
double interconnection_limit
);

virtual ~dispatch_automatic_t(){};
Expand Down
5 changes: 3 additions & 2 deletions shared/lib_battery_dispatch_automatic_btm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ dispatch_automatic_behind_the_meter_t::dispatch_automatic_behind_the_meter_t(
rate_data* util_rate,
std::vector<double> battReplacementCostPerkWh,
int battCycleCostChoice,
std::vector<double> battCycleCost
std::vector<double> battCycleCost,
double interconnection_limit
) : dispatch_automatic_t(Battery, dt_hour, SOC_min, SOC_max, current_choice, Ic_max, Id_max, Pc_max_kwdc, Pd_max_kwdc, Pc_max_kwac, Pd_max_kwac,
t_min, dispatch_mode, pv_dispatch, nyears, look_ahead_hours, dispatch_update_frequency_hours, can_charge, can_clip_charge, can_grid_charge, can_fuelcell_charge,
battReplacementCostPerkWh, battCycleCostChoice, battCycleCost)
battReplacementCostPerkWh, battCycleCostChoice, battCycleCost, interconnection_limit)
{
_P_target_month = -1e16;
_P_target_current = -1e16;
Expand Down
3 changes: 2 additions & 1 deletion shared/lib_battery_dispatch_automatic_btm.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class dispatch_automatic_behind_the_meter_t : public dispatch_automatic_t
rate_data* util_rate,
std::vector<double> battReplacementCostPerkWh,
int battCycleCostChoice,
std::vector<double> battCycleCost
std::vector<double> battCycleCost,
double interconnection_limit
);

~dispatch_automatic_behind_the_meter_t() override {};
Expand Down
5 changes: 3 additions & 2 deletions shared/lib_battery_dispatch_automatic_fom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ dispatch_automatic_front_of_meter_t::dispatch_automatic_front_of_meter_t(
UtilityRate * utilityRate,
double etaPVCharge,
double etaGridCharge,
double etaDischarge) : dispatch_automatic_t(Battery, dt_hour, SOC_min, SOC_max, current_choice, Ic_max, Id_max, Pc_max_kwdc, Pd_max_kwdc, Pc_max_kwac, Pd_max_kwac,
double etaDischarge,
double interconnection_limit) : dispatch_automatic_t(Battery, dt_hour, SOC_min, SOC_max, current_choice, Ic_max, Id_max, Pc_max_kwdc, Pd_max_kwdc, Pc_max_kwac, Pd_max_kwac,
t_min, dispatch_mode, pv_dispatch, nyears, look_ahead_hours, dispatch_update_frequency_hours, can_charge, can_clip_charge, can_grid_charge, can_fuelcell_charge,
battReplacementCostPerkWh, battCycleCostChoice, battCycleCost)
battReplacementCostPerkWh, battCycleCostChoice, battCycleCost, interconnection_limit)
{
// if look behind, only allow 24 hours
if (_mode == dispatch_t::FOM_LOOK_BEHIND)
Expand Down
3 changes: 2 additions & 1 deletion shared/lib_battery_dispatch_automatic_fom.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ class dispatch_automatic_front_of_meter_t : public dispatch_automatic_t
UtilityRate * utilityRate,
double etaPVCharge,
double etaGridCharge,
double etaDischarge
double etaDischarge,
double interconnection_limit
);

~dispatch_automatic_front_of_meter_t();
Expand Down
4 changes: 2 additions & 2 deletions shared/lib_battery_dispatch_manual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ dispatch_manual_t::dispatch_manual_t(battery_t * Battery, double dt, double SOC_
double t_min, int mode, int battMeterPosition,
util::matrix_t<size_t> dm_dynamic_sched, util::matrix_t<size_t> dm_dynamic_sched_weekend,
std::vector<bool> dm_charge, std::vector<bool> dm_discharge, std::vector<bool> dm_gridcharge, std::vector<bool> dm_fuelcellcharge,
std::map<size_t, double> dm_percent_discharge, std::map<size_t, double> dm_percent_gridcharge)
std::map<size_t, double> dm_percent_discharge, std::map<size_t, double> dm_percent_gridcharge, double interconnection_limit)
: dispatch_t(Battery, dt, SOC_min, SOC_max, current_choice, Ic_max, Id_max, Pc_max_kwdc, Pd_max_kwdc, Pc_max_kwac, Pd_max_kwac,
t_min, mode, battMeterPosition)
t_min, mode, battMeterPosition, interconnection_limit)
{
init_with_vects(dm_dynamic_sched, dm_dynamic_sched_weekend, dm_charge, dm_discharge, dm_gridcharge, dm_fuelcellcharge, dm_percent_discharge, dm_percent_gridcharge);
}
Expand Down
5 changes: 3 additions & 2 deletions shared/lib_battery_dispatch_manual.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ class dispatch_manual_t : public dispatch_t
std::vector<bool> can_gridcharge,
std::vector<bool> can_fuelcellcharge,
std::map<size_t, double> dm_percent_discharge,
std::map<size_t, double> dm_percent_gridcharge);
std::map<size_t, double> dm_percent_gridcharge,
double interconnection_limit);

// deep copy constructor (new memory), from dispatch to this
dispatch_manual_t(const dispatch_t& dispatch);
Expand Down Expand Up @@ -106,4 +107,4 @@ class dispatch_manual_t : public dispatch_t

};

#endif // __LIB_BATTERY_DISPATCH_MANUAL_H__
#endif // __LIB_BATTERY_DISPATCH_MANUAL_H__
5 changes: 3 additions & 2 deletions shared/lib_battery_dispatch_pvsmoothing_fom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ dispatch_pvsmoothing_front_of_meter_t::dispatch_pvsmoothing_front_of_meter_t(
bool batt_dispatch_pvs_short_forecast_enable,
double batt_dispatch_pvs_soc_rest,
size_t batt_dispatch_pvs_timestep_multiplier,
double batt_dispatch_pvs_initial_SOC
double batt_dispatch_pvs_initial_SOC,
double interconnection_limit

) : dispatch_automatic_t(Battery, dt_hour, SOC_min, SOC_max, current_choice, Ic_max, Id_max, Pc_max_kwdc, Pd_max_kwdc, Pc_max_kwac, Pd_max_kwac,
t_min, dispatch_mode, pv_dispatch, nyears, look_ahead_hours, dispatch_update_frequency_hours, can_charge, can_clip_charge, can_grid_charge, can_fuelcell_charge,
battReplacementCostPerkWh, battCycleCostChoice, battCycleCost),
battReplacementCostPerkWh, battCycleCostChoice, battCycleCost, interconnection_limit),
m_batt_dispatch_pvs_nameplate_ac(batt_dispatch_pvs_nameplate_ac),
m_batt_dispatch_pvs_ac_lb(batt_dispatch_pvs_ac_lb),
m_batt_dispatch_pvs_ac_lb_enable(batt_dispatch_pvs_ac_lb_enable),
Expand Down
3 changes: 2 additions & 1 deletion shared/lib_battery_dispatch_pvsmoothing_fom.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ class dispatch_pvsmoothing_front_of_meter_t : public dispatch_automatic_t
bool batt_dispatch_pvs_short_forecast_enable,
double batt_dispatch_pvs_soc_rest,
size_t batt_dispatch_pvs_timestep_multiplier,
double batt_dispatch_pvs_initial_SOC
double batt_dispatch_pvs_initial_SOC,
double interconnection_limit
);

~dispatch_pvsmoothing_front_of_meter_t();
Expand Down
Loading