ModelingToolkitStandardLibrary.jl
ModelingToolkitStandardLibrary.jl copied to clipboard
Adds hydraulic library
There seems to be still an issue, maybe with the solver, I'm not sure. The mass flow rate should get to zero when the pressure of the volume is equal to the pressure of the source.
Rodas4
Tsit5
Since many components need some sort of media properties, I used the variable scope to lift them into the overall model where they can be centrally defined. Maybe there is a better way to do this. Modelica and Simscape do this via a special block that is present in the model.
Codecov Report
Merging #78 (0efd202) into main (70ff6ab) will decrease coverage by
0.08%
. The diff coverage is74.07%
.
:exclamation: Current head 0efd202 differs from pull request most recent head eb22c76. Consider uploading reports for the commit eb22c76 to get more accurate results
@@ Coverage Diff @@
## main #78 +/- ##
==========================================
- Coverage 69.42% 69.34% -0.09%
==========================================
Files 23 26 +3
Lines 942 985 +43
==========================================
+ Hits 654 683 +29
- Misses 288 302 +14
Impacted Files | Coverage Δ | |
---|---|---|
src/Hydraulic/sources.jl | 0.00% <0.00%> (ø) |
|
src/Hydraulic/utils.jl | 81.81% <81.81%> (ø) |
|
src/Hydraulic/components.jl | 100.00% <100.00%> (ø) |
|
src/Thermal/utils.jl | 90.00% <0.00%> (ø) |
|
src/Blocks/continuous.jl | 98.17% <0.00%> (ø) |
|
src/Thermal/HeatTransfer/sensors.jl | 100.00% <0.00%> (ø) |
|
src/Thermal/HeatTransfer/sources.jl | 100.00% <0.00%> (ø) |
|
src/Thermal/HeatTransfer/ideal_components.jl | 100.00% <0.00%> (ø) |
:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more
Works fine with smaller solver tolerance:
Conflicts.
Yes. looks like a standard numerical instability due to large dts.
@ValentinKaisermayer just curious: why are you modeling changes in density due to pressure but ignore temperature entirely? E.g. for water, 10K change in temperature is more significant than 10MPa change in pressure.
Because this library is supposed to model fluid systems where the change in temperature is negligible. This allows to avoid stream connectors all together. However, if this is an insufficient assumption for the modeling needs at hand, a ThermoFluid
domain is needed, i.e. #87.
I guess this is obsolete with #159