Skip to content
Open
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
17 changes: 17 additions & 0 deletions Streams/streams.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
struct Stream
name::String
Tin::Float64
Tout::Float64
Cp::Float64
type::Symbol
function Stream(name::String, Tin::Float64, Tout::Float64, Cp::Float64, type::Symbol)
@assert Cp > 0 "Heat capacity Cp must be positive."
@assert type in (:hot, :cold) "Stream type must be :hot or :cold."
if type == :hot
@assert Tin > Tout "Hot streams must have Tin > Tout."
else
@assert Tin < Tout "Cold streams must have Tin < Tout."
end
return new(name, Tin, Tout, Cp, type)
end
end