Skip to content
LIBRARY
Fittings.FlowDivider.md

Fittings.FlowDivider

Splits an incoming mass flow from port_a such that the flow to port_b is reduced by a factor n, with the remainder exiting via an open port.

This component models a flow splitting device where an incoming mass flow rate, dotma (represented by m_flow_a and sourced from port_a.m_flow), is divided. A fraction of this flow is directed to port_b, resulting in an outgoing mass flow rate, dotmb (represented by m_flow_b and connected to port_b.m_flow). The governing equations are:

dotmb=fracdotmandotmopen=dotmadotmb

where n is the division factor parameter and dotmopen is the mass flow rate expelled through the open port. This ensures mass conservation. The component is useful for modeling parallel tubes efficiently by placing a FlowDivider on each end of a tube, with the extra flow being dumped into the open port.

Usage

HydraulicComponents.Fittings.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

dyad
"""
Splits an incoming mass flow from `port_a` such that the flow to `port_b` is reduced by a factor `n`, with the remainder exiting via an `open` port.

This component models a flow splitting device where an incoming mass flow rate,
$\\dot{m}_{a}$ (represented by `m_flow_a` and sourced from `port_a.m_flow`), is divided.
A fraction of this flow is directed to `port_b`, resulting in an outgoing mass flow rate,
$\\dot{m}_{b}$ (represented by `m_flow_b` and connected to `port_b.m_flow`).
The governing equations are:

math \dot{m}{b} = \frac{\dot{m}{a}}{n}
\dot{m}{open} = \dot{m} - \dot{m}_

where `n` is the division factor parameter and $\\dot{m}_{open}$ is the mass flow
rate expelled through the `open` port. This ensures mass conservation.
The component is useful for modeling parallel tubes efficiently by placing
a `FlowDivider` on each end of a tube, with the extra flow being dumped
into the `open` port.
"""
component FlowDivider
  "Input port for the flow to be divided"
  port_a = HydraulicComponents.Interfaces.Port() {
    "Dyad": {
      "placement": {
        "diagram": {"x1": -20, "x2": 20, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0}
      }
    }
  }
  "Output port for the main divided flow"
  port_b = HydraulicComponents.Interfaces.Port() {
    "Dyad": {
      "placement": {
        "diagram": {"x1": 980, "x2": 1020, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0}
      }
    }
  }
  "Output port for the remaining (excess) flow"
  open = HydraulicComponents.Interfaces.Port() {
    "Dyad": {
      "placement": {
        "diagram": {"x1": 480, "x2": 520, "y1": 980, "y2": 1020, "sh": 1, "sw": 1, "rot": 0}
      }
    }
  }
  "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 {
  "Dyad": {
    "icons": {"default": "dyad://HydraulicComponents/FlowDivider.svg"},
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}]
  }
}
end
Flattened Source
dyad
"""
Splits an incoming mass flow from `port_a` such that the flow to `port_b` is reduced by a factor `n`, with the remainder exiting via an `open` port.

This component models a flow splitting device where an incoming mass flow rate,
$\\dot{m}_{a}$ (represented by `m_flow_a` and sourced from `port_a.m_flow`), is divided.
A fraction of this flow is directed to `port_b`, resulting in an outgoing mass flow rate,
$\\dot{m}_{b}$ (represented by `m_flow_b` and connected to `port_b.m_flow`).
The governing equations are:

math \dot{m}{b} = \frac{\dot{m}{a}}{n}
\dot{m}{open} = \dot{m} - \dot{m}_

where `n` is the division factor parameter and $\\dot{m}_{open}$ is the mass flow
rate expelled through the `open` port. This ensures mass conservation.
The component is useful for modeling parallel tubes efficiently by placing
a `FlowDivider` on each end of a tube, with the extra flow being dumped
into the `open` port.
"""
component FlowDivider
  "Input port for the flow to be divided"
  port_a = HydraulicComponents.Interfaces.Port() {
    "Dyad": {
      "placement": {
        "diagram": {"x1": -20, "x2": 20, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0}
      }
    }
  }
  "Output port for the main divided flow"
  port_b = HydraulicComponents.Interfaces.Port() {
    "Dyad": {
      "placement": {
        "diagram": {"x1": 980, "x2": 1020, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0}
      }
    }
  }
  "Output port for the remaining (excess) flow"
  open = HydraulicComponents.Interfaces.Port() {
    "Dyad": {
      "placement": {
        "diagram": {"x1": 480, "x2": 520, "y1": 980, "y2": 1020, "sh": 1, "sw": 1, "rot": 0}
      }
    }
  }
  "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 {
  "Dyad": {
    "icons": {"default": "dyad://HydraulicComponents/FlowDivider.svg"},
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}]
  }
}
end


Test Cases

No test cases defined.

  • Examples

  • Experiments

  • Analyses