-
Notifications
You must be signed in to change notification settings - Fork 47
Bug fixes in TES-to-Turbine results and CHP heuristic input processing #594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
707085d
04f0106
245d2e4
2524a2e
0023f7e
36905a8
bba8662
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -473,7 +473,11 @@ function Scenario(d::Dict; flex_hvac_from_json=false) | |
| avg_cooling_load_kw = nothing | ||
| absorption_chiller_cop = nothing | ||
| # User can override by explicitly setting include_cooling_in_chp_size = false | ||
| include_cooling_in_size = get(d["CHP"], "include_cooling_in_chp_size", haskey(d, "AbsorptionChiller")) | ||
| if "include_cooling_in_chp_size" in keys(d["CHP"]) | ||
| include_cooling_in_size = pop!(d["CHP"], "include_cooling_in_chp_size") | ||
| else | ||
| include_cooling_in_size = haskey(d, "AbsorptionChiller") | ||
| end | ||
|
|
||
| if max_cooling_demand_kw > 0 && include_cooling_in_size | ||
| # Use already-processed cooling_load object | ||
|
|
@@ -498,7 +502,7 @@ function Scenario(d::Dict; flex_hvac_from_json=false) | |
| sector = site.sector, | ||
| federal_procurement_type = site.federal_procurement_type) | ||
| else # Only if modeling CHP without heating_load and existing_boiler (for prime generator, electric-only) | ||
| chp = CHP(d["CHP"], | ||
| chp = CHP(d["CHP"]; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm curious why this wasn't erroring before, unless we never got into this block. |
||
| electric_load_series_kw = electric_load.loads_kw, | ||
| avg_cooling_load_kw = avg_cooling_load_kw, | ||
| absorption_chiller_cop = absorption_chiller_cop, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,8 +55,8 @@ function add_boiler_results(m::JuMP.AbstractModel, p::REoptInputs, d::Dict; _n=" | |
| r["thermal_to_steamturbine_series_mmbtu_per_hour"] = round.(value.(NewBoilerToSteamTurbine), digits=3) | ||
|
|
||
| if "AbsorptionChiller" in p.techs.cooling | ||
| @expression(m, NewBoilertoAbsorptionChillerKW[ts in p.time_steps], sum(value.(m[:dvHeatToAbsorptionChiller]["Boiler",q,ts] for q in p.heating_loads))) | ||
| @expression(m, NewBoilertoAbsorptionChillerByQualityKW[q in p.heating_loads, ts in p.time_steps], sum(value.(m[:dvHeatToAbsorptionChiller]["Boiler",q,ts]))) | ||
| @expression(m, NewBoilertoAbsorptionChillerKW[ts in p.time_steps], sum(m[:dvHeatToAbsorptionChiller]["Boiler",q,ts] for q in p.heating_loads)) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was this (and all other related changes below) causing an error when creating the results, or is it just less efficient? |
||
| @expression(m, NewBoilertoAbsorptionChillerByQualityKW[q in p.heating_loads, ts in p.time_steps], sum(m[:dvHeatToAbsorptionChiller]["Boiler",q,ts])) | ||
| else | ||
| @expression(m, NewBoilertoAbsorptionChillerKW[ts in p.time_steps], 0.0) | ||
| @expression(m, NewBoilertoAbsorptionChillerByQualityKW[q in p.heating_loads, ts in p.time_steps], 0.0) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pop!() function handles a default value like the get() function does, so this could be reduced to one line:
pop!(d["CHP"], "include_cooling_in_chp_size", haskey(d, "AbsorptionChiller")). If you prefer this more verbose way for clarity, or I'm wrong about that, you can leave it.