$(instance)FlowDivider Icon

FlowDivider

Reduces the flow from port_a to port_b by n. Useful for modeling parallel tubes efficiently by placing a FlowDivider on each end of a tube. Extra flow is dumped into an open port.

Usage

FlowDivider(n)

Parameters:

NameDescriptionUnitsDefault value
nDivide flow from port_a to port_b by n

Connectors

Variables

NameDescriptionUnits
m_flow_aMass flow of port_akg/s
m_flow_bMass flow of port_bkg/s

Behavior

Behavior of this component cannot be rendered because it includes path variables.

Source

# Reduces the flow from `port_a` to `port_b` by `n`. Useful for modeling parallel
# tubes efficiently by placing a `FlowDivider` on each end of a tube.
# Extra flow is dumped into an `open` port.
component FlowDivider
  port_a = Port()
  port_b = Port()
  open = Port()
  # Divide flow from `port_a` to `port_b` by `n`
  parameter n::Real
  # Mass flow of `port_a`
  variable m_flow_a::MassFlowRate
  # Mass flow of `port_b`
  variable m_flow_b::MassFlowRate
relations
  continuity(port_a.medium, port_b.medium, open.medium)
  m_flow_a = port_a.m_flow
  m_flow_b = port_b.m_flow
  m_flow_b = m_flow_a/n
  open.m_flow = m_flow_a-m_flow_b
end
Flattened Source
# Reduces the flow from `port_a` to `port_b` by `n`. Useful for modeling parallel
# tubes efficiently by placing a `FlowDivider` on each end of a tube.
# Extra flow is dumped into an `open` port.
component FlowDivider
  port_a = Port()
  port_b = Port()
  open = Port()
  # Divide flow from `port_a` to `port_b` by `n`
  parameter n::Real
  # Mass flow of `port_a`
  variable m_flow_a::MassFlowRate
  # Mass flow of `port_b`
  variable m_flow_b::MassFlowRate
relations
  continuity(port_a.medium, port_b.medium, open.medium)
  m_flow_a = port_a.m_flow
  m_flow_b = port_b.m_flow
  m_flow_b = m_flow_a/n
  open.m_flow = m_flow_a-m_flow_b
metadata {}
end

Test Cases

  • Examples
  • Experiments
  • Analyses