Skip to content

Commit

Permalink
added GHP tests for URBANopt LCCA
Browse files Browse the repository at this point in the history
  • Loading branch information
atpham88 committed Sep 29, 2024
1 parent 372f8cd commit f70754b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1891,6 +1891,8 @@ else # run HiGHS tests
4. GHP serves all the Cooling load
5. Input of a custom COP map for GHP and check the GHP performance to make sure it's using it correctly
6. Hybrid GHP capability functions as expected
7. Check GHP LCC calculation for URBANopt
8. Check GHX LCC calculation for URBANopt
"""
# Load base inputs
Expand Down Expand Up @@ -1963,6 +1965,31 @@ else # run HiGHS tests
# Average COP which includes pump power should be lower than Heat Pump only COP specified by the map
@test heating_cop_avg <= 4.0
@test cooling_cop_avg <= 8.0

# Check GHP LCC calculation for URBANopt
ghp_data = JSON.parsefile("scenarios/ghp_urbanopt.json")
s = Scenario(ghp_data)
ghp_inputs = REoptInputs(s)
m = Model(optimizer_with_attributes(HiGHS.Optimizer, "output_flag" => false, "log_to_console" => false, "mip_rel_gap" => 0.01))
results = run_reopt(m, ghp_inputs)
ghp_lcc = results["Financial"]["lcc"]
ghp_lccc = results["Financial"]["lifecycle_capital_costs"]
ghp_lccc_initial = results["Financial"]["initial_capital_costs"]
ghp_ebill = results["Financial"]["lifecycle_elecbill_after_tax"]
@test ghp_lcc - ghp_lccc - ghp_ebill <= 0.1
@test ghp_lccc/ghp_lccc_initial - 0.51 <= 0.01

# Check GHX LCC calculation for URBANopt
ghx_data = JSON.parsefile("scenarios/ghx_urbanopt.json")
s = Scenario(ghx_data)
ghx_inputs = REoptInputs(s)
m = Model(optimizer_with_attributes(HiGHS.Optimizer, "output_flag" => false, "log_to_console" => false, "mip_rel_gap" => 0.01))
results = run_reopt(m, ghx_inputs)
ghx_lcc = results["Financial"]["lcc"]
ghx_lccc = results["Financial"]["lifecycle_capital_costs"]
ghx_lccc_initial = results["Financial"]["initial_capital_costs"]
@test ghx_lcc <= ghx_lccc
@test ghx_lccc/ghx_lccc_initial - 0.51 <= 0.01
end

@testset "Hybrid GHX and GHP calculated costs validation" begin
Expand Down
1 change: 1 addition & 0 deletions test/scenarios/ghp_urbanopt.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/scenarios/ghx_urbanopt.json

Large diffs are not rendered by default.

0 comments on commit f70754b

Please sign in to comment.