Skip to content
Merged
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
24 changes: 12 additions & 12 deletions src/Thermal/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ Port for a thermal system.
""" HeatPort

"""
Element1D(; name, dT = 0.0, Q_flow = 0.0)
Element1D(; name, dT_guess = 0.0, Q_flow_guess = 0.0)

This partial model contains the basic connectors and variables to allow heat transfer models to be created that do not
store energy. This model defines and includes equations for the temperature drop across the element, `dT`, and the heat
flow rate through the element from `port_a` to `port_b`, `Q_flow`.

# States:

- `dT`: [`K`] Temperature difference across the component a.T - b.T. It accepts an initial value, which defaults to 0.0.
- `Q_flow`: [`W`] Heat flow rate from port a -> port b. It accepts an initial value, which defaults to 0.0.
- `dT`: [`K`] Temperature difference across the component a.T - b.T (algebraically constrained).
- `Q_flow`: [`W`] Heat flow rate from port a -> port b (algebraically constrained).

# Connectors:

`port_a`
`port_b`
"""
@component function Element1D(; dT = 0.0, Q_flow = 0.0, name)
@component function Element1D(; name, dT_guess = 0.0, Q_flow_guess = 0.0)
pars = @parameters begin
end

Expand All @@ -50,8 +50,8 @@ flow rate through the element from `port_a` to `port_b`, `Q_flow`.
end

vars = @variables begin
dT(t) = dT, [guess = 0.0]
Q_flow(t) = Q_flow, [guess = 0.0]
dT(t), [guess = dT_guess]
Q_flow(t), [guess = Q_flow_guess]
end

equations = Equation[
Expand All @@ -64,7 +64,7 @@ flow rate through the element from `port_a` to `port_b`, `Q_flow`.
end

"""
ConvectiveElement1D(; name, dT = 0.0, Q_flow = 0.0)
ConvectiveElement1D(; name, dT_guess = 0.0, Q_flow_guess = 0.0)

This partial model contains the basic connectors and variables to allow heat
transfer models to be created that do not store energy. This model defines and
Expand All @@ -73,15 +73,15 @@ flow rate through the element from `solid` to `fluid`, `Q_flow`.

# States:

- `dT`: [`K`] Temperature difference across the component `solid.T` - `fluid.T`. It accepts an initial value, which defaults to 0.0.
- `Q_flow`: [`W`] Heat flow rate from `solid` -> `fluid`. It accepts an initial value, which defaults to 0.0.
- `dT`: [`K`] Temperature difference across the component `solid.T` - `fluid.T` (algebraically constrained).
- `Q_flow`: [`W`] Heat flow rate from `solid` -> `fluid` (algebraically constrained).

# Connectors:

`solid`
`fluid`
"""
@component function ConvectiveElement1D(; dT = 0.0, Q_flow = 0.0, name)
@component function ConvectiveElement1D(; name, dT_guess = 0.0, Q_flow_guess = 0.0)
pars = @parameters begin
end

Expand All @@ -91,8 +91,8 @@ flow rate through the element from `solid` to `fluid`, `Q_flow`.
end

vars = @variables begin
dT(t) = dT, [guess = 0.0]
Q_flow(t) = Q_flow, [guess = 0.0]
dT(t), [guess = dT_guess]
Q_flow(t), [guess = Q_flow_guess]
end

equations = Equation[
Expand Down
Loading