Skip to content
FixedVolume.md

FixedVolume ​

Represents a chamber with fixed-volume.

This component models a control volume of fixed geometric size vol. The total mass m of the fluid in the volume is calculated as m = rho * vol. The component conserves mass, meaning the net mass flow rate port.m_flow through the port is equal to the rate of change of mass within the volume:

port.mflow=dmdt

The initial pressure in the volume is set by the parameter p0. The pressure p within the volume is exposed at the port.

Usage ​

FixedVolume(p0, vol)

Parameters: ​

NameDescriptionUnitsDefault value
p0Initial pressure within the fixed volume.Pa
volThe geometric volume of the chamber, which is constant.m3

Connectors ​

Variables ​

NameDescriptionUnits
rhoDensity of the fluid within the volume.kg/m3
mTotal mass of the fluid contained within the volume.kg
pInstantaneous pressure of the fluid within the volume.Pa

Behavior ​

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

Source ​

dyad
# Represents a chamber with fixed-volume.
#
# This component models a control volume of fixed geometric size `vol`.
# The total mass `m` of the fluid in the volume is calculated as `m = rho * vol`.
# The component conserves mass, meaning the net mass flow rate `port.m_flow`
# through the port is equal to the rate of change of mass within the volume:
# ```math
# port.m_flow = \frac{dm}{dt}
# ```
# The initial pressure in the volume is set by the parameter `p0`. The pressure `p`
# within the volume is exposed at the `port`.
component FixedVolume
  # Fluid port for connection, allowing mass flow and pressure exchange.
  port = Port() [{
    "Dyad": {
      "placement": {
        "diagram": {"x1": -20, "x2": 20, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0}
      }
    }
  }]
  # Initial pressure within the fixed volume.
  parameter p0::Pressure
  # The geometric volume of the chamber, which is constant.
  parameter vol::Volume
  # Density of the fluid within the volume.
  variable rho::Density
  # Total mass of the fluid contained within the volume.
  variable m::Mass
  # Instantaneous pressure of the fluid within the volume.
  variable p::Pressure
relations
  initial p = p0
  rho = density(port.medium, p)
  m = rho*vol
  port.m_flow = der(m)
  port.p = p
end
Flattened Source
dyad
# Represents a chamber with fixed-volume.
#
# This component models a control volume of fixed geometric size `vol`.
# The total mass `m` of the fluid in the volume is calculated as `m = rho * vol`.
# The component conserves mass, meaning the net mass flow rate `port.m_flow`
# through the port is equal to the rate of change of mass within the volume:
# ```math
# port.m_flow = \frac{dm}{dt}
# ```
# The initial pressure in the volume is set by the parameter `p0`. The pressure `p`
# within the volume is exposed at the `port`.
component FixedVolume
  # Fluid port for connection, allowing mass flow and pressure exchange.
  port = Port() [{
    "Dyad": {
      "placement": {
        "diagram": {"x1": -20, "x2": 20, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0}
      }
    }
  }]
  # Initial pressure within the fixed volume.
  parameter p0::Pressure
  # The geometric volume of the chamber, which is constant.
  parameter vol::Volume
  # Density of the fluid within the volume.
  variable rho::Density
  # Total mass of the fluid contained within the volume.
  variable m::Mass
  # Instantaneous pressure of the fluid within the volume.
  variable p::Pressure
relations
  initial p = p0
  rho = density(port.medium, p)
  m = rho*vol
  port.m_flow = der(m)
  port.p = p
metadata {}
end


Test Cases ​

No test cases defined.