From 49ec5d14fc7ecf5dee6ed568f28750bef53ba67a Mon Sep 17 00:00:00 2001 From: bill-becker Date: Mon, 9 Sep 2024 19:44:30 -0600 Subject: [PATCH] Get Site outdoor air temperature "input" from REopt.jl --- julia_src/http.jl | 5 +++-- reoptjl/src/process_results.py | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/julia_src/http.jl b/julia_src/http.jl index 42ee290da..ddf2f31fa 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -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? diff --git a/reoptjl/src/process_results.py b/reoptjl/src/process_results.py index 832000813..4650903cc 100644 --- a/reoptjl/src/process_results.py +++ b/reoptjl/src/process_results.py @@ -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 @@ -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"])