Skip to content

Commit

Permalink
Get Site outdoor air temperature "input" from REopt.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill-Becker committed Sep 10, 2024
1 parent 4770a90 commit 49ec5d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions julia_src/http.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ function reopt(req::HTTP.Request)
"CHP" => chp_dict,
"SteamTurbine" => steamturbine_dict,
"GHP" => ghp_dict,
"ExistingChiller" => chiller_dict
)
"ExistingChiller" => chiller_dict,
"Site" => Dict(key=>getfield(model_inputs.s.site, key) for key in [:outdoor_air_temperature_degF]),
)
catch e
@error "Something went wrong in REopt optimization!" exception=(e, catch_backtrace())
error_response["error"] = sprint(showerror, e) # append instead of rewrite?
Expand Down
4 changes: 3 additions & 1 deletion reoptjl/src/process_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
HotThermalStorageOutputs, ColdThermalStorageOutputs, OutageOutputs,\
REoptjlMessageOutputs, AbsorptionChillerOutputs, BoilerOutputs, SteamTurbineInputs, \
SteamTurbineOutputs, GHPInputs, GHPOutputs, ExistingChillerInputs, \
ElectricHeaterOutputs, ASHPSpaceHeaterOutputs, ASHPWaterHeaterOutputs
ElectricHeaterOutputs, ASHPSpaceHeaterOutputs, ASHPWaterHeaterOutputs, \
SiteInputs
import numpy as np
import sys
import traceback as tb
Expand Down Expand Up @@ -120,6 +121,7 @@ def update_inputs_in_database(inputs_to_update: dict, run_uuid: str) -> None:
# get input models that need updating
FinancialInputs.objects.filter(meta__run_uuid=run_uuid).update(**inputs_to_update["Financial"])
ElectricUtilityInputs.objects.filter(meta__run_uuid=run_uuid).update(**inputs_to_update["ElectricUtility"])
SiteInputs.objects.filter(meta__run_uuid=run_uuid).update(**inputs_to_update["Site"])

if inputs_to_update["CHP"]: # Will be an empty dictionary if CHP is not considered
CHPInputs.objects.filter(meta__run_uuid=run_uuid).update(**inputs_to_update["CHP"])
Expand Down

0 comments on commit 49ec5d1

Please sign in to comment.