Skip to content
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

add and change outputs (v3); bug fix (v2) #435

Merged
merged 20 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ Classify the change according to the following categories:
##### Removed
### Patches

## Develop - 2023-03-09
### Minor Updates
##### Added
- In job/ app (v3), added Financial **year_one_om_costs_before_tax_bau**, **lifecycle_om_costs_after_tax_bau**
##### Changed
- In job/ app (v3), changed Financial **breakeven_cost_of_emissions_reduction_per_tonnes_CO2** to **breakeven_cost_of_emissions_reduction_per_tonne_CO2**
- In job/ app (v3), changed default ElectricLoad **year** to 2022 if user provides load data and 2017 if using CRBD
##### Fixed
- In reo (v2), calculation of `net_capital_costs_plus_om` was previously missing addition sign for fuel charges. Corrected this equation.
## Develop 3/8/2023
## Develop 2023-03-16
### Minor Updates
##### Added
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Generated by Django 4.0.7 on 2023-03-09 19:00

import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('job', '0026_alter_chpinputs_federal_itc_fraction_and_more'),
]

operations = [
migrations.RenameField(
model_name='financialoutputs',
old_name='breakeven_cost_of_emissions_reduction_per_tonnes_CO2',
new_name='breakeven_cost_of_emissions_reduction_per_tonne_CO2',
),
migrations.AddField(
model_name='financialoutputs',
name='lifecycle_om_costs_after_tax_bau',
field=models.FloatField(blank=True, help_text='BAU Component of lifecycle costs (LCC). This value is the present value of all O&M costs, after tax in the BAU case.', null=True),
),
migrations.AddField(
model_name='financialoutputs',
name='year_one_om_costs_before_tax_bau',
field=models.FloatField(blank=True, help_text='Year one operations and maintenance cost before tax in the BAU case.', null=True),
),
migrations.AlterField(
model_name='electricloadinputs',
name='year',
field=models.IntegerField(blank=True, default=2022, help_text="Year of Custom Load Profile. If a custom load profile is uploaded via the loads_kw parameter, it is important that this year correlates with the load profile so that weekdays/weekends are determined correctly for the utility rate tariff. If a DOE Reference Building profile (aka 'simulated' profile) is used, the year is set to 2017 since the DOE profiles start on a Sunday.", null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(9999)]),
),
]
14 changes: 14 additions & 0 deletions job/migrations/0028_merge_20230309_2246.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 4.0.7 on 2023-03-09 22:46

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('job', '0027_rename_breakeven_cost_of_emissions_reduction_per_tonnes_co2_financialoutputs_breakeven_cost_of_emiss'),
('job', '0027_reoptjlmessageoutputs_has_stacktrace'),
]

operations = [
]
14 changes: 14 additions & 0 deletions job/migrations/0029_merge_20230316_1432.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 4.0.7 on 2023-03-16 14:32

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('job', '0028_merge_20230309_2246'),
('job', '0028_merge_20230314_2001'),
]

operations = [
]
12 changes: 10 additions & 2 deletions job/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,10 @@ class FinancialOutputs(BaseModel, models.Model):
null=True, blank=True,
help_text="Year one operations and maintenance cost before tax."
)
year_one_om_costs_before_tax_bau = models.FloatField(
null=True, blank=True,
help_text="Year one operations and maintenance cost before tax in the BAU case."
)
simple_payback_years = models.FloatField(
null=True, blank=True,
help_text=("Number of years until the cumulative annual cashflows turn positive. "
Expand Down Expand Up @@ -984,6 +988,10 @@ class FinancialOutputs(BaseModel, models.Model):
null=True, blank=True,
help_text=("Component of lifecycle costs (LCC). This value is the present value of all O&M costs, after tax.")
)
lifecycle_om_costs_after_tax_bau = models.FloatField(
null=True, blank=True,
help_text=("BAU Component of lifecycle costs (LCC). This value is the present value of all O&M costs, after tax in the BAU case.")
)
lifecycle_fuel_costs_after_tax = models.FloatField(
null=True, blank=True,
help_text=("Component of lifecycle costs (LCC). This value is the present value of all fuel costs over the analysis period, after tax.")
Expand Down Expand Up @@ -1047,7 +1055,7 @@ class FinancialOutputs(BaseModel, models.Model):
null=True, blank=True,
help_text="Total cost of NOx, SO2, and PM2.5 emissions associated with the site's energy consumption over the analysis period in the BAU case."
)
breakeven_cost_of_emissions_reduction_per_tonnes_CO2 = models.FloatField(
breakeven_cost_of_emissions_reduction_per_tonne_CO2 = models.FloatField(
null=True, blank=True,
help_text=("Cost of emissions required to breakeven (NPV = 0) compared to the BAU case LCC."
"If the cost of health emissions were included in the objective function,"
Expand Down Expand Up @@ -1114,7 +1122,7 @@ class ElectricLoadInputs(BaseModel, models.Model):
"https://energy.gov/eere/buildings/commercial-reference-buildings")
)
year = models.IntegerField(
default=2020,
default=2022,
validators=[
MinValueValidator(1),
MaxValueValidator(9999)
Expand Down
3 changes: 2 additions & 1 deletion job/test/posts/outage.json

Large diffs are not rendered by default.

58 changes: 18 additions & 40 deletions julia_src/Manifest.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# This file is machine-generated - editing it directly is not advised

julia_version = "1.8.5"
julia_version = "1.7.1"
manifest_format = "2.0"
project_hash = "90e66426e70d2bf97b8a3e99508fcb404743b11d"

[[deps.AbstractFFTs]]
deps = ["ChainRulesCore", "LinearAlgebra"]
git-tree-sha1 = "cc61a64f46fdca6cb0d26a6c90f4a4f74f53de11"
git-tree-sha1 = "16b6dbc4cf7caee4e1e75c49485ec67b667098a0"
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c"
version = "1.3.0"
version = "1.3.1"

[[deps.Adapt]]
deps = ["LinearAlgebra", "Requires"]
Expand All @@ -24,7 +24,6 @@ version = "0.9.3"

[[deps.ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
version = "1.1.1"

[[deps.Arrow_jll]]
deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Lz4_jll", "Pkg", "Thrift_jll", "Zlib_jll", "boost_jll", "snappy_jll"]
Expand Down Expand Up @@ -141,7 +140,6 @@ version = "4.6.1"
[[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
version = "1.0.1+0"

[[deps.ConstructionBase]]
deps = ["LinearAlgebra"]
Expand Down Expand Up @@ -225,9 +223,8 @@ uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.9.3"

[[deps.Downloads]]
deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
deps = ["ArgTools", "LibCURL", "NetworkOptions"]
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
version = "1.6.0"

[[deps.Expat_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
Expand Down Expand Up @@ -258,9 +255,6 @@ git-tree-sha1 = "e27c4ebe80e8699540f2d6c805cc12203b614f12"
uuid = "48062228-2e41-5def-b9a4-89aafe57970f"
version = "0.9.20"

[[deps.FileWatching]]
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"

[[deps.FixedPointNumbers]]
deps = ["Statistics"]
git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc"
Expand Down Expand Up @@ -400,9 +394,9 @@ uuid = "3587e190-3f89-42d0-90ee-14403ec27112"
version = "0.1.8"

[[deps.InvertedIndices]]
git-tree-sha1 = "82aec7a3dd64f4d9584659dc0b62ef7db2ef3e19"
git-tree-sha1 = "0dc7b50b8d436461be01300fd8cd45aa0274b038"
uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f"
version = "1.2.0"
version = "1.3.0"

[[deps.IrrationalConstants]]
git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2"
Expand Down Expand Up @@ -475,12 +469,10 @@ version = "1.3.0"
[[deps.LibCURL]]
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
version = "0.6.3"

[[deps.LibCURL_jll]]
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
version = "7.84.0+0"

[[deps.LibGit2]]
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
Expand All @@ -495,7 +487,6 @@ version = "14.3.0+1"
[[deps.LibSSH2_jll]]
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
version = "1.10.2+0"

[[deps.Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Expand Down Expand Up @@ -579,7 +570,6 @@ version = "1.1.7"
[[deps.MbedTLS_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
version = "2.28.0+0"

[[deps.Memento]]
deps = ["Dates", "Distributed", "Requires", "Serialization", "Sockets", "Test", "UUIDs"]
Expand All @@ -604,7 +594,6 @@ version = "0.3.4"

[[deps.MozillaCACerts_jll]]
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
version = "2022.2.1"

[[deps.MutableArithmetics]]
deps = ["LinearAlgebra", "SparseArrays", "Test"]
Expand All @@ -626,7 +615,6 @@ version = "400.902.5+1"

[[deps.NetworkOptions]]
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
version = "1.2.0"

[[deps.OffsetArrays]]
deps = ["Adapt"]
Expand All @@ -637,7 +625,6 @@ version = "1.12.9"
[[deps.OpenBLAS_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"
version = "0.3.20+0"

[[deps.OpenJpeg_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libtiff_jll", "LittleCMS_jll", "Pkg", "libpng_jll"]
Expand All @@ -648,7 +635,6 @@ version = "2.4.0+0"
[[deps.OpenLibm_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "05823500-19ac-5b8b-9628-191a04bc5112"
version = "0.8.1+0"

[[deps.OpenSSL_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
Expand Down Expand Up @@ -688,7 +674,6 @@ version = "2.5.8"
[[deps.Pkg]]
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
version = "1.8.0"

[[deps.PolyhedralRelaxations]]
deps = ["DataStructures", "ForwardDiff", "JuMP", "Logging", "LoggingExtras"]
Expand Down Expand Up @@ -716,9 +701,9 @@ version = "1.3.0"

[[deps.PrettyTables]]
deps = ["Crayons", "Formatting", "LaTeXStrings", "Markdown", "Reexport", "StringManipulation", "Tables"]
git-tree-sha1 = "96f6db03ab535bdb901300f88335257b0018689d"
git-tree-sha1 = "548793c7859e28ef026dba514752275ee871169f"
uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
version = "2.2.2"
version = "2.2.3"

[[deps.Printf]]
deps = ["Unicode"]
Expand All @@ -734,9 +719,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

[[deps.REopt]]
deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"]
git-tree-sha1 = "3bb28641a7293713f15378205effa3f19dfdc90c"
git-tree-sha1 = "1865a036eef47fe44dd4199efc72ba8738f27351"
uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6"
version = "0.27.0"
version = "0.28.0"

[[deps.Random]]
deps = ["SHA", "Serialization"]
Expand Down Expand Up @@ -766,13 +751,12 @@ version = "1.3.0"

[[deps.Roots]]
deps = ["ChainRulesCore", "CommonSolve", "Printf", "Setfield"]
git-tree-sha1 = "9c2f5d3768804ed465f0c51540c6074ae9f63900"
git-tree-sha1 = "b45deea4566988994ebb8fb80aa438a295995a6e"
uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
version = "2.0.9"
version = "2.0.10"

[[deps.SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
version = "0.7.0"

[[deps.SQLite_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Zlib_jll"]
Expand Down Expand Up @@ -828,9 +812,9 @@ version = "0.1.1"

[[deps.StaticArrays]]
deps = ["LinearAlgebra", "Random", "StaticArraysCore", "Statistics"]
git-tree-sha1 = "2d7d9e1ddadc8407ffd460e24218e37ef52dd9a3"
git-tree-sha1 = "6aa098ef1012364f2ede6b17bf358c7f1fbe90d4"
uuid = "90137ffa-7385-5640-81b9-e52037218182"
version = "1.5.16"
version = "1.5.17"

[[deps.StaticArraysCore]]
git-tree-sha1 = "6b7ba252635a5eff6a0b0664a41ee140a1c9e72a"
Expand All @@ -849,7 +833,6 @@ version = "0.3.0"
[[deps.TOML]]
deps = ["Dates"]
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
version = "1.0.0"

[[deps.TableTraits]]
deps = ["IteratorInterfaceExtensions"]
Expand All @@ -859,14 +842,13 @@ version = "1.0.1"

[[deps.Tables]]
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits", "Test"]
git-tree-sha1 = "c79322d36826aa2f4fd8ecfa96ddb47b174ac78d"
git-tree-sha1 = "1544b926975372da01227b382066ab70e574a3ec"
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
version = "1.10.0"
version = "1.10.1"

[[deps.Tar]]
deps = ["ArgTools", "SHA"]
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
version = "1.10.1"

[[deps.TensorCore]]
deps = ["LinearAlgebra"]
Expand All @@ -880,9 +862,9 @@ uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[deps.TestEnv]]
deps = ["Pkg"]
git-tree-sha1 = "b5a483bcc8c9f0df569101df166601e5e699f346"
git-tree-sha1 = "df6f1b5f13936504ba45088e13a62a6930cdabf7"
uuid = "1e6cf692-eddd-4d53-88a5-2d735e33781b"
version = "1.9.3"
version = "1.7.4"

[[deps.Thrift_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "boost_jll"]
Expand Down Expand Up @@ -940,7 +922,6 @@ version = "0.15.5"
[[deps.Zlib_jll]]
deps = ["Libdl"]
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
version = "1.2.12+3"

[[deps.Zstd_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
Expand All @@ -957,7 +938,6 @@ version = "1.76.0+1"
[[deps.libblastrampoline_jll]]
deps = ["Artifacts", "Libdl", "OpenBLAS_jll"]
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
version = "5.1.1+0"

[[deps.libgeotiff_jll]]
deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "Libtiff_jll", "PROJ_jll", "Pkg"]
Expand All @@ -974,12 +954,10 @@ version = "1.6.38+0"
[[deps.nghttp2_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
version = "1.48.0+0"

[[deps.p7zip_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
version = "17.4.0+0"

[[deps.snappy_jll]]
deps = ["Artifacts", "JLLWrappers", "LZO_jll", "Libdl", "Pkg", "Zlib_jll"]
Expand Down
2 changes: 1 addition & 1 deletion julia_src/reopt_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2338,7 +2338,7 @@ end
function add_util_results(m, p, r::Dict)
net_capital_costs_plus_om = value(m[:TotalTechCapCosts] + m[:TotalStorageCapCosts] + m[:GHPCapCosts]) +
value(m[:TotalPerUnitSizeOMCosts] + m[:TotalPerUnitProdOMCosts]
+ m[:TotalHourlyCHPOMCosts] + m[:GHPOMCosts]) * m[:r_tax_fraction_owner]
+ m[:TotalHourlyCHPOMCosts] + m[:GHPOMCosts]) * m[:r_tax_fraction_owner] +
adfarth marked this conversation as resolved.
Show resolved Hide resolved
value(m[:TotalFuelCharges]) * m[:r_tax_fraction_offtaker]

total_om_costs_after_tax = value(m[:TotalPerUnitSizeOMCosts] + m[:TotalPerUnitProdOMCosts]
Expand Down