diff --git a/CHANGELOG.md b/CHANGELOG.md index 95a227b61..e9e838ce6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ Classify the change according to the following categories: - Truncate the last day of the year instead of the leap day for leap years ##### Added - Option for ASHP to `force_dispatch` (default = true) which maximizes ASHP thermal output +- Added `min_duration_hours` and `max_duration_hours` for limitting electric storage's energy capacity ## v3.10.2 ### Minor Updates diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index 1803c1732..30598755b 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -90,15 +90,15 @@ version = "0.7.3" [[deps.Blosc_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Lz4_jll", "Zlib_jll", "Zstd_jll"] -git-tree-sha1 = "c5acdf7065862659dd4245494c40c90a66308651" +git-tree-sha1 = "ef12cdd1c7fb7e1dfd6fa8fd60d4db6bc61d2f23" uuid = "0b7ba130-8d10-5ba8-a3d6-c5182647fed9" -version = "1.21.6+1" +version = "1.21.6+0" [[deps.Bzip2_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "35abeca13bc0425cff9e59e229d971f5231323bf" +git-tree-sha1 = "8873e196c2eb87962a2048b3b8e08946535864a1" uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" -version = "1.0.8+3" +version = "1.0.8+2" [[deps.CEnum]] git-tree-sha1 = "eb4cb44a499229b3b8426dcfb5dd85333951ff90" @@ -137,9 +137,9 @@ version = "100.1700.700+1" [[deps.CodecBzip2]] deps = ["Bzip2_jll", "TranscodingStreams"] -git-tree-sha1 = "84990fa864b7f2b4901901ca12736e45ee79068c" +git-tree-sha1 = "e7c529cc31bb85b97631b922fa2e6baf246f5905" uuid = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd" -version = "0.8.5" +version = "0.8.4" [[deps.CodecZlib]] deps = ["TranscodingStreams", "Zlib_jll"] @@ -319,9 +319,9 @@ version = "0.1.11" [[deps.Expat_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "f42a5b1e20e009a43c3646635ed81a9fcaccb287" +git-tree-sha1 = "e51db81749b0777b2147fbe7b783ee79045b8e99" uuid = "2e619515-83b5-522b-bb60-26c02a35a201" -version = "2.6.4+2" +version = "2.6.4+1" [[deps.Extents]] git-tree-sha1 = "81023caa0021a41712685887db1fc03db26f41f5" @@ -415,7 +415,7 @@ uuid = "0329782f-3d07-4b52-b9f6-d3137cf03c7a" version = "1.0.2" [[deps.GhpGhx]] -git-tree-sha1 = "bddcbcddc9a4ae7ae4f1ea7d4d8ccf38507d4071" +git-tree-sha1 = "c2f3becdf925f287778fa088da6da01e307f6ce8" repo-rev = "main" repo-url = "https://github.com/NREL/GhpGhx.jl.git" uuid = "7ce85f02-24a8-4d69-a3f0-14b5daa7d30c" @@ -452,28 +452,28 @@ uuid = "0234f1f7-429e-5d53-9886-15a909be8d59" version = "1.14.2+1" [[deps.HTTP]] -deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] -git-tree-sha1 = "abbbb9ec3afd783a7cbd82ef01dcd088ea051398" +deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "PrecompileTools", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] +git-tree-sha1 = "c67b33b085f6e2faf8bf79a61962e7339a81129c" uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" -version = "1.10.1" +version = "1.10.15" [[deps.HiGHS]] deps = ["HiGHS_jll", "MathOptInterface", "PrecompileTools", "SparseArrays"] -git-tree-sha1 = "fce13308f09771b160232903cad57be39a8a0ebb" +git-tree-sha1 = "5360ef81c3952f29624ec75ad0045d079c6379f3" uuid = "87dc4568-4c63-4d18-b0c0-bb2238e4078b" -version = "1.7.5" +version = "1.12.2" [[deps.HiGHS_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Zlib_jll"] -git-tree-sha1 = "f596ee3668df8587158bcaef1ae47bf75bc0fe39" +git-tree-sha1 = "cc963ae42b15ccd2536fb7a6254c0328b404347c" uuid = "8fd58aa0-07eb-5a78-9b36-339c94fd15ea" -version = "1.6.0+1" +version = "1.8.1+0" [[deps.Hwloc_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "290232556f4ffb60ac3e476acf28e1a46e764742" +git-tree-sha1 = "50aedf345a709ab75872f80a2779568dc0bb461b" uuid = "e33a78d0-f292-5ffc-b300-72abe9b543c8" -version = "2.11.2+2" +version = "2.11.2+1" [[deps.ImageCore]] deps = ["AbstractFFTs", "ColorVectorSpace", "Colors", "FixedPointNumbers", "Graphics", "MappedArrays", "MosaicViews", "OffsetArrays", "PaddedViews", "Reexport"] @@ -526,9 +526,9 @@ version = "1.3.1" [[deps.Ipopt_jll]] deps = ["ASL_jll", "Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "MUMPS_seq_jll", "SPRAL_jll", "libblastrampoline_jll"] -git-tree-sha1 = "4f55ad688c698a4f77d892a1cb673f7e8a30f178" +git-tree-sha1 = "546c40fd3718c65d48296dd6cec98af9904e3ca4" uuid = "9cc047cb-c261-5740-88fc-0cf96f7bdcc7" -version = "300.1400.1700+0" +version = "300.1400.1400+0" [[deps.IrrationalConstants]] git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" @@ -553,9 +553,9 @@ version = "0.13.5" [[deps.JLLWrappers]] deps = ["Artifacts", "Preferences"] -git-tree-sha1 = "a007feb38b422fbdab534406aeca1b86823cb4d6" +git-tree-sha1 = "be3dc50a92e5a386872a493a10050136d4703f9b" uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.7.0" +version = "1.6.1" [[deps.JSON]] deps = ["Dates", "Mmap", "Parsers", "Unicode"] @@ -565,15 +565,15 @@ version = "0.21.4" [[deps.JpegTurbo_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "3447a92280ecaad1bd93d3fce3d408b6cfff8913" +git-tree-sha1 = "ef10afc9f4b942bcd75f4c3bc9d9e8d802944c23" uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8" -version = "3.1.0+1" +version = "3.1.0+0" [[deps.JuMP]] -deps = ["LinearAlgebra", "MacroTools", "MathOptInterface", "MutableArithmetics", "OrderedCollections", "Printf", "SnoopPrecompile", "SparseArrays"] -git-tree-sha1 = "cd161958e8b47f9696a6b03f563afb4e5fe8f703" +deps = ["LinearAlgebra", "MacroTools", "MathOptInterface", "MutableArithmetics", "OrderedCollections", "PrecompileTools", "Printf", "SparseArrays"] +git-tree-sha1 = "866dd0bf0474f0d5527c2765c71889762ba90a27" uuid = "4076af6c-e467-56ae-b986-b466b2749572" -version = "1.17.0" +version = "1.23.5" [deps.JuMP.extensions] JuMPDimensionalDataExt = "DimensionalData" @@ -687,9 +687,9 @@ version = "1.1.0" [[deps.Lz4_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "dbd00758ab9d8f454b2feadb6071eb50af62c824" +git-tree-sha1 = "abf88ff67f4fd89839efcae2f4c39cbc4ecd0846" uuid = "5ced341a-0733-55b8-9ab6-a4889d929147" -version = "1.10.0+2" +version = "1.10.0+1" [[deps.METIS_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -711,15 +711,15 @@ version = "0.1.11" [[deps.MPItrampoline_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"] -git-tree-sha1 = "4e6c1eb421039b0d26e0fd483fa87651da0f3f57" +git-tree-sha1 = "70e830dab5d0775183c99fc75e4c24c614ed7142" uuid = "f1f71cc9-e9ae-5b93-9b94-4fe0e1ad3748" -version = "5.5.1+1" +version = "5.5.1+0" [[deps.MUMPS_seq_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "METIS_jll", "libblastrampoline_jll"] -git-tree-sha1 = "0eab12f94948ca67908aec14b9f2ebefd17463fe" +git-tree-sha1 = "840b83c65b27e308095c139a457373850b2f5977" uuid = "d7ed1dd3-d0ae-5e8e-bfb4-87a502085b8d" -version = "500.700.301+0" +version = "500.600.201+0" [[deps.MacroTools]] deps = ["Markdown", "Random"] @@ -738,9 +738,9 @@ uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" [[deps.MathOptInterface]] deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "DataStructures", "ForwardDiff", "JSON", "LinearAlgebra", "MutableArithmetics", "NaNMath", "OrderedCollections", "PrecompileTools", "Printf", "SparseArrays", "SpecialFunctions", "Test", "Unicode"] -git-tree-sha1 = "362ae34a5291a79e16b8eb87b5738532c5e799ff" +git-tree-sha1 = "e065ca5234f53fd6f920efaee4940627ad991fb4" uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" -version = "1.23.0" +version = "1.34.0" [[deps.MbedTLS]] deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "NetworkOptions", "Random", "Sockets"] @@ -780,9 +780,9 @@ version = "2023.1.10" [[deps.MutableArithmetics]] deps = ["LinearAlgebra", "SparseArrays", "Test"] -git-tree-sha1 = "806eea990fb41f9b36f1253e5697aa645bf6a9f8" +git-tree-sha1 = "a2710df6b0931f987530f59427441b21245d8f5e" uuid = "d8a4904e-b15c-11e9-3269-09a3773c0cb0" -version = "1.4.0" +version = "1.6.0" [[deps.NaNMath]] deps = ["OpenLibm_jll"] @@ -847,9 +847,9 @@ version = "1.4.3" [[deps.OpenSSL_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "f58782a883ecbf9fb48dcd363f9ccd65f36c23a8" +git-tree-sha1 = "7493f61f55a6cce7325f197443aa80d32554ba10" uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" -version = "3.0.15+2" +version = "3.0.15+1" [[deps.OpenSpecFun_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] @@ -986,22 +986,22 @@ version = "2.2.2" SymPyPythonCall = "bc8888f7-b21e-4b7c-a06a-5d9c9496438c" [[deps.SCIP]] -deps = ["Ipopt_jll", "Libdl", "LinearAlgebra", "MathOptInterface", "SCIP_PaPILO_jll", "SCIP_jll"] -git-tree-sha1 = "ac0512c46cd91744f62463514f2c581025ea5b93" +deps = ["Libdl", "LinearAlgebra", "MathOptInterface", "OpenBLAS32_jll", "SCIP_PaPILO_jll", "SCIP_jll"] +git-tree-sha1 = "d6e0a95324766d13b5bc6f10504dd64602cd7c83" uuid = "82193955-e24f-5292-bf16-6f2c5261a85f" -version = "0.11.6" +version = "0.12.1" [[deps.SCIP_PaPILO_jll]] -deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "GMP_jll", "Ipopt_jll", "JLLWrappers", "Libdl", "OpenBLAS32_jll", "Pkg", "Readline_jll", "Zlib_jll", "bliss_jll", "boost_jll", "oneTBB_jll"] -git-tree-sha1 = "7705b5779724f35d78351548f24c7f7656e61bc2" +deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "GMP_jll", "Ipopt_jll", "JLLWrappers", "Libdl", "OpenBLAS32_jll", "Readline_jll", "Zlib_jll", "bliss_jll", "boost_jll", "oneTBB_jll"] +git-tree-sha1 = "ec8a8b625a481f3b54dc47a15a3e2ec36d14a533" uuid = "fc9abe76-a5e6-5fed-b0b7-a12f309cf031" -version = "0.1.0+3" +version = "900.0.0+0" [[deps.SCIP_jll]] -deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "GMP_jll", "Ipopt_jll", "JLLWrappers", "Libdl", "Pkg", "Readline_jll", "Zlib_jll", "bliss_jll", "boost_jll"] -git-tree-sha1 = "4a23f926d711535640963aea90a3f5d931ae52c7" +deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "GMP_jll", "Ipopt_jll", "JLLWrappers", "Libdl", "Readline_jll", "Zlib_jll", "boost_jll"] +git-tree-sha1 = "2d9c6386b885d181208a0b3863087361c1bfa136" uuid = "e5ac4fe4-a920-5659-9bf8-f9f73e9e79ce" -version = "0.2.1+0" +version = "900.200.0+0" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" @@ -1009,15 +1009,15 @@ version = "0.7.0" [[deps.SPRAL_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "Libdl", "METIS_jll", "libblastrampoline_jll"] -git-tree-sha1 = "11f3da4b25efacd1cec8e263421f2a9003a5e8e0" +git-tree-sha1 = "34b9dacd687cace8aa4d550e3e9bb8615f1a61e9" uuid = "319450e9-13b8-58e8-aa9f-8fd1420848ab" -version = "2024.5.8+0" +version = "2024.1.18+0" [[deps.SQLite_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Zlib_jll"] -git-tree-sha1 = "7b5b0b963000117848dfe9199bbe4f528e37c5fd" +git-tree-sha1 = "e84fab7d16107342d7638fbd519151d9a0d80720" uuid = "76ed43ae-9a5d-5a62-8c75-30186b810ce8" -version = "3.47.2+1" +version = "3.47.2+0" [[deps.SentinelArrays]] deps = ["Dates", "Random"] @@ -1170,10 +1170,10 @@ uuid = "76eceee3-57b5-4d4a-8e66-0e911cebbf60" version = "1.6.1" [[deps.Xpress]] -deps = ["Libdl", "LinearAlgebra", "MathOptInterface", "SparseArrays"] -git-tree-sha1 = "29c47b54b6938852a598fc6761ed927aad61f10e" +deps = ["Libdl", "MathOptInterface"] +git-tree-sha1 = "f48ea69baa747f63b0d08c89ce7bc38d8ef62bd4" uuid = "9e70acf3-d6c9-5be6-b5bd-4e2c73e3e054" -version = "0.16.2" +version = "0.17.1" [[deps.Zlib_jll]] deps = ["Libdl"] @@ -1182,9 +1182,9 @@ version = "1.2.13+1" [[deps.Zstd_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "7dc5adc3f9bfb9b091b7952f4f6048b7e37acafc" +git-tree-sha1 = "555d1076590a6cc2fdee2ef1469451f872d8b41b" uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" -version = "1.5.6+2" +version = "1.5.6+1" [[deps.bliss_jll]] deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] @@ -1194,9 +1194,9 @@ version = "0.77.0+1" [[deps.boost_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] -git-tree-sha1 = "7a89efe0137720ca82f99e8daa526d23120d0d37" +git-tree-sha1 = "d9484c66c733c1c84f1d4cfef538d3c7b9d32199" uuid = "28df3c45-c428-5900-9ff8-a3135698ca75" -version = "1.76.0+1" +version = "1.79.0+1" [[deps.libaec_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -1217,9 +1217,9 @@ version = "100.700.100+0" [[deps.libpng_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Zlib_jll"] -git-tree-sha1 = "9c42636e3205e555e5785e902387be0061e7efc1" +git-tree-sha1 = "b70c870239dc3d7bc094eb2d6be9b73d27bef280" uuid = "b53b4c65-9356-5827-b1ea-8c7a1a84506f" -version = "1.6.44+1" +version = "1.6.44+0" [[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] diff --git a/reoptjl/migrations/0071_electricstorageinputs_max_duration_hours_and_more.py b/reoptjl/migrations/0071_electricstorageinputs_max_duration_hours_and_more.py new file mode 100644 index 000000000..7d6235807 --- /dev/null +++ b/reoptjl/migrations/0071_electricstorageinputs_max_duration_hours_and_more.py @@ -0,0 +1,24 @@ +# Generated by Django 4.0.7 on 2024-12-11 21:23 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('reoptjl', '0070_merge_20240925_0600'), + ] + + operations = [ + migrations.AddField( + model_name='electricstorageinputs', + name='max_duration_hours', + field=models.FloatField(blank=True, default=100000.0, help_text='Maximum amount of time storage can discharge at its rated power capacity', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000.0)]), + ), + migrations.AddField( + model_name='electricstorageinputs', + name='min_duration_hours', + field=models.FloatField(blank=True, default=0.0, help_text='Minimum amount of time storage can discharge at its rated power capacity', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000.0)]), + ), + ] diff --git a/reoptjl/migrations/0072_alter_electricstorageinputs_max_duration_hours_and_more.py b/reoptjl/migrations/0072_alter_electricstorageinputs_max_duration_hours_and_more.py new file mode 100644 index 000000000..c652873d2 --- /dev/null +++ b/reoptjl/migrations/0072_alter_electricstorageinputs_max_duration_hours_and_more.py @@ -0,0 +1,24 @@ +# Generated by Django 4.0.7 on 2024-12-26 19:37 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('reoptjl', '0071_electricstorageinputs_max_duration_hours_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='electricstorageinputs', + name='max_duration_hours', + field=models.FloatField(blank=True, default=100000.0, help_text='Maximum amount of time storage can discharge at its rated power capacity', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='electricstorageinputs', + name='min_duration_hours', + field=models.FloatField(blank=True, default=0.0, help_text='Minimum amount of time storage can discharge at its rated power capacity', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + ] diff --git a/reoptjl/models.py b/reoptjl/models.py index f6a5680eb..7f375aa83 100644 --- a/reoptjl/models.py +++ b/reoptjl/models.py @@ -3449,6 +3449,24 @@ class ElectricStorageInputs(BaseModel, models.Model): blank=True, help_text="Rebate based on installed energy capacity" ) + min_duration_hours = models.FloatField( + default=0.0, + validators=[ + MinValueValidator(0), + MaxValueValidator(1.0e9) + ], + blank=True, + help_text="Minimum amount of time storage can discharge at its rated power capacity" + ) + max_duration_hours = models.FloatField( + default=100000.0, + validators=[ + MinValueValidator(0), + MaxValueValidator(1.0e9) + ], + blank=True, + help_text="Maximum amount of time storage can discharge at its rated power capacity" + ) class ElectricStorageOutputs(BaseModel, models.Model): diff --git a/reoptjl/test/posts/all_inputs_test.json b/reoptjl/test/posts/all_inputs_test.json index fbc26998a..fa2e13683 100644 --- a/reoptjl/test/posts/all_inputs_test.json +++ b/reoptjl/test/posts/all_inputs_test.json @@ -152,6 +152,8 @@ "max_kw": 100.0, "min_kwh": 200.0, "max_kwh": 200.0, + "min_duration_hours": 2.0, + "max_duration_hours": 2.0, "internal_efficiency_fraction": 0.975, "inverter_efficiency_fraction": 0.96, "rectifier_efficiency_fraction": 0.96, diff --git a/reoptjl/test/test_job_endpoint.py b/reoptjl/test/test_job_endpoint.py index 579e16806..90810dfef 100644 --- a/reoptjl/test/test_job_endpoint.py +++ b/reoptjl/test/test_job_endpoint.py @@ -296,7 +296,7 @@ def test_hybridghp(self): r = json.loads(resp.content) # calculated_ghx_residual_value 117065.83 - self.assertAlmostEqual(r["outputs"]["GHP"]["ghx_residual_value_present_value"], 117065.83, delta=500) + self.assertAlmostEqual(r["outputs"]["GHP"]["ghx_residual_value_present_value"], 127016.435, delta=500) def test_centralghp(self): post_file = os.path.join('reoptjl', 'test', 'posts', 'central_plant_ghp.json') @@ -311,7 +311,7 @@ def test_centralghp(self): resp = self.api_client.get(f'/v3/job/{run_uuid}/results') r = json.loads(resp.content) - self.assertAlmostEqual(r["outputs"]["Financial"]["lifecycle_capital_costs"], 1046066.8, delta=1000) + self.assertAlmostEqual(r["outputs"]["Financial"]["lifecycle_capital_costs"], 1031109.4092, delta=1000) def test_ashp_defaults_update_from_julia(self): # Test that the inputs_with_defaults_set_in_julia feature worked for ASHPSpaceHeater