FixedVolume
Fixed fluid volume.
Usage
FixedVolume(p0, vol)
Parameters:
Name | Description | Units | Default value |
---|---|---|---|
p0 | Initial pressure | Pa | |
vol | m3 |
Connectors
port
- (Port
)
Variables
Name | Description | Units |
---|---|---|
rho | kg/m3 | |
m | kg | |
p | Pa |
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"
Related
Examples
Experiments
Analyses
Tests