Hi,
Modelica has a Media
library that captures the properties of various materials. It implements the equations given in IF97 (a version of was apparently implemented in Julia). It provides e.g. calculation of the Cp, Cv from temperature and pressure.
What’s the best practice to implement something similar in MTK (e.g. as part of a ThermalFluid library)?
In particular:
- How do you define the “type” of a component? i.e. I’d like to have a
Medium
“abstract type
” with propertiesCp
,Cv
, ‘ρ’ etc. with “concrete” components such as Water and Oil implementing it (sure, I can document what a “Medium” is required to provide, but I’d like MTK to enforce these interfaces) - IF97 is rather complex, with dozens of parameters, which are of little interest to most using it. We could implement IF97 fully as part of MTK, but using that model would import all those parameters and equations to the system using it. I think it makes sense for sub-systems to be (optionally) “black-boxes”, without all of their “internals” exposed.
DD