Skip to content

Commit

Permalink
add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
adfarth committed Nov 15, 2024
1 parent b9b1509 commit 82aaba4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2364,6 +2364,21 @@ else # run HiGHS tests
end
end

@testset "Renewable Energy from Grid" begin
inputs = JSON.parsefile("./scenarios/re_emissions_elec_only.json") # PV, Generator, ElectricStorage

s = Scenario(inputs)
m = Model(optimizer_with_attributes(HiGHS.Optimizer, "output_flag" => false, "log_to_console" => false))
results = run_reopt(m, p)

bessloss = 0.96*0.975^0.5*0.96*0.975^0.5
grid2load = results["ElectricUtility"]["electric_to_load_series_kw"]
grid2bess = results["ElectricUtility"]["electric_to_storage_series_kw"]
gridRE = sum(grid2load + grid2bess - (grid2bess*(1-bessloss)) .* s.electric_utility.renewable_energy_fraction_series)

@test results["ElectricUtility"]["annual_renewable_electricity_supplied_kwh"] gridRE atol=1e-2
end

@testset "Back pressure steam turbine" begin
"""
Validation to ensure that:
Expand Down

0 comments on commit 82aaba4

Please sign in to comment.