Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RebuildHistory #6

Merged
merged 2 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
334 changes: 274 additions & 60 deletions Manifest.toml

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,28 @@ version = "0.1.0"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
ChangePointDetection = "68f453bf-a161-50e8-aafe-8ad75c8d6944"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
HypothesisTests = "09f84164-cd44-5f33-b23f-e6b0d136a0d5"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
Loess = "4345ca2d-374a-55d4-8d30-97f9976e7612"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
Missings = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
TimeSeries = "9e3dc215-6440-5c97-bce1-76c03772f85e"

[compat]
julia = "1"
DelimitedFiles = "1"
Downloads = "1"
Statistics = "1"
Optim = "1.7"
MacroTools = "0.5"
Optim = "1.7"
PrettyTables = "2"

Statistics = "1"
julia = "1"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
5 changes: 5 additions & 0 deletions components/nitrogen.comp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Nitrogen
1
N
2
28.0134
46 changes: 46 additions & 0 deletions demo2.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using FlowsheetTools

syscomps = ComponentList()
count = readcomponentlist!(syscomps, "components", ["Ethylene", "Ethane", "Hydrogen"])




# The next one should error
# sysstreams["Wrong"] = readstreamhistory(joinpath("streamhistories", "WrongStream.csv"), "Wrong", syscomps; ismoleflow=true)

dummy = emptystream(sysstreams, "Dummy")
dummy = sysstreams["Feed"]
dummies = sysstreams[["Feed", "Product"]]

count = length(sysstreams)

dummy = dummies[1] + dummies[2]
dummy = 2 * dummy
dummy = dummy * 2

shortstreams = StreamList()
shortstreams["Feed"] = readstreamhistory(joinpath("streamhistories", "FeedStreamShort.csv"), "Feed", syscomps; ismoleflow=true)

# Iterate through the CompList - returns pairs of names and Component objects
for (compname, comp) in syscomps
println(compname)
end

# Iterate through the StreamList - returns pairs of names and Stream objects
for (streamname, stream) in sysstreams
println(streamname)
end

sysunits = UnitOpList()

@unitop begin
inlets --> ["Feed"]
outlets --> ["Product"]
calc --> mixer!
end "Mixer" sysstreams sysunits

# Iterate through the UnitOpList - returns pairs of names and UnitOp objects
for (unitopname, unitop) in sysunits
println(unitopname)
end
Loading