This software provides a Julia-based toolkit for synthesis of Heat Exchanger Networks (HENs) using a mathematical programming framework. Currently, a sequential algorithm is implemented whereby an LP is formulated to determine the minimum utility consumption, MILP to determine the minimum number of units and the stream matches. Finally, an NLP is formulated to generate the network and calculate the HEN area.
If you use this toolkit, please cite: Avinash Subramanian, Flemming Holtorf, Rahul Anantharaman, Truls Gundersen. (2023). CompHENS: Computational Tools for Heat Exchanger Network Synthesis (Version v0.1.0) [Computer software] DOI: 10.5281/zenodo.7545869
- Clone this repo. Open the Julia repl, then
] activate .and]instantiate. This will install all required dependencies. - Test that this works on one of the examples such as by running the code in
Examples/XLSX_interface/ClassicHENSProblem/Colberg_Morari_1990/ColbergMorari.jl - For your own problem:
- Fill in the stream data in an xlsx file in a similar way as
CompHENS_interface_ColbergMorari.xlsx - The structure of the code that runs the problem is as follows:
- Fill in the stream data in an xlsx file in a similar way as
# Workflow using XLSX input:
# 1. Import necessary packages:
using CompHENS
using Plots
using JuMP
using HiGHS
using Ipopt
using MathOptInterface
using Test
const MOI = MathOptInterface
# 2. Specify path to xlsx file
file_path_xlsx = joinpath(@__DIR__, "CompHENS_interface_ColbergMorari.xlsx")
# 3. Construct the appropriate kind of problem: Here it is a `ClassicHENSProblem`. Specify the ΔT_min.
prob = ClassicHENSProblem(file_path_xlsx; ΔT_min = 20.0, verbose = true)
# 4. Solve minimum utilities problem
solve_minimum_utilities_subproblem!(prob)
print_min_utils_pinch_points(prob)
# 5. Solve the minimum number of units subproblem:
solve_minimum_units_subproblem!(prob)
@show prob.min_units
# 6. Generate stream matches. This requires specifying the EMAT and the number of additional units.
EMAT = 2.5
prob.results_dict[:add_units] = 1
@time generate_stream_matches!(prob, EMAT; digits = 8)
# View the results.
prob.results_dict[:Q]
# 7. Network generation:
# Specify which superstructure to use for each stream
obj_func = CostScaledPaterson()
overall_network = merge(construct_superstructure(prob.stream_names, FloudasCiricGrossmann(), prob), construct_superstructure(prob.utility_names, FloudasCiricGrossmann(), prob))
# Specify base costs, scaling coefficinets.
base_cost, cost_coeff, scaling_coeff = 8600, 670, 0.83
optimizer = optimizer_with_attributes(Ipopt.Optimizer, "print_level" => 0, "max_iter" => 5000, "tol" => 1e-6)
generate_network!(prob, EMAT; overall_network = overall_network, obj_func = obj_func, optimizer = optimizer, verbose = true, cost_coeff = cost_coeff, scaling_coeff = scaling_coeff, base_cost = base_cost, save_model = true)
model = prob.results_dict[:network_gen_model]
# If this fails, the optimizer has failed to find a local minimum
@test termination_status(model) in [MOI.LOCALLY_SOLVED, MOI.OPTIMAL, MOI.ALMOST_LOCALLY_SOLVED, MOI.ALMOST_OPTIMAL]
@show termination_status(model)
@test primal_status(model) == MOI.FEASIBLE_POINT
# print(model)
value.(model[:ΔT_upper])
value.(model[:ΔT_lower])
value.(model[:T_LMTD])
get_design_area(prob)
- Download the 2 interface files from: https://github.com/avinashresearch1/CompHENS.jl/tree/main/NoCode_Interface and put them in a folder of your choice (same files from email).
- Type in the stream data in the
InputData.xlsxfile. Note that all streams must have a sensible temperature difference (say use a 1 C temperature difference for condensing steam). - Download and Install Julia from Julia website. The No-Code interface only requires the Julia REPL.
- From the Julia REPL, access the Package Manager by typing:
]. InstallCompHENSandPluto
- Once everything is installed, exit the package manager by typing backspace. Type
using Pluto; Pluto.run(). This will launch the browser. - Navigate to your directory to the
Interface.jl file. Pluto will launch. - The slider can be used to move the composite curves. The curves update automatically with changing the
DT_min.
Note: It may be necessary to re-run the Pluto notebook in case of errors: Click out of any cell, and Ctrl+Afollowed by Shift+Enter.











