avinashresearch1 / comphens.jl Goto Github PK
View Code? Open in Web Editor NEWComputational Tools for Heat Exchanger Network Synthesis
License: MIT License
Computational Tools for Heat Exchanger Network Synthesis
License: MIT License
The goal is to develop a webapp/website through which the user can input stream data, run CompHENS and get out the desired output. The most straightforward approach may be to use the GenieFramework https://genieframework.com/ and https://github.com/GenieFramework/Genie.jl. This can be tested out first with serving the results of a smaller feature e.g., the minimum utilities problem, the composite curves, the heat cascade table.
The idea is to output a publication quality HEN graph automatically. Ideas are to use visualization utilities within Plasmo.jl https://github.com/plasmo-dev/Plasmo.jl or make modifications to TikzGraphs.jl https://github.com/JuliaTeX/TikzGraphs.jl
Port over SP3: Heat Load Distributions from SeqHENS.jl
Rahul TBD.
This involves running several cases ideally including a number of edge cases for Heat Exchanger Network Synthesis. A good paper to start working on is: https://doi.org/10.1016/j.applthermaleng.2012.10.022. It is useful to use the BenchmarkTools.jl
tool. Benchmark SeqHENS (solve multiple and large literature problems). HT to work on this.
new
function inside the struct.How to incorporate measures of simple designs into the optimization problem, ideally without using binary variables.
Particularly for the SP3 MILP, efficient techniques say to train a branching policy.
Occurs when e.g. a hot utility stream is provided in the stream data but not used. Quick fix is not considering that utility stream.
@time using CompHENS
using Plots
using JuMP
using HiGHS
using Test
file_path_xlsx = joinpath(@DIR, "CompHENS_interface_MWE.xlsx")
prob = ClassicHENSProblem(file_path_xlsx; ΔT_min = 45.0, verbose = true)
@time solve_minimum_utilities_subproblem!(prob; verbose = true)
model::AbstractModel, overall_network::Dict{String, AbstractSuperstructure}, file_name; digits = 1)
@time solve_minimum_units_subproblem!(prob)
EMAT = 2.5
prob.results_dict[:add_units] = 1
@time generate_stream_matches!(prob, EMAT; digits = 8, verbose = true)
Targetting with heat pumps involved.
Advanced decomposition ideas for the NLP. Low priority. Overlapping Schwarz.
Include targetting for steam cycles, ORCs etc.
utility.Q
to undef
from Inf
. Also requires changing logic that checks utility.Q == Inf
and is_infinite
Q[i,j,k]
to 0.0 when either i or j does not participate in the interval? May lower the computational cost for more expensive problems? May not matter if taken care of in preprocessing.The network generation subproblem is infeasible:
# Workflow using XLSX input:
# 1. Import necessary packages:
@time using CompHENS
using Plots
using JuMP
using HiGHS
using Test
using BARON
using XLSX
using DataFrames
# 2. Specify path to xlsx file
file_path_xlsx = joinpath(@__DIR__, "CompHENS_interface_KangLiu_Period1.xlsx")
prob = ClassicHENSProblem(file_path_xlsx; ΔT_min = 10, verbose = true)
@time solve_minimum_utilities_subproblem!(prob; verbose = true)
@time solve_minimum_units_subproblem!(prob; verbose = true)
EMAT = 2.5
prob.results_dict[:add_units] = 1
@time generate_stream_matches!(prob, EMAT; digits = 8, verbose = true)
# Network generation:
# Specify which superstructure to use for each stream
# Default is below:
overall_network = construct_superstructure(prob.all_names, FloudasCiricGrossmann(), prob)
obj_func = CostScaledPaterson()
base_cost, cost_coeff, scaling_coeff = 8333.3, 641.7, 1
optimizer = optimizer_with_attributes(BARON.Optimizer, "MaxTime" => -1, "AbsConFeasTol" => 1)
results_df = generate_network!(prob, EMAT; optimizer = optimizer, obj_func = obj_func, verbose = true, cost_coeff = cost_coeff, scaling_coeff = scaling_coeff, base_cost = base_cost, save_model = true)
Low priority. Formulating the Simulataneous MINLP approach, get fast local solutions. Bertsimas paper.
Re-write this for the multiple utilities case with helps from Plasmo.jl
Port over SP2 from SeqHENS.jl. Write tests.
Overview of type hierarchy and code flow:
Goal: To provide an extensible toolkit that is agnostic to synthesis algorithm.
AbstractHENSProblem
: The classical Heat Exchanger Network Synthesis (HENS) problem. All other processes are fixed, so mass flows and temperatures are fixed. Output: The designed HEN as well as other useful data such as the GCC etc. Only simple utility configurations are considered.AbstractUtilityHENSProblem
: Synthesis of both the utility system and the HEN. See: Martelli_Marechal_2017.AbstractProcessHENSProblem
: Synthesis of generalized process and HEN. See Duran_Grossmann_1986. One may also want to implement a generalized background process superstructure that may alternately that may take in organic rankine cycles, steam cycles, heat pump systems and so on. This is reach goal, may be more feasible to start with sub-systems e.g. AbstractSteamCycleHENSProblem
, AbstractHeatPumpHENSProblem
.The overall AbstractSynthesisAlgorithm
holds types for the techniques to solve one or more of the above problems. As much as possible, these algorithms are named according to the first and last author of the published paper. For instance, one may use the Papoulias_Grossmann_1983()
algorithm or the Anantharaman_Gundersen_2010()
algorithm for a relevant problem.
The above algorithms involve subproblems usually held within an AbstractSubProblem
type. One reach goal could be to also allow multiple AbstractSubProblemAlgorithm
that solve certain subproblems. Each of these may make use of different AbstractSuperstructures
.
In general, _Problem
holds the problem data, _Algorithm
works on the sub-problem. A listing of appropriate algorithms for appropriate sub-problems will be documented in the Read-Me (with appropriate checks).
A return type under AbstractSolution
will generally be used to hold return types. For subproblems, AbstractSubProblemSolution
may be used while AbstractFullSolution
may be used for overall problems.
As much as possible, the style conventions and guide provided generally by the SciML Organization and specifically followed in SciMLBase will be followed. An attempt at documenting the code design decisions with issues is also made.
“Difficulty index” to qualify the problem. Most relevant for MILPs (min units and HLD generator). Basically, the idea is to figure out how difficult the SP2 and SP3 MILPs will be prior to actually solving them. RA and FH to provide inputs.
The development of the Heat Exchanger Network involves solving a network optimization problem. This section will likely need to be re-written from scratch, using sophisticated tools for generation of graph-based optimization problems. Likely Plasmo.jl https://github.com/plasmo-dev/Plasmo.jl
Include the option for multiple utilities.
If the speed to construct the optimization problem in JuMP becomes a barrier, consider removing macros. Avoiding that is a lot of work and takes a lot of learning about JuMP (or ideally MathOptInterface) though. Depending on how big the problems become, the inefficiency of macro usage can actually become very noticeable (especially when you start thinking about the nonlinear problems). For now I think this is fine but something to keep in mind.
Add documenter.jl. Docs badge.
Link to HYSYS/ASPEN+ simulation to get stream data for HENS
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.