Skip to content

Commit 74b35ee

Browse files
committed
HeatPort refactored to macro syntax
1 parent 6bb01f5 commit 74b35ee

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/Thermal/utils.jl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
@connector function HeatPort(;
2-
T = nothing, T_guess = 273.15 + 20, Q_flow = nothing, Q_flow_guess = 0.0, name)
3-
pars = @parameters begin
4-
T_guess = T_guess
5-
Q_flow_guess = Q_flow_guess
1+
@connector HeatPort begin
2+
@parameters begin
3+
T_guess = 273.15 + 20
4+
Q_flow_guess = 0.0
65
end
7-
vars = @variables begin
8-
T(t) = T, [guess = T_guess]
9-
Q_flow(t) = Q_flow, [guess = Q_flow_guess, connect = Flow]
6+
7+
@variables begin
8+
T(t), [guess = T_guess]
9+
Q_flow(t), [guess = Q_flow_guess, connect = Flow]
1010
end
11-
return ODESystem(Equation[], t, vars, pars; name)
1211
end
1312
Base.@doc """
1413
HeatPort(; T = nothing, T_guess = 273.15 + 20, Q_flow = nothing, Q_flow_guess = 0.0, name)

0 commit comments

Comments
 (0)