|
1 | | -@connector HeatPort begin |
2 | | - T(t), [guess = 273.15 + 20.0] |
3 | | - Q_flow(t), [guess = 0.0, connect = Flow] |
| 1 | +@connector function HeatPort(; T = nothing, T_guess = 273.15 + 20, Q_flow = nothing, Q_flow_guess = 0.0, name) |
| 2 | + pars = @parameters begin |
| 3 | + T_guess = T_guess |
| 4 | + Q_flow_guess = Q_flow_guess |
| 5 | + end |
| 6 | + vars = @variables begin |
| 7 | + T(t) = T, [guess = T_guess] |
| 8 | + Q_flow(t) = Q_flow, [guess = Q_flow_guess, connect = Flow] |
| 9 | + end |
| 10 | + return ODESystem(Equation[], t, vars, pars; name) |
4 | 11 | end |
5 | 12 | Base.@doc """ |
6 | | - HeatPort(; name, T = 273.15 + 20.0, Q_flow = 0.0) |
| 13 | + HeatPort(; T = nothing, T_guess = 273.15 + 20, Q_flow = nothing, Q_flow_guess = 0.0, name) |
7 | 14 |
|
8 | 15 | Port for a thermal system. |
| 16 | +# Parameters: |
| 17 | +- `T_guess`: [K] Initial guess for the temperature of the port (set to 273.15 + 20). |
| 18 | +- `Q_flow_guess`: [W] Initial guess for the heat flow rate at the port (set to 0.0). |
9 | 19 |
|
10 | 20 | # States: |
11 | | -- `T`: [K] Temperature of the port. It accepts an initial value, which defaults to 273.15 + 20. |
12 | | -- `Q_flow`: [W] Heat flow rate at the port. It accepts an initial value, which defaults to 0.0. |
| 21 | +- `T`: [K] Temperature of the port. Guess set to `T_guess`. Passing a value for `T` will set its default. |
| 22 | +- `Q_flow`: [W] Heat flow rate at the port. Guess set to `Q_flow_guess`. Passing a value for `Q_flow` will set its default. |
13 | 23 | """ HeatPort |
14 | 24 |
|
15 | 25 | """ |
|
0 commit comments