Skip to content
FixedVolume.md

FixedVolume

Fixed fluid volume.

Usage

FixedVolume(p0, vol)

Parameters:

NameDescriptionUnitsDefault value
p0Initial pressurePa
volm3

Connectors

Variables

NameDescriptionUnits
rhokg/m3
mkg
pPa

Behavior

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

Source

dyad
# Fixed fluid volume.
component FixedVolume
  port = Port()
  # Initial pressure
  parameter p0::Pressure
  parameter vol::Volume
  variable rho::Density
  variable m::Mass
  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
# Fixed fluid volume.
component FixedVolume
  port = Port()
  # Initial pressure
  parameter p0::Pressure
  parameter vol::Volume
  variable rho::Density
  variable m::Mass
  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

This is setup code, that must be run before each test case.

julia
using HydraulicComponents
using ModelingToolkit, OrdinaryDiffEqDefault
using Plots
using CSV, DataFrames

snapshotsdir = joinpath(dirname(dirname(pathof(HydraulicComponents))), "test", "snapshots")
"/home/actions-runner-10/.julia/packages/HydraulicComponents/EtOYG/test/snapshots"