Skip to content

Commit

Permalink
feat: add metadata field to FloudasCiricGrossmann to hold user define…
Browse files Browse the repository at this point in the history
…d data
  • Loading branch information
avinashresearch1 committed Jul 14, 2024
1 parent b2668b8 commit 3d75143
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ hot_utilities = filter(working_HX_list) do (k,v)
end

hot_util = only(keys(hot_utilities))
cold_stream = only(working_HX_list[hot_util])
cold_stream = only(working_HX_list[hot_util]) # Not gen.
#for hot_util in hot_utilities
for cold_stream in working_HX_list[hot_util]
@show cold_stream
Expand Down
9 changes: 5 additions & 4 deletions src/Superstructures/FloudasCiricGrossmann.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ Naming convention for `nodes`. Type of the node (see below) `<type>_<stream_name
"""
struct FloudasCiricGrossmann <: AbstractSplitSuperstructure
nodes::Union{Nothing, Vector{Node}}
edges::Union{Nothing, Vector{Edge}}
end
edges::Union{Nothing, Vector{Edge}}
metadata::Dict{Symbol, Any}
end # TODO: Change this to use parametric types.

function FloudasCiricGrossmann(; verbose = true)
verbose && @info "Using Superstructure: Floudas, C.A., Ciric, A.R. and Grossmann, I.E., Automatic synthesis of optimum heat exchanger network configurations. AIChE Journal. 1986."
FloudasCiricGrossmann(nothing, nothing)
FloudasCiricGrossmann(nothing, nothing, Dict{Symbol, Any}())
end

function FloudasCiricGrossmann(stream::String, prob::ClassicHENSProblem; verbose = true)
Expand Down Expand Up @@ -65,7 +66,7 @@ function FloudasCiricGrossmann(stream::String, prob::ClassicHENSProblem; verbose
length(filter(edge -> edge.in == mixer, edges)) == 1 || error("Each mixer only has a single outgoing edge")
end

return FloudasCiricGrossmann(nodes, edges)
return FloudasCiricGrossmann(nodes, edges, Dict{Symbol, Any}())
end

function construct_superstructure(stream::String, superstructure::FloudasCiricGrossmann, prob::ClassicHENSProblem; verbose = true)
Expand Down

0 comments on commit 3d75143

Please sign in to comment.