From a88e71268a62c37bc8deab6d34cf3e9541b4ab4d Mon Sep 17 00:00:00 2001 From: avinashresearch1 Date: Sat, 13 Jul 2024 13:00:05 +0200 Subject: [PATCH] feat[WIP]: Add working terminal temperatures for all streams for use in terminal match feasibility tests --- src/Streams/streams.jl | 1 + .../starting_point_generator.jl | 22 ++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/Streams/streams.jl b/src/Streams/streams.jl index 705875f..4ef20e5 100644 --- a/src/Streams/streams.jl +++ b/src/Streams/streams.jl @@ -44,6 +44,7 @@ mutable struct ColdStream <: AbstractStream T_in <= T_out || error("Supply and Target temperature don't match stream type") mcp >= 0.0 || error("mcp values negative") # Can be zero if stream doesn't exist in one period. h > smallest_value || error("values infeasible") + push!(add_user_data, "Working Terminal T" => T_out) new(name, Float64(T_in), Float64(T_out), Float64(mcp), Float64(h), add_user_data, calc) end end diff --git a/src/SubProblems/Network_generation/starting_point_generator.jl b/src/SubProblems/Network_generation/starting_point_generator.jl index 483f59a..cc631d3 100644 --- a/src/SubProblems/Network_generation/starting_point_generator.jl +++ b/src/SubProblems/Network_generation/starting_point_generator.jl @@ -33,10 +33,30 @@ end @variable(model, 0.0 <= t[all_e_tuple_vec]) @variable(model, 0.0 <= f[stream_e_tuple_vec]) +# Initialize all the Working Terminal Temperatures to T_out: +for (k,v) in prob.all_dict + v = prob.all_dict["H2"] + push!(v.add_user_data, "Working Terminal T" => v.T_out) +end + #TODO: -function test_terminal_match() + +""" +Test if the `matching_stream` can be feasibly placed as the terminal serial heat exchanger of the `stream` +""" +function test_terminal_match(stream_name::String, matching_stream_name::String) end +function _test_terminal_match(stream::Union{ColdStream}, matching_stream::Union{HotStream, SimpleHotUtility}) +end + +stream_name = "C2" +matching_stream_name = "ST" + +stream = prob.all_dict[stream_name] +matching_stream = prob.all_dict[matching_stream_name] + + function get_utility_match_start_vals() end utils_dict = merge(prob.cold_utilities_dict, prob.hot_utilities_dict)