Skip to content

Commit

Permalink
combine terms that can be DC in AnnualREEleckWh calc
Browse files Browse the repository at this point in the history
  • Loading branch information
hdunham committed Jan 12, 2024
1 parent 528f444 commit 7707429
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/constraints/renewable_energy_constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ function add_re_elec_calcs(m,p)
# end

m[:AnnualREEleckWh] = @expression(m,p.hours_per_time_step * (
sum(p.production_factor[t,ts] * p.levelization_factor[t] * m[:dvRatedProduction][t,ts] *
p.tech_renewable_energy_fraction[t] for t in p.techs.elec, ts in p.time_steps
) #total RE elec generation, excl steam turbine
- sum(m[:dvProductionToStorage][b,t,ts]*p.tech_renewable_energy_fraction[t]*(
1-p.s.storage.attr[b].charge_efficiency*p.s.storage.attr[b].discharge_efficiency)
for t in p.techs.elec, b in p.s.storage.types.elec, ts in p.time_steps
) #minus battery efficiency losses
- sum(m[:dvCurtail][t,ts]*p.tech_renewable_energy_fraction[t] for t in p.techs.elec, ts in p.time_steps) # minus curtailment.
sum((p.production_factor[t,ts] * p.levelization_factor[t] * m[:dvRatedProduction][t,ts] #total RE elec generation, excl steam turbine
- m[:dvCurtail][t,ts] #minus curtailment
- sum(m[:dvProductionToStorage][b,t,ts]
*(1-p.s.storage.attr[b].charge_efficiency*p.s.storage.attr[b].discharge_efficiency)
for b in p.s.storage.types.elec)) #minus battery efficiency losses
* p.tech_renewable_energy_fraction[t]
for t in p.techs.elec, ts in p.time_steps
)
- (1 - p.s.site.include_exported_renewable_electricity_in_total) *
sum(m[:dvProductionToGrid][t,u,ts]*p.tech_renewable_energy_fraction[t]
for t in p.techs.elec, u in p.export_bins_by_tech[t], ts in p.time_steps
Expand Down

0 comments on commit 7707429

Please sign in to comment.